diff --git a/.zenodo.json b/.zenodo.json index cb9ffacc3c..a8ae4c70ee 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -697,6 +697,10 @@ "affiliation": "Sagol School of Neuroscience, Tel Aviv University", "name": "Baratz, Zvi" }, + { + "affiliation": "Sagol School of Neuroscience, Tel Aviv University", + "name": "Ben-Zvi, Gal" + }, { "name": "Matsubara, K" }, diff --git a/nipype/interfaces/mrtrix3/preprocess.py b/nipype/interfaces/mrtrix3/preprocess.py index 9384ef43c7..aa3347c7f9 100644 --- a/nipype/interfaces/mrtrix3/preprocess.py +++ b/nipype/interfaces/mrtrix3/preprocess.py @@ -181,15 +181,17 @@ class DWIBiasCorrectInputSpec(MRTrix3BaseInputSpec): ) in_mask = File(argstr="-mask %s", desc="input mask image for bias field estimation") use_ants = traits.Bool( - argstr="-ants", + argstr="ants", mandatory=True, desc="use ANTS N4 to estimate the inhomogeneity field", + position=0, xor=["use_fsl"], ) use_fsl = traits.Bool( - argstr="-fsl", + argstr="fsl", mandatory=True, desc="use FSL FAST to estimate the inhomogeneity field", + position=0, xor=["use_ants"], ) bias = File(argstr="-bias %s", desc="bias field") @@ -224,14 +226,20 @@ class DWIBiasCorrect(MRTrix3Base): >>> bias_correct.inputs.in_file = 'dwi.mif' >>> bias_correct.inputs.use_ants = True >>> bias_correct.cmdline - 'dwibiascorrect -ants dwi.mif dwi_biascorr.mif' + 'dwibiascorrect ants dwi.mif dwi_biascorr.mif' >>> bias_correct.run() # doctest: +SKIP """ _cmd = "dwibiascorrect" input_spec = DWIBiasCorrectInputSpec output_spec = DWIBiasCorrectOutputSpec - + def _format_arg(self, name, trait_spec, value): + if name in ("use_ants", "use_fsl"): + ver = self.version + # Changed in version 3.0, after release candidates + if ver is not None and (ver[0] < "3" or ver.startswith("3.0_RC")): + return f"-{trait_spec.argstr}" + return super()._format_arg(name, trait_spec, value) class ResponseSDInputSpec(MRTrix3BaseInputSpec): algorithm = traits.Enum( diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_DWIBiasCorrect.py b/nipype/interfaces/mrtrix3/tests/test_auto_DWIBiasCorrect.py index f67dd54667..0028748ab9 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_DWIBiasCorrect.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_DWIBiasCorrect.py @@ -58,13 +58,15 @@ def test_DWIBiasCorrect_inputs(): position=-1, ), use_ants=dict( - argstr="-ants", + argstr="ants", mandatory=True, + position=0, xor=["use_fsl"], ), use_fsl=dict( - argstr="-fsl", + argstr="fsl", mandatory=True, + position=0, xor=["use_ants"], ), )