Skip to content

Commit a8a4c7f

Browse files
authored
Edited file according to Chris's requests
1 parent 613d647 commit a8a4c7f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

nipype/interfaces/mrtrix3/preprocess.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,20 @@ class DWIBiasCorrect(MRTrix3Base):
226226
>>> bias_correct.inputs.in_file = 'dwi.mif'
227227
>>> bias_correct.inputs.use_ants = True
228228
>>> bias_correct.cmdline
229-
'dwibiascorrect -ants dwi.mif dwi_biascorr.mif'
229+
'dwibiascorrect ants dwi.mif dwi_biascorr.mif'
230230
>>> bias_correct.run() # doctest: +SKIP
231231
"""
232232

233233
_cmd = "dwibiascorrect"
234234
input_spec = DWIBiasCorrectInputSpec
235235
output_spec = DWIBiasCorrectOutputSpec
236-
236+
def _format_arg(self, name, trait_spec, value):
237+
if name in ("use_ants", "use_fsl"):
238+
ver = self.version
239+
# Changed in version 3.0, after release candidates
240+
if ver is not None and (ver[0] < "3" or ver.startswith("3.0_RC")):
241+
return f"-{trait_spec.argstr}"
242+
super()._format_arg(name, trait_spec, value)
237243

238244
class ResponseSDInputSpec(MRTrix3BaseInputSpec):
239245
algorithm = traits.Enum(

0 commit comments

Comments
 (0)