Skip to content

Fix: fsl.WarpUtils #906

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 3 commits into from
Sep 1, 2014
Merged
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
17 changes: 9 additions & 8 deletions nipype/interfaces/fsl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ class WarpUtilsInputSpec(FSLCommandInputSpec):
'would typically be the file that was specified '
'with the --in argument when running fnirt.'))

out_format = traits.Either('field', 'spline', argstr='--outformat=%s',
out_format = traits.Either('spline', 'field', argstr='--outformat=%s',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oesteban - shouldn't this be an Enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, fixing...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@satra is there any way to avoid opening a new branch and a new PR to apply such minor patches? (sorry for my ignorance about git and github). I've done that to fix it, but I feel it potentially annoying, isn't it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately no. and a change like this also requires make specs to run.

desc=('Specifies the output format. If set to field (default) '
'the output will be a (4D) field-file. If set to spline '
'the format will be a (4D) file of spline coefficients.'))
Expand Down Expand Up @@ -1557,10 +1557,8 @@ class WarpUtilsInputSpec(FSLCommandInputSpec):
'stored separately from the displacements).'))

class WarpUtilsOutputSpec(TraitedSpec):
out_file = File(exists=True,
desc=('Name of output file, containing the warp as field or coefficients.'))
out_jacobian = File(exists=True,
desc=('Name of output file, containing the map of the determinant of '
out_file = File(desc=('Name of output file, containing the warp as field or coefficients.'))
out_jacobian = File(desc=('Name of output file, containing the map of the determinant of '
'the Jacobian'))


Expand Down Expand Up @@ -1603,9 +1601,12 @@ def _parse_inputs(self, skip=None):

if self.inputs.write_jacobian:
if not isdefined(self.inputs.out_jacobian):
trait_spec = self.inputs.trait('out_jacobian')
trait_spec.name_source = ['in_file']
trait_spec.name_template = '%s_jac'
jac_spec = self.inputs.trait('out_jacobian')
jac_spec.name_source = ['in_file']
jac_spec.name_template = '%s_jac'
jac_spec.output_name = 'out_jacobian'
else:
skip+=['out_jacobian']

skip+=['write_jacobian']
return super(WarpUtils, self)._parse_inputs(skip=skip)
Expand Down