snic: SNIC: Simple Non-Iterative Clustering

View source: R/snic.R

snicR Documentation

SNIC: Simple Non-Iterative Clustering

Description

The SNIC function performs a spatially constrained clustering on a NeuroVec instance using the Simple Non-Iterative Clustering (SNIC) algorithm.

Usage

snic(vec, mask, compactness = 5, K = 500)

Arguments

vec

A NeuroVec instance supplying the data to cluster.

mask

A NeuroVol mask defining the voxels to include in the clustering result. If the mask contains numeric data, nonzero values will define the included voxels. If the mask is a LogicalNeuroVol, then TRUE will define the set of included voxels.

compactness

A numeric value controlling the compactness of the clusters, with larger values resulting in more compact clusters. Default is 5.

K

The number of clusters to find. Default is 500.

Value

A list of class snic_cluster_result with the following elements:

clusvol

An instance of type ClusteredNeuroVol.

gradvol

A NeuroVol instance representing the spatial gradient of the reference volume.

cluster

A vector of cluster indices equal to the number of voxels in the mask.

centers

A matrix of cluster centers with each column representing the feature vector for a cluster.

coord_centers

A matrix of spatial coordinates with each row corresponding to a cluster.

See Also

supervoxels

Examples

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)

snic_res <- snic(vec, mask, compactness=5, K=100)


bbuchsbaum/neurocluster documentation built on April 1, 2024, 8:43 p.m.