Code: file:///build/buildd/nipype-0.6.0/nipype/interfaces/ants/preprocess.py#L36
Wraps command N4BiasFieldCorrection
N4 is a variant of the popular N3 (nonparameteric nonuniform normalization) retrospective bias correction algorithm. Based on the assumption that the corruption of the low frequency bias field can be modeled as a convolution of the intensity histogram by a Gaussian, the basic algorithmic protocol is to iterate between deconvolving the intensity histogram by a Gaussian, remapping the intensities, and then spatially smoothing this result by a B-spline modeling of the bias field itself. The modifications from and improvements obtained over the original N3 algorithm are described in the following paper: N. Tustison et al., N4ITK: Improved N3 Bias Correction, IEEE Transactions on Medical Imaging, 29(6):1310-1320, June 2010.
>>> from nipype.interfaces.ants import N4BiasFieldCorrection
>>> n4 = N4BiasFieldCorrection()
>>> n4.inputs.dimension = 3
>>> n4.inputs.input_image = 'structural.nii'
>>> n4.inputs.bspline_fitting_distance = 300
>>> n4.inputs.shrink_factor = 3
>>> n4.inputs.n_iterations = [50,50,30,20]
>>> n4.inputs.convergence_threshold = 1e-6
>>> n4.cmdline
'N4BiasFieldCorrection --convergence [ 50x50x30x20 ,1e-06] --bsline-fitting [300] --image-dimension 3 --input-image structural.nii --output structural_corrected.nii --shrink-factor 3'
Inputs:
[Mandatory]
input_image: (a file name)
image to apply transformation to (generally a coregistered functional)
[Optional]
args: (a string)
Additional parameters to the command
bspline_fitting_distance: (a float)
convergence_threshold: (a float)
requires: n_iterations
dimension: (3 or 2, nipype default value: 3)
image dimension (2 or 3)
environ: (a dictionary with keys which are a value of type 'str' and with values which
are a value of type 'str', nipype default value: {})
Environment variables
ignore_exception: (a boolean, nipype default value: False)
Print an error message instead of throwing an exception in case the interface fails to
run
n_iterations: (a list of items which are an integer)
requires: convergence_threshold
num_threads: (an integer, nipype default value: 1)
Number of ITK threads to use
output_image: (a string)
output file name
shrink_factor: (an integer)
Outputs:
output_image: (an existing file name)
Warped image