knnSmoothingMatrix.Rd
Compute a smoothing matrix based on an input matrix of point coordinates
knnSmoothingMatrix(x, k, sigma, segmentation, ...)
input matrix of point coordinates of dimensions n-spatial spatial dimensions by p points
number of neighbors, higher causes more smoothing
sigma for the gaussian function
optional boolean to restrict specific rows to have minimal respons
arguments passed to sparseDistanceMatrix
sparse matrix is output
if (FALSE) { # \dontrun{
mask <- getMask(antsImageRead(getANTsRData("r16")))
spatmat <- t(imageDomainToSpatialMatrix(mask, mask))
smoothingMatrix <- knnSmoothingMatrix(spatmat, k = 25, sigma = 3.0)
rvec <- rnorm(nrow(smoothingMatrix))
srvec <- smoothingMatrix %*% rvec
rvi <- makeImage(mask, rvec)
srv <- makeImage(mask, as.numeric(srvec))
} # }