View source: R/multiscaleSVDxpts.R
knnSmoothingMatrix | R Documentation |
Compute a smoothing matrix based on an input matrix of point coordinates
knnSmoothingMatrix(x, k, sigma, segmentation, ...)
x |
input matrix of point coordinates of dimensions n-spatial spatial dimensions by p points |
k |
number of neighbors, higher causes more smoothing |
sigma |
sigma for the gaussian function |
segmentation |
optional boolean to restrict specific rows to have minimal respons |
... |
arguments passed to |
sparse matrix is output
Avants BB
## Not run:
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))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.