@@ -229,17 +229,16 @@ class N4BiasFieldCorrectionInputSpec(ANTSCommandInputSpec):
229
229
desc = ('image to apply transformation to (generally a '
230
230
'coregistered functional)' ))
231
231
mask_image = File (argstr = '--mask-image %s' )
232
+ weight_image = File (argstr = '--weight-image %s' )
232
233
output_image = traits .Str (argstr = '--output %s' ,
233
234
desc = ('output file name' ), genfile = True ,
234
235
hash_files = False )
235
- bspline_fitting_distance = traits .Float (argstr = "--bsline-fitting [%g]" )
236
+ bspline_fitting_distance = traits .Float (argstr = "--bspline-fitting %s" )
237
+ bspline_order = traits .Int (requires = ['bspline_fitting_distance' ])
236
238
shrink_factor = traits .Int (argstr = "--shrink-factor %d" )
237
- n_iterations = traits .List (traits .Int (), argstr = "--convergence [ %s" ,
238
- sep = "x" , requires = ['convergence_threshold' ],
239
- position = 1 )
240
- convergence_threshold = traits .Float (argstr = ",%g]" ,
241
- requires = ['n_iterations' ],
242
- position = 2 )
239
+ n_iterations = traits .List (traits .Int (), argstr = "--convergence %s" ,
240
+ requires = ['convergence_threshold' ])
241
+ convergence_threshold = traits .Float (requires = ['n_iterations' ])
243
242
save_bias = traits .Bool (False , mandatory = True , usedefault = True ,
244
243
desc = ('True if the estimated bias should be saved'
245
244
' to file.' ), xor = ['bias_image' ])
@@ -315,7 +314,20 @@ def _format_arg(self, name, trait_spec, value):
315
314
(self .inputs .save_bias or isdefined (self .inputs .bias_image ))):
316
315
bias_image = self ._gen_filename ('bias_image' )
317
316
output = self ._gen_filename ('output_image' )
318
- newval = '[%s,%s]' % (output , bias_image )
317
+ newval = '[ %s, %s ]' % (output , bias_image )
318
+ return trait_spec .argstr % newval
319
+
320
+ if name == 'bspline_fitting_distance' :
321
+ if isdefined (self .inputs .bspline_order ):
322
+ newval = '[ %g, %d ]' % (value , self .inputs .bspline_order )
323
+ else :
324
+ newval = '[ %g ]' % value
325
+ return trait_spec .argstr % newval
326
+
327
+ if ((name == 'n_iterations' ) and
328
+ (isdefined (self .inputs .convergence_threshold ))):
329
+ newval = '[ %s, %g ]' % ('x' .join ([str (elt ) for elt in value ]),
330
+ self .inputs .convergence_threshold )
319
331
return trait_spec .argstr % newval
320
332
321
333
return super (N4BiasFieldCorrection ,
0 commit comments