This function calls smoothIamge
to smooth an image and either
saves the image or returns an object of class nifti
smooth_image( file, sigma = 10, mask = NULL, smooth_mask = TRUE, smoothed_mask = NULL, verbose = TRUE, retfile = FALSE, ... )
file | (character) image to be smoothed |
---|---|
sigma | (numeric) sigma (in mm) of Gaussian kernel for smoothing |
mask | (character) optional mask given for image |
smooth_mask | (logical) Smooth mask? If TRUE, the masked image will be divided by the smoothed mask. |
smoothed_mask | (character or antsImage) If specified and
|
verbose | (logical) print out command before running |
retfile | logical to indicate if an |
... | additional arguments passed to |
Object of class nifti
system.time({ library(oro.nifti) dims = c(50, 50, 50) x = array(rnorm(prod(dims)), dim = dims) img = nifti(x, dim= dims, datatype = convert.datatype()$FLOAT32, cal.min = min(x), cal.max = max(x), pixdim = rep(1, 4)) s.img = smooth_image(img, sigma = 3, sigmaInPhysicalCoordinates = TRUE) })#> user system elapsed #> 0.760 0.008 0.767