Skip to content

Split over-eager globs in FreeSurferSource #1894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
Expand All @@ -145,6 +153,8 @@ def test_ReconAll_outputs():
),
inflated=dict(loc='surf',
),
jacobian_white=dict(loc='surf',
),
label=dict(altkey='*label',
loc='label',
),
Expand Down
34 changes: 27 additions & 7 deletions nipype/interfaces/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand All @@ -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(
Expand All @@ -1507,16 +1507,27 @@ 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(
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(
Expand All @@ -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')
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions nipype/interfaces/tests/test_auto_FreeSurferSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
Expand All @@ -60,6 +68,8 @@ def test_FreeSurferSource_outputs():
),
inflated=dict(loc='surf',
),
jacobian_white=dict(loc='surf',
),
label=dict(altkey='*label',
loc='label',
),
Expand Down