View source: R/commute_cluster.R
commute_cluster | R Documentation |
The commute_cluster function performs spatially constrained clustering on a NeuroVec
instance
using the commute time distance and K-means clustering.
commute_cluster(
bvec,
mask,
K = 100,
ncomp = ceiling(sqrt(K * 2)),
alpha = 0.5,
sigma1 = 0.73,
sigma2 = 5,
connectivity = 27,
weight_mode = c("binary", "heat")
)
bvec |
A |
mask |
A |
K |
The number of clusters to find. Default is 100. |
ncomp |
The number of components to use for the commute time embedding. Default is the ceiling of |
alpha |
A numeric value controlling the balance between spatial and feature similarity. Default is 0.5. |
sigma1 |
A numeric value controlling the spatial weighting function. Default is 0.73. |
sigma2 |
A numeric value controlling the feature weighting function. Default is 5. |
connectivity |
An integer representing the number of nearest neighbors to consider when constructing the similarity graph. Default is 27. |
weight_mode |
A character string indicating the type of weight function for the similarity graph. Options are "binary" and "heat". Default is "heat". |
A list
of class commute_time_cluster_result
with the following elements:
An instance of type ClusteredNeuroVol.
A vector of cluster indices equal to the number of voxels in the mask.
A matrix of cluster centers with each column representing the feature vector for a cluster.
A matrix of spatial coordinates with each row corresponding to a cluster.
snic
, turbo_cluster
mask <- NeuroVol(array(1, c(20,20,20)), NeuroSpace(c(20,20,20)))
vec <- replicate(10, NeuroVol(array(runif(202020), c(20,20,20)),
NeuroSpace(c(20,20,20))), simplify=FALSE)
vec <- do.call(concat, vec)
commute_res <- commute_cluster(vec, mask, K=100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.