Skip to content

[ENH] Enable cnr_maps and residuals outputs for FSL eddy #2750

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 4 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 16 additions & 0 deletions nipype/interfaces/fsl/epi.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,8 @@ class EddyInputSpec(FSLCommandInputSpec):
"the field specified by --field and first volume "
"in file --imain")
use_cuda = traits.Bool(False, desc="Run eddy using cuda gpu")
cnr_maps = traits.Bool(False, desc='Output CNR-Maps', argstr='--cnr_maps')
residuals = traits.Bool(False, desc='Output Residuals', argstr='--residuals')
Copy link
Member

Choose a reason for hiding this comment

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

Do we know if these were introduced in a particular version? If so, we should set the min_ver flag.

Copy link
Author

Choose a reason for hiding this comment

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

I added 5.0.10 as the minimum version since this is the one i am using and that is working (despite the parameters not showing in the usage page). I messaged eddy's developers and they said that these parameters are actually planned to be released with eddy 6.0.1, they did not yet answer why the parameters are already usable in lower versions.



class EddyOutputSpec(TraitedSpec):
Expand All @@ -685,6 +687,10 @@ class EddyOutputSpec(TraitedSpec):
exists=True,
desc=('Text-file with a plain language report on what '
'outlier slices eddy has found'))
out_cnr_maps = File(
exists=True, desc='path/name of file with the cnr_maps')
out_residuals = File(
exists=True, desc='path/name of file with the residuals')


class Eddy(FSLCommand):
Expand Down Expand Up @@ -787,6 +793,16 @@ def _list_outputs(self):
self.inputs.out_base)
out_outlier_report = os.path.abspath(
'%s.eddy_outlier_report' % self.inputs.out_base)
if isdefined(self.inputs.cnr_maps) and self.inputs.cnr_maps:
out_cnr_maps = os.path.abspath(
'%s.eddy_cnr_maps.nii.gz' % self.inputs.out_base)
if os.path.exists(out_cnr_maps):
outputs['out_cnr_maps'] = out_cnr_maps
if isdefined(self.inputs.residuals) and self.inputs.residuals:
out_residuals = os.path.abspath(
'%s.eddy_residuals.nii.gz' % self.inputs.out_base)
if os.path.exists(out_residuals):
outputs['out_residuals'] = out_residuals

if os.path.exists(out_rotated_bvecs):
outputs['out_rotated_bvecs'] = out_rotated_bvecs
Expand Down
4 changes: 4 additions & 0 deletions nipype/interfaces/fsl/tests/test_auto_Eddy.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def test_Eddy_inputs():
session=dict(argstr='--session=%s', ),
slm=dict(argstr='--slm=%s', ),
use_cuda=dict(),
cnr_maps=dict(argstr='--cnr_maps', ),
residuals=dict(argstr='--residuals', ),
)
inputs = Eddy.input_spec()

Expand All @@ -89,6 +91,8 @@ def test_Eddy_outputs():
out_restricted_movement_rms=dict(),
out_rotated_bvecs=dict(),
out_shell_alignment_parameters=dict(),
out_cnr_maps=dict(),
out_residuals=dict(),
)
outputs = Eddy.output_spec()

Expand Down