knnSmoothImage.Rd
Compute a smoothing matrix based on an input matrix of point coordinates as well as neighborhood intensity patterns. this performs a form of edge preserving smoothing.
knnSmoothImage(
img,
mask,
radius,
intensityWeight = 0.1,
spatialSigma = 20,
iterations = 1,
returnMatrix = FALSE
)
input image to smooth
input image mask
number of neighbors, higher causes more smoothing
weight for intensity component, value 1 will weight local voxel intensity roughly equally to spatial component
for gaussian defining spatial distances
number of iterations over which to apply smoothing kernel
boolean, will return smoothing matrix instead of image.
antsImage is output
if (FALSE) { # \dontrun{
img <- antsImageRead(getANTsRData("r16"))
mask <- getMask(img)
simg <- knnSmoothImage(
img = img, mask = mask, radius = 2, intensityWeight = 1,
spatialSigma = 1.5, iterations = 1
)
} # }