Skip to content

Commit c6d24b8

Browse files
authored
Merge pull request nipy#1894 from effigies/fssource_refine
Split over-eager globs in FreeSurferSource
2 parents 943f040 + e48be75 commit c6d24b8

File tree

3 files changed

+47
-7
lines changed

3 files changed

+47
-7
lines changed

nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,25 @@ def test_ReconAll_outputs():
124124
aparc_stats=dict(altkey='aparc',
125125
loc='stats',
126126
),
127+
area_pial=dict(altkey='area.pial',
128+
loc='surf',
129+
),
127130
aseg=dict(loc='mri',
128131
),
129132
aseg_stats=dict(altkey='aseg',
130133
loc='stats',
131134
),
135+
avg_curv=dict(loc='surf',
136+
),
132137
brain=dict(loc='mri',
133138
),
134139
brainmask=dict(loc='mri',
135140
),
136141
curv=dict(loc='surf',
137142
),
143+
curv_pial=dict(altkey='curv.pial',
144+
loc='surf',
145+
),
138146
curv_stats=dict(altkey='curv',
139147
loc='stats',
140148
),
@@ -145,6 +153,8 @@ def test_ReconAll_outputs():
145153
),
146154
inflated=dict(loc='surf',
147155
),
156+
jacobian_white=dict(loc='surf',
157+
),
148158
label=dict(altkey='*label',
149159
loc='label',
150160
),

nipype/interfaces/io.py

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ class FSSourceInputSpec(BaseInterfaceInputSpec):
14781478
subjects_dir = Directory(mandatory=True,
14791479
desc='Freesurfer subjects directory.')
14801480
subject_id = Str(mandatory=True,
1481-
desc='Subject name for whom to retrieve data')
1481+
desc='Subject name for whom to retrieve data')
14821482
hemi = traits.Enum('both', 'lh', 'rh', usedefault=True,
14831483
desc='Selects hemisphere specific outputs')
14841484

@@ -1487,8 +1487,8 @@ class FSSourceOutputSpec(TraitedSpec):
14871487
T1 = File(
14881488
exists=True, desc='Intensity normalized whole-head volume', loc='mri')
14891489
aseg = File(
1490-
exists=True, desc='Volumetric map of regions from automatic segmentation',
1491-
loc='mri')
1490+
exists=True, loc='mri',
1491+
desc='Volumetric map of regions from automatic segmentation')
14921492
brain = File(
14931493
exists=True, desc='Intensity normalized brain-only volume', loc='mri')
14941494
brainmask = File(
@@ -1507,16 +1507,27 @@ class FSSourceOutputSpec(TraitedSpec):
15071507
loc='mri', altkey='*ribbon')
15081508
wm = File(exists=True, desc='Segmented white-matter volume', loc='mri')
15091509
wmparc = File(
1510-
exists=True, desc='Aparc parcellation projected into subcortical white matter',
1511-
loc='mri')
1510+
exists=True, loc='mri',
1511+
desc='Aparc parcellation projected into subcortical white matter')
15121512
curv = OutputMultiPath(File(exists=True), desc='Maps of surface curvature',
15131513
loc='surf')
1514+
avg_curv = OutputMultiPath(
1515+
File(exists=True), desc='Average atlas curvature, sampled to subject',
1516+
loc='surf')
15141517
inflated = OutputMultiPath(
15151518
File(exists=True), desc='Inflated surface meshes',
15161519
loc='surf')
15171520
pial = OutputMultiPath(
15181521
File(exists=True), desc='Gray matter/pia mater surface meshes',
15191522
loc='surf')
1523+
area_pial = OutputMultiPath(
1524+
File(exists=True),
1525+
desc='Mean area of triangles each vertex on the pial surface is '
1526+
'associated with',
1527+
loc='surf', altkey='area.pial')
1528+
curv_pial = OutputMultiPath(
1529+
File(exists=True), desc='Curvature of pial surface',
1530+
loc='surf', altkey='curv.pial')
15201531
smoothwm = OutputMultiPath(File(exists=True), loc='surf',
15211532
desc='Smoothed original surface meshes')
15221533
sphere = OutputMultiPath(
@@ -1531,6 +1542,10 @@ class FSSourceOutputSpec(TraitedSpec):
15311542
white = OutputMultiPath(
15321543
File(exists=True), desc='White/gray matter surface meshes',
15331544
loc='surf')
1545+
jacobian_white = OutputMultiPath(
1546+
File(exists=True),
1547+
desc='Distortion required to register to spherical atlas',
1548+
loc='surf')
15341549
label = OutputMultiPath(
15351550
File(exists=True), desc='Volume and surface label files',
15361551
loc='label', altkey='*label')
@@ -1590,12 +1605,17 @@ def _get_files(self, path, key, dirval, altkey=None):
15901605
elif dirval == 'stats':
15911606
globsuffix = '.stats'
15921607
globprefix = ''
1593-
if key == 'ribbon' or dirval in ['surf', 'label', 'stats']:
1608+
if dirval in ('surf', 'label', 'stats'):
1609+
if self.inputs.hemi != 'both':
1610+
globprefix = self.inputs.hemi + '.'
1611+
else:
1612+
globprefix = '?h.'
1613+
elif key == 'ribbon':
15941614
if self.inputs.hemi != 'both':
15951615
globprefix = self.inputs.hemi + '.'
15961616
else:
15971617
globprefix = '*'
1598-
if key == 'aseg_stats' or key == 'wmparc_stats':
1618+
elif key in ('aseg_stats', 'wmparc_stats'):
15991619
globprefix = ''
16001620
keydir = os.path.join(path, dirval)
16011621
if altkey:

nipype/interfaces/tests/test_auto_FreeSurferSource.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,25 @@ def test_FreeSurferSource_outputs():
3939
aparc_stats=dict(altkey='aparc',
4040
loc='stats',
4141
),
42+
area_pial=dict(altkey='area.pial',
43+
loc='surf',
44+
),
4245
aseg=dict(loc='mri',
4346
),
4447
aseg_stats=dict(altkey='aseg',
4548
loc='stats',
4649
),
50+
avg_curv=dict(loc='surf',
51+
),
4752
brain=dict(loc='mri',
4853
),
4954
brainmask=dict(loc='mri',
5055
),
5156
curv=dict(loc='surf',
5257
),
58+
curv_pial=dict(altkey='curv.pial',
59+
loc='surf',
60+
),
5361
curv_stats=dict(altkey='curv',
5462
loc='stats',
5563
),
@@ -60,6 +68,8 @@ def test_FreeSurferSource_outputs():
6068
),
6169
inflated=dict(loc='surf',
6270
),
71+
jacobian_white=dict(loc='surf',
72+
),
6373
label=dict(altkey='*label',
6474
loc='label',
6575
),

0 commit comments

Comments
 (0)