cmind_bias_correct(fname_crop, fname_bias[, ...]) N4 Bias Field correction
gauss_bias_corr(im1[, sigma]) Divide gaussian smoothed version of image to correct severe bias fields
cmind.pipeline.cmind_bias_correct.cmind_bias_correct(fname_crop, fname_bias, ANTS_bias_cmd=None, oname_root='T1W', weight_mask=None, N4_shrinkFactor=3, use_gaussian_prefilt=False, gaussian_sigma=6.0, generate_figures=True, ForceUpdate=False, verbose=False, logger=None)[source]

N4 Bias Field correction


fname_crop : str

input volume

fname_bias : str

filename to use for output volume. if a directory name is given instead, a file named ${oname_root}_Structural_N4.nii.gz will be created in that folder

ANTS_bias_cmd : str, optional

location of N4BiasFieldCorrection binary

oname_root : str, optional

output filename prefix

weight_mask : str, optional

filename of optional weighting mask for ANTs N4BiasFieldCorrection (see ANTs documentation)

N4_shrinkFactor : int, optional

resolution reduction factor during N4 computations (default=3)

use_gaussian_prefilt : bool, optional

if True, do an initial crude bias field correction based on division by a Gaussian smoothed version of the image

gaussian_sigma : float, optional

if use_gaussian_prefilt = True: sigma for the gaussian smoothing stage (in voxels)

generate_figures : bool, optional

if true, generate additional summary images

ForceUpdate : bool,optional

if True, rerun and overwrite any previously existing results

verbose : bool, optional

print additional output (to terminal and log)

logger : logging.Logger or str, optional

logging.Logger object (or string of a filename to log to)


fname_bias : str

Bias corrected head

bias_field_vol : str

The bias field

See also

FSL, removal.



T1-weighted head prior to bias correction


T1-weighted head after bias correction

cmind.pipeline.cmind_bias_correct.gauss_bias_corr(im1, sigma=6.0)[source]

Divide gaussian smoothed version of image to correct severe bias fields that are not dealt with properly by N4