Skip to content

Commit 5278ba1

Browse files
committed
ENH: Find graymid/midthickness surfs
1 parent 6c23846 commit 5278ba1

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ def test_ReconAll_outputs():
151151
),
152152
filled=dict(loc='mri',
153153
),
154+
graymid=dict(altkey=['graymid', 'midthickness'],
155+
loc='surf',
156+
),
154157
inflated=dict(loc='surf',
155158
),
156159
jacobian_white=dict(loc='surf',

nipype/interfaces/io.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,6 +1546,9 @@ class FSSourceOutputSpec(TraitedSpec):
15461546
File(exists=True),
15471547
desc='Distortion required to register to spherical atlas',
15481548
loc='surf')
1549+
graymid = OutputMultiPath(
1550+
File(exists=True), desc='Graymid/midthickness surface meshes',
1551+
loc='surf', altkey=['graymid', 'midthickness'])
15491552
label = OutputMultiPath(
15501553
File(exists=True), desc='Volume and surface label files',
15511554
loc='label', altkey='*label')
@@ -1617,12 +1620,12 @@ def _get_files(self, path, key, dirval, altkey=None):
16171620
globprefix = '*'
16181621
elif key in ('aseg_stats', 'wmparc_stats'):
16191622
globprefix = ''
1620-
keydir = os.path.join(path, dirval)
1621-
if altkey:
1622-
key = altkey
1623-
globpattern = os.path.join(
1624-
keydir, ''.join((globprefix, key, globsuffix)))
1625-
return [os.path.abspath(f) for f in glob.glob(globpattern)]
1623+
keys = filename_to_list(altkey) if altkey else [key]
1624+
globfmt = os.path.join(path, dirval,
1625+
''.join((globprefix, '{}', globsuffix)))
1626+
return [os.path.abspath(f)
1627+
for key in keys
1628+
for f in glob.glob(globfmt.format(key))]
16261629

16271630
def _list_outputs(self):
16281631
subjects_dir = self.inputs.subjects_dir

nipype/interfaces/tests/test_auto_FreeSurferSource.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ def test_FreeSurferSource_outputs():
6666
),
6767
filled=dict(loc='mri',
6868
),
69+
graymid=dict(altkey=['graymid', 'midthickness'],
70+
loc='surf',
71+
),
6972
inflated=dict(loc='surf',
7073
),
7174
jacobian_white=dict(loc='surf',

0 commit comments

Comments
 (0)