@@ -317,6 +317,18 @@ class N4BiasFieldCorrectionInputSpec(ANTSCommandInputSpec):
317
317
The result is that the range can "drift" from the original at each iteration.
318
318
This option rescales to the [min,max] range of the original image intensities
319
319
within the user-specified mask.""" )
320
+ histogram_fwhm = traits .Float (
321
+ 0.15 , usedefault = True ,
322
+ argstr = '--histogram-sharpening %s' ,
323
+ desc = 'Histogram sharpening parameter: FWHM' )
324
+ histogram_wiener_noise = traits .Float (
325
+ 0.01 , usedefault = True ,
326
+ requires = ['histogram_fwhm' ],
327
+ desc = 'Histogram sharpening parameter: Wiener noise' )
328
+ histogram_bins = traits .Int (
329
+ 200 , usedefault = True ,
330
+ requires = ['histogram_fwhm' , 'histogram_wiener_noise' ],
331
+ desc = 'Histogram sharpening parameter: number of bins' )
320
332
321
333
322
334
class N4BiasFieldCorrectionOutputSpec (TraitedSpec ):
@@ -414,6 +426,16 @@ def _format_arg(self, name, trait_spec, value):
414
426
[str (elt ) for elt in value ])
415
427
return trait_spec .argstr % newval
416
428
429
+ if name == 'histogram_fwhm' :
430
+ newval = '[ %f' % value
431
+ if isdefined (self .inputs .histogram_wiener_noise ):
432
+ newval = '%s, %f' % (
433
+ newval , self .inputs .histogram_wiener_noise )
434
+ if isdefined (self .inputs .histogram_bins ):
435
+ newval = '%s, %d' % (newval , self .inputs .histogram_bins )
436
+ newval = '%s ]' % newval
437
+ return trait_spec .argstr % newval
438
+
417
439
return super (N4BiasFieldCorrection , self )._format_arg (
418
440
name , trait_spec , value )
419
441
0 commit comments