Skip to content

Commit 35b58cd

Browse files
authored
Merge pull request #2750 from divetea/eddy
[ENH] Enable cnr_maps and residuals outputs for FSL eddy
2 parents 1eeabd3 + 66ea26f commit 35b58cd

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

nipype/interfaces/fsl/epi.py

+18
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,10 @@ class EddyInputSpec(FSLCommandInputSpec):
659659
"the field specified by --field and first volume "
660660
"in file --imain")
661661
use_cuda = traits.Bool(False, desc="Run eddy using cuda gpu")
662+
cnr_maps = traits.Bool(
663+
False, desc='Output CNR-Maps', argstr='--cnr_maps', min_ver='5.0.10')
664+
residuals = traits.Bool(
665+
False, desc='Output Residuals', argstr='--residuals', min_ver='5.0.10')
662666

663667

664668
class EddyOutputSpec(TraitedSpec):
@@ -685,6 +689,10 @@ class EddyOutputSpec(TraitedSpec):
685689
exists=True,
686690
desc=('Text-file with a plain language report on what '
687691
'outlier slices eddy has found'))
692+
out_cnr_maps = File(
693+
exists=True, desc='path/name of file with the cnr_maps')
694+
out_residuals = File(
695+
exists=True, desc='path/name of file with the residuals')
688696

689697

690698
class Eddy(FSLCommand):
@@ -787,6 +795,16 @@ def _list_outputs(self):
787795
self.inputs.out_base)
788796
out_outlier_report = os.path.abspath(
789797
'%s.eddy_outlier_report' % self.inputs.out_base)
798+
if isdefined(self.inputs.cnr_maps) and self.inputs.cnr_maps:
799+
out_cnr_maps = os.path.abspath(
800+
'%s.eddy_cnr_maps.nii.gz' % self.inputs.out_base)
801+
if os.path.exists(out_cnr_maps):
802+
outputs['out_cnr_maps'] = out_cnr_maps
803+
if isdefined(self.inputs.residuals) and self.inputs.residuals:
804+
out_residuals = os.path.abspath(
805+
'%s.eddy_residuals.nii.gz' % self.inputs.out_base)
806+
if os.path.exists(out_residuals):
807+
outputs['out_residuals'] = out_residuals
790808

791809
if os.path.exists(out_rotated_bvecs):
792810
outputs['out_rotated_bvecs'] = out_rotated_bvecs

nipype/interfaces/fsl/tests/test_auto_Eddy.py

+4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def test_Eddy_inputs():
7474
session=dict(argstr='--session=%s', ),
7575
slm=dict(argstr='--slm=%s', ),
7676
use_cuda=dict(),
77+
cnr_maps=dict(argstr='--cnr_maps', min_ver='5.0.10', ),
78+
residuals=dict(argstr='--residuals', min_ver='5.0.10', ),
7779
)
7880
inputs = Eddy.input_spec()
7981

@@ -89,6 +91,8 @@ def test_Eddy_outputs():
8991
out_restricted_movement_rms=dict(),
9092
out_rotated_bvecs=dict(),
9193
out_shell_alignment_parameters=dict(),
94+
out_cnr_maps=dict(),
95+
out_residuals=dict(),
9296
)
9397
outputs = Eddy.output_spec()
9498

0 commit comments

Comments
 (0)