Description Usage Arguments Value Author(s) Examples
View source: R/multiscaleSVDxpts.R
Compute a smoothing matrix based on an input matrix of point coordinates
1 | 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
1 2 3 4 5 6 7 8 9 10 | ## 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.