diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py index 61f733cc2f..2ca018729d 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py @@ -151,6 +151,9 @@ def test_ReconAll_outputs(): ), filled=dict(loc='mri', ), + graymid=dict(altkey=['graymid', 'midthickness'], + loc='surf', + ), inflated=dict(loc='surf', ), jacobian_white=dict(loc='surf', diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 47fe983383..cfdedd8870 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -1546,6 +1546,9 @@ class FSSourceOutputSpec(TraitedSpec): File(exists=True), desc='Distortion required to register to spherical atlas', loc='surf') + graymid = OutputMultiPath( + File(exists=True), desc='Graymid/midthickness surface meshes', + loc='surf', altkey=['graymid', 'midthickness']) label = OutputMultiPath( File(exists=True), desc='Volume and surface label files', loc='label', altkey='*label') @@ -1617,12 +1620,12 @@ def _get_files(self, path, key, dirval, altkey=None): globprefix = '*' elif key in ('aseg_stats', 'wmparc_stats'): globprefix = '' - keydir = os.path.join(path, dirval) - if altkey: - key = altkey - globpattern = os.path.join( - keydir, ''.join((globprefix, key, globsuffix))) - return [os.path.abspath(f) for f in glob.glob(globpattern)] + keys = filename_to_list(altkey) if altkey else [key] + globfmt = os.path.join(path, dirval, + ''.join((globprefix, '{}', globsuffix))) + return [os.path.abspath(f) + for key in keys + for f in glob.glob(globfmt.format(key))] def _list_outputs(self): subjects_dir = self.inputs.subjects_dir diff --git a/nipype/interfaces/tests/test_auto_FreeSurferSource.py b/nipype/interfaces/tests/test_auto_FreeSurferSource.py index 246169b457..1af0874410 100644 --- a/nipype/interfaces/tests/test_auto_FreeSurferSource.py +++ b/nipype/interfaces/tests/test_auto_FreeSurferSource.py @@ -66,6 +66,9 @@ def test_FreeSurferSource_outputs(): ), filled=dict(loc='mri', ), + graymid=dict(altkey=['graymid', 'midthickness'], + loc='surf', + ), inflated=dict(loc='surf', ), jacobian_white=dict(loc='surf',