Skip to content
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
23 changes: 6 additions & 17 deletions nipype/interfaces/ants/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ class LaplacianThicknessInputSpec(ANTSCommandInputSpec):
desc='name of output file',
argstr='%s',
position=3,
genfile=True,
name_source=['input_wm'],
name_template='%s_thickness',
keep_extension=True,
hash_files=False)
smooth_param = traits.Float(argstr='smoothparam=%d', desc='', position=4)
prior_thickness = traits.Float(
Expand All @@ -228,6 +230,9 @@ class LaplacianThickness(ANTSCommand):
>>> cort_thick = LaplacianThickness()
>>> cort_thick.inputs.input_wm = 'white_matter.nii.gz'
>>> cort_thick.inputs.input_gm = 'gray_matter.nii.gz'
>>> cort_thick.cmdline
'LaplacianThickness white_matter.nii.gz gray_matter.nii.gz white_matter_thickness.nii.gz'

>>> cort_thick.inputs.output_image = 'output_thickness.nii.gz'
>>> cort_thick.cmdline
'LaplacianThickness white_matter.nii.gz gray_matter.nii.gz output_thickness.nii.gz'
Expand All @@ -238,22 +243,6 @@ class LaplacianThickness(ANTSCommand):
input_spec = LaplacianThicknessInputSpec
output_spec = LaplacianThicknessOutputSpec

def _gen_filename(self, name):
if name == 'output_image':
output = self.inputs.output_image
if not isdefined(output):
_, name, ext = split_filename(self.inputs.input_wm)
output = name + '_thickness' + ext
return output
return None

def _list_outputs(self):
outputs = self._outputs().get()
if not outputs.get('output_image', None) \
or not isdefined(outputs['output_image']):
outputs['output_image'] = self._gen_filename('output_image')
return outputs


class N4BiasFieldCorrectionInputSpec(ANTSCommandInputSpec):
dimension = traits.Enum(
Expand Down
4 changes: 3 additions & 1 deletion nipype/interfaces/ants/tests/test_auto_LaplacianThickness.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ def test_LaplacianThickness_inputs():
),
output_image=dict(
argstr='%s',
genfile=True,
hash_files=False,
keep_extension=True,
name_source=['input_wm'],
name_template='%s_thickness',
position=3,
),
prior_thickness=dict(
Expand Down