knnSmoothingMatrix: k-nearest neighbors constrained smoothing

Description Usage Arguments Value Author(s) Examples

View source: R/multiscaleSVDxpts.R

Description

Compute a smoothing matrix based on an input matrix of point coordinates

Usage

1
knnSmoothingMatrix(x, k, sigma, segmentation, ...)

Arguments

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 sparseDistanceMatrix

Value

sparse matrix is output

Author(s)

Avants BB

Examples

 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)

neuroconductor-devel/ANTsR documentation built on April 1, 2021, 1:02 p.m.