knn_shrink | R Documentation |
Replace each voxel by the mean of its k nearest neighbors in its local spatial neighborhood
knn_shrink(bvec, mask, k = 5, connectivity = 27)
bvec |
bvec a |
mask |
a mask defining the voxels to include in the clustering result. |
k |
the number of nearest neighbors to average over. |
connectivity |
the number of spatial neighbors to include in the search space around each voxel. |
mask <- NeuroVol(array(1, c(20,20,20)), NeuroSpace(c(20,20,20)))
bvec <- replicate(10, NeuroVol(array(runif(20*20*20), c(20,20,20)),
NeuroSpace(c(20,20,20))), simplify=FALSE)
bvec <- do.call(concat, bvec)
sbvec <- knn_shrink(bvec, mask,k=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.