@@ -181,15 +181,17 @@ class DWIBiasCorrectInputSpec(MRTrix3BaseInputSpec):
181
181
)
182
182
in_mask = File (argstr = "-mask %s" , desc = "input mask image for bias field estimation" )
183
183
use_ants = traits .Bool (
184
- argstr = "- ants" ,
184
+ argstr = "ants" ,
185
185
mandatory = True ,
186
186
desc = "use ANTS N4 to estimate the inhomogeneity field" ,
187
+ position = 0 ,
187
188
xor = ["use_fsl" ],
188
189
)
189
190
use_fsl = traits .Bool (
190
- argstr = "- fsl" ,
191
+ argstr = "fsl" ,
191
192
mandatory = True ,
192
193
desc = "use FSL FAST to estimate the inhomogeneity field" ,
194
+ position = 0 ,
193
195
xor = ["use_ants" ],
194
196
)
195
197
bias = File (argstr = "-bias %s" , desc = "bias field" )
@@ -224,14 +226,20 @@ class DWIBiasCorrect(MRTrix3Base):
224
226
>>> bias_correct.inputs.in_file = 'dwi.mif'
225
227
>>> bias_correct.inputs.use_ants = True
226
228
>>> bias_correct.cmdline
227
- 'dwibiascorrect - ants dwi.mif dwi_biascorr.mif'
229
+ 'dwibiascorrect ants dwi.mif dwi_biascorr.mif'
228
230
>>> bias_correct.run() # doctest: +SKIP
229
231
"""
230
232
231
233
_cmd = "dwibiascorrect"
232
234
input_spec = DWIBiasCorrectInputSpec
233
235
output_spec = DWIBiasCorrectOutputSpec
234
-
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
+ return super ()._format_arg (name , trait_spec , value )
235
243
236
244
class ResponseSDInputSpec (MRTrix3BaseInputSpec ):
237
245
algorithm = traits .Enum (
0 commit comments