R/preprocessImage.R
preprocessBrainImage.Rd
Various preprocessing steps that have been previously described in various papers including the cortical thickness pipeline:
preprocessBrainImage( image, truncateIntensity = c(0.01, 0.99), brainExtractionModality = NULL, templateTransformType = NULL, template = "biobank", doBiasCorrection = TRUE, returnBiasField = FALSE, doDenoising = TRUE, intensityMatchingType = NULL, referenceImage = NULL, intensityNormalizationType = NULL, antsxnetCacheDirectory = NULL, verbose = TRUE )
image | input t1-weighted brain MRI |
---|---|
truncateIntensity | 2-element vector giving the low and high quantiles for intensity truncation. |
brainExtractionModality | string or NULL. Perform brain extraction using antsxnet tools. One of "t1", "t1v0", "t1nobrainer", "t1combined", "flair", "t2", "bold", "fa", "t1infant", "t2infant", or NULL. |
templateTransformType | see Details in help for |
template | an ANTs image (not skull-stripped). Other premade templates are "biobank" and "croppedMni152". |
doBiasCorrection | boolean for performing N4 bias field correction. |
returnBiasField | if TRUE, return bias field as an additional output without bias correcting the preprocessed image. |
doDenoising | boolean for performing non-local means denoising. |
intensityMatchingType | Either "regression" or "histogram". Only is
performed if |
referenceImage | reference image for intensity matching. |
intensityNormalizationType | Either rescale the intensities to 0,1
(i.e., "01") or zero-mean, unit variance (i.e., "0mean"). If |
antsxnetCacheDirectory | destination directory for storing the downloaded
template and model weights. Since these can be resused, if
|
verbose | print progress to the screen. |
preprocessed image and, optionally, the brain mask, bias field, and template transforms.
\url{https://www.ncbi.nlm.nih.gov/pubmed/24879923}
Tustison NJ, Avants BB
library( ANTsR ) library( ANTsRNet ) image <- antsImageRead( getANTsRData( "r16" ) ) preprocessedImage <- preprocessBrainImage( image, truncateIntensity = c( 0.01, 0.99 ), doBiasCorrection = TRUE, doDenoising = TRUE, intensityNormalizationType = "01", verbose = FALSE )