From abc9a96f46765cf8ca3295e18e14ee8fdfd295e3 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Mon, 20 Mar 2017 16:57:25 -0400 Subject: [PATCH 1/2] Split over-eager globs in FreeSurferSource --- .../freesurfer/tests/test_auto_ReconAll.py | 10 ++++++++ nipype/interfaces/io.py | 24 +++++++++++++++++-- .../tests/test_auto_FreeSurferSource.py | 10 ++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py index b0e89e9a3f..61f733cc2f 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py @@ -124,17 +124,25 @@ def test_ReconAll_outputs(): aparc_stats=dict(altkey='aparc', loc='stats', ), + area_pial=dict(altkey='area.pial', + loc='surf', + ), aseg=dict(loc='mri', ), aseg_stats=dict(altkey='aseg', loc='stats', ), + avg_curv=dict(loc='surf', + ), brain=dict(loc='mri', ), brainmask=dict(loc='mri', ), curv=dict(loc='surf', ), + curv_pial=dict(altkey='curv.pial', + loc='surf', + ), curv_stats=dict(altkey='curv', loc='stats', ), @@ -145,6 +153,8 @@ def test_ReconAll_outputs(): ), inflated=dict(loc='surf', ), + jacobian_white=dict(loc='surf', + ), label=dict(altkey='*label', loc='label', ), diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 815d2c0b0d..38a00dcf78 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -1511,12 +1511,23 @@ class FSSourceOutputSpec(TraitedSpec): loc='mri') curv = OutputMultiPath(File(exists=True), desc='Maps of surface curvature', loc='surf') + avg_curv = OutputMultiPath( + File(exists=True), desc='Average atlas curvature, sampled to subject', + loc='surf') inflated = OutputMultiPath( File(exists=True), desc='Inflated surface meshes', loc='surf') pial = OutputMultiPath( File(exists=True), desc='Gray matter/pia mater surface meshes', loc='surf') + area_pial = OutputMultiPath( + File(exists=True), + desc='Mean area of triangles each vertex on the pial surface is ' + 'associated with', + loc='surf', altkey='area.pial') + curv_pial = OutputMultiPath( + File(exists=True), desc='Curvature of pial surface', + loc='surf', altkey='curv.pial') smoothwm = OutputMultiPath(File(exists=True), loc='surf', desc='Smoothed original surface meshes') sphere = OutputMultiPath( @@ -1531,6 +1542,10 @@ class FSSourceOutputSpec(TraitedSpec): white = OutputMultiPath( File(exists=True), desc='White/gray matter surface meshes', loc='surf') + jacobian_white = OutputMultiPath( + File(exists=True), + desc='Distortion required to register to spherical atlas', + loc='surf') label = OutputMultiPath( File(exists=True), desc='Volume and surface label files', loc='label', altkey='*label') @@ -1590,12 +1605,17 @@ def _get_files(self, path, key, dirval, altkey=None): elif dirval == 'stats': globsuffix = '.stats' globprefix = '' - if key == 'ribbon' or dirval in ['surf', 'label', 'stats']: + if dirval in ('surf', 'label', 'stats'): + if self.inputs.hemi != 'both': + globprefix = self.inputs.hemi + '.' + else: + globprefix = '?h.' + elif key == 'ribbon': if self.inputs.hemi != 'both': globprefix = self.inputs.hemi + '.' else: globprefix = '*' - if key == 'aseg_stats' or key == 'wmparc_stats': + elif key in ('aseg_stats', 'wmparc_stats'): globprefix = '' keydir = os.path.join(path, dirval) if altkey: diff --git a/nipype/interfaces/tests/test_auto_FreeSurferSource.py b/nipype/interfaces/tests/test_auto_FreeSurferSource.py index f3bcf631a3..246169b457 100644 --- a/nipype/interfaces/tests/test_auto_FreeSurferSource.py +++ b/nipype/interfaces/tests/test_auto_FreeSurferSource.py @@ -39,17 +39,25 @@ def test_FreeSurferSource_outputs(): aparc_stats=dict(altkey='aparc', loc='stats', ), + area_pial=dict(altkey='area.pial', + loc='surf', + ), aseg=dict(loc='mri', ), aseg_stats=dict(altkey='aseg', loc='stats', ), + avg_curv=dict(loc='surf', + ), brain=dict(loc='mri', ), brainmask=dict(loc='mri', ), curv=dict(loc='surf', ), + curv_pial=dict(altkey='curv.pial', + loc='surf', + ), curv_stats=dict(altkey='curv', loc='stats', ), @@ -60,6 +68,8 @@ def test_FreeSurferSource_outputs(): ), inflated=dict(loc='surf', ), + jacobian_white=dict(loc='surf', + ), label=dict(altkey='*label', loc='label', ), From e48be75a295dbe4d7b16675c381f74c8e209ba34 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Mon, 20 Mar 2017 19:52:07 -0400 Subject: [PATCH 2/2] PEP8 --- nipype/interfaces/io.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 38a00dcf78..47fe983383 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -1478,7 +1478,7 @@ class FSSourceInputSpec(BaseInterfaceInputSpec): subjects_dir = Directory(mandatory=True, desc='Freesurfer subjects directory.') subject_id = Str(mandatory=True, - desc='Subject name for whom to retrieve data') + desc='Subject name for whom to retrieve data') hemi = traits.Enum('both', 'lh', 'rh', usedefault=True, desc='Selects hemisphere specific outputs') @@ -1487,8 +1487,8 @@ class FSSourceOutputSpec(TraitedSpec): T1 = File( exists=True, desc='Intensity normalized whole-head volume', loc='mri') aseg = File( - exists=True, desc='Volumetric map of regions from automatic segmentation', - loc='mri') + exists=True, loc='mri', + desc='Volumetric map of regions from automatic segmentation') brain = File( exists=True, desc='Intensity normalized brain-only volume', loc='mri') brainmask = File( @@ -1507,8 +1507,8 @@ class FSSourceOutputSpec(TraitedSpec): loc='mri', altkey='*ribbon') wm = File(exists=True, desc='Segmented white-matter volume', loc='mri') wmparc = File( - exists=True, desc='Aparc parcellation projected into subcortical white matter', - loc='mri') + exists=True, loc='mri', + desc='Aparc parcellation projected into subcortical white matter') curv = OutputMultiPath(File(exists=True), desc='Maps of surface curvature', loc='surf') avg_curv = OutputMultiPath(