Skip to content

Commit f41b498

Browse files
committed
Merge pull request #462 from moloney/bet-surface-output
ENH: Provide access to all relevant BET outputs when "surfaces" option u...
2 parents d0aebbb + d18c576 commit f41b498

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

nipype/interfaces/fsl/preprocess.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,28 @@ class BETInputSpec(FSLCommandInputSpec):
8989

9090

9191
class BETOutputSpec(TraitedSpec):
92-
out_file = File(desc="path/name of skullstripped file")
92+
out_file = File(
93+
desc="path/name of skullstripped file (if generated)")
9394
mask_file = File(
9495
desc="path/name of binary brain mask (if generated)")
9596
outline_file = File(
9697
desc="path/name of outline file (if generated)")
9798
meshfile = File(
9899
desc="path/name of vtk mesh file (if generated)")
100+
inskull_mask_file = File(
101+
desc="path/name of inskull mask (if generated)")
102+
inskull_mesh_file = File(
103+
desc="path/name of inskull mesh outline (if generated)")
104+
outskull_mask_file = File(
105+
desc="path/name of outskull mask (if generated)")
106+
outskull_mesh_file = File(
107+
desc="path/name of outskull mesh outline (if generated)")
108+
outskin_mask_file = File(
109+
desc="path/name of outskin mask (if generated)")
110+
outskin_mesh_file = File(
111+
desc="path/name of outskin mesh outline (if generated)")
112+
skull_mask_file = File(
113+
desc="path/name of skull mask (if generated)")
99114

100115

101116
class BET(FSLCommand):
@@ -138,7 +153,8 @@ def _gen_outfilename(self):
138153
def _list_outputs(self):
139154
outputs = self.output_spec().get()
140155
outputs['out_file'] = self._gen_outfilename()
141-
if isdefined(self.inputs.mesh) and self.inputs.mesh:
156+
if ((isdefined(self.inputs.mesh) and self.inputs.mesh) or
157+
(isdefined(self.inputs.surfaces) and self.inputs.surfaces)):
142158
outputs['meshfile'] = self._gen_fname(outputs['out_file'],
143159
suffix='_mesh.vtk',
144160
change_ext=False)
@@ -150,6 +166,21 @@ def _list_outputs(self):
150166
if isdefined(self.inputs.outline) and self.inputs.outline:
151167
outputs['outline_file'] = self._gen_fname(outputs['out_file'],
152168
suffix='_overlay')
169+
if isdefined(self.inputs.surfaces) and self.inputs.surfaces:
170+
outputs['inskull_mask_file'] = self._gen_fname(outputs['out_file'],
171+
suffix='_inskull_mask')
172+
outputs['inskull_mesh_file'] = self._gen_fname(outputs['out_file'],
173+
suffix='_inskull_mesh')
174+
outputs['outskull_mask_file'] = self._gen_fname(outputs['out_file'],
175+
suffix='_outskull_mask')
176+
outputs['outskull_mesh_file'] = self._gen_fname(outputs['out_file'],
177+
suffix='_outskull_mesh')
178+
outputs['outskin_mask_file'] = self._gen_fname(outputs['out_file'],
179+
suffix='_outskin_mask')
180+
outputs['outskin_mesh_file'] = self._gen_fname(outputs['out_file'],
181+
suffix='_outskin_mesh')
182+
outputs['skull_mask_file'] = self._gen_fname(outputs['out_file'],
183+
suffix='_skull_mask')
153184
if isdefined(self.inputs.no_output) and self.inputs.no_output:
154185
outputs['out_file'] = Undefined
155186
return outputs

nipype/interfaces/fsl/tests/test_preprocess.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def func():
7878
'center': ('-c 54 75 80', [54, 75, 80]),
7979
'threshold': ('-t', True),
8080
'mesh': ('-e', True),
81+
'surfaces': ('-A', True)
8182
#'verbose': ('-v', True),
8283
#'flags': ('--i-made-this-up', '--i-made-this-up'),
8384
}

0 commit comments

Comments
 (0)