Skip to content

Commit 87e8704

Browse files
committed
changes dwifslpreproc outputs' configuration and reset tests to match the new one
1 parent 9306be7 commit 87e8704

File tree

2 files changed

+21
-28
lines changed

2 files changed

+21
-28
lines changed

nipype/interfaces/mrtrix3/preprocess.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ class DWIBiasCorrectInputSpec(MRTrix3BaseInputSpec):
192192
mandatory=True,
193193
desc="input DWI image",
194194
)
195-
in_mask = File(argstr="-mask %s", desc="input mask image for bias field estimation")
195+
in_mask = File(
196+
argstr="-mask %s", desc="input mask image for bias field estimation"
197+
)
196198
use_ants = traits.Bool(
197199
argstr="ants",
198200
mandatory=True,
@@ -333,25 +335,16 @@ class DWIPreprocInputSpec(MRTrix3BaseInputSpec):
333335
argstr="-eddyqc_all %s",
334336
desc="Copy ALL outputs generated by eddy (including images), and the output of eddy_qc (if installed), into an output directory",
335337
)
336-
export_grad_mrtrix = traits.Bool(
337-
argstr="-export_grad_mrtrix",
338-
desc="export new gradient files in mrtrix format",
339-
)
340-
export_grad_fsl = traits.Bool(
341-
argstr="-export_grad_fsl", desc="export gradient files in FSL format"
342-
)
343338
out_grad_mrtrix = File(
344339
"grad.b",
345-
argstr="%s",
346-
requires=["export_grad_mrtrix"],
347-
desc="name of new gradient file",
340+
argstr="-export_grad_mrtrix %s",
341+
desc="export new gradient files in mrtrix format",
348342
)
349343
out_grad_fsl = traits.Tuple(
350344
File("grad.bvecs", desc="bvecs"),
351345
File("grad.bvals", desc="bvals"),
352-
argstr="%s, %s",
353-
requires=["export_grad_fsl"],
354-
desc="Output (bvecs, bvals) gradients FSL format",
346+
argstr="-export_grad_fsl %s, %s",
347+
desc="export gradient files in FSL format",
355348
)
356349

357350

@@ -409,7 +402,9 @@ def _list_outputs(self):
409402
outputs = self.output_spec().get()
410403
outputs["out_file"] = op.abspath(self.inputs.out_file)
411404
if self.inputs.export_grad_mrtrix:
412-
outputs["out_grad_mrtrix"] = op.abspath(self.inputs.out_grad_mrtrix)
405+
outputs["out_grad_mrtrix"] = op.abspath(
406+
self.inputs.out_grad_mrtrix
407+
)
413408
if self.inputs.export_grad_fsl:
414409
outputs["out_fsl_bvec"] = op.abspath(self.inputs.out_grad_fsl[0])
415410
outputs["out_fsl_bval"] = op.abspath(self.inputs.out_grad_fsl[1])
@@ -443,9 +438,15 @@ class ResponseSDInputSpec(MRTrix3BaseInputSpec):
443438
usedefault=True,
444439
desc="output WM response text file",
445440
)
446-
gm_file = File(argstr="%s", position=-2, desc="output GM response text file")
447-
csf_file = File(argstr="%s", position=-1, desc="output CSF response text file")
448-
in_mask = File(exists=True, argstr="-mask %s", desc="provide initial mask image")
441+
gm_file = File(
442+
argstr="%s", position=-2, desc="output GM response text file"
443+
)
444+
csf_file = File(
445+
argstr="%s", position=-1, desc="output CSF response text file"
446+
)
447+
in_mask = File(
448+
exists=True, argstr="-mask %s", desc="provide initial mask image"
449+
)
449450
max_sh = InputMultiObject(
450451
traits.Int,
451452
argstr="-lmax %s",

nipype/interfaces/mrtrix3/tests/test_auto_DWIPreproc.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ def test_DWIPreproc_inputs():
3434
nohash=True,
3535
usedefault=True,
3636
),
37-
export_grad_fsl=dict(
38-
argstr="-export_grad_fsl",
39-
),
40-
export_grad_mrtrix=dict(
41-
argstr="-export_grad_mrtrix",
42-
),
4337
grad_file=dict(
4438
argstr="-grad %s",
4539
extensions=None,
@@ -89,13 +83,11 @@ def test_DWIPreproc_inputs():
8983
usedefault=True,
9084
),
9185
out_grad_fsl=dict(
92-
argstr="%s, %s",
93-
requires=["export_grad_fsl"],
86+
argstr="-export_grad_fsl %s, %s",
9487
),
9588
out_grad_mrtrix=dict(
96-
argstr="%s",
89+
argstr="-export_grad_mrtrix %s",
9790
extensions=None,
98-
requires=["export_grad_mrtrix"],
9991
),
10092
pe_dir=dict(
10193
argstr="-pe_dir %s",

0 commit comments

Comments
 (0)