ClusteredNeuroVol-class | R Documentation |
This class represents a three-dimensional brain image divided into N disjoint
partitions or clusters. It extends the SparseNeuroVol
class
to provide efficient storage and manipulation of clustered neuroimaging data.
Construct a ClusteredNeuroVol
instance
ClusteredNeuroVol(mask, clusters, label_map = NULL, label = "")
mask |
an instance of class |
clusters |
a vector of clusters ids with length equal to number of nonzero
voxels in mask |
label_map |
an optional |
label |
an optional |
The ClusteredNeuroVol class is designed for efficient representation and manipulation of brain images with distinct, non-overlapping regions or clusters. It combines the memory efficiency of sparse representations with additional structures for managing cluster information.
The use case of ClusteredNeuroVol
is to store volumetric data that has been clustered into discrete sets of voxels,
each of which has an associated id. For example, this class can be used to represent parcellated neuroimaging volumes.
ClusteredNeuroVol
instance
mask
A LogicalNeuroVol
object representing the logical
mask indicating the spatial domain of the set of clusters.
clusters
An integer vector representing the cluster number for each voxel in the mask.
label_map
A named list where each element represents a cluster and its name.
cluster_map
An environment
object that maps from cluster id to the
set of 1D spatial indices belonging to that cluster.
This class inherits methods from the SparseNeuroVol
class.
Additional methods specific to cluster operations may be available.
ClusteredNeuroVol objects are particularly useful for:
Representing parcellated brain images
Storing results of clustering algorithms applied to neuroimaging data
Efficient manipulation and analysis of region-based neuroimaging data
SparseNeuroVol-class
for the parent sparse volume class.
LogicalNeuroVol-class
for the mask representation.
## Not run:
# Create a simple clustered brain volume
dim <- c(10L, 10L, 10L)
mask_data <- array(rep(c(TRUE, FALSE), 500), dim)
mask <- new("LogicalNeuroVol", .Data = mask_data,
space = NeuroSpace(dim = dim, origin = c(0,0,0), spacing = c(1,1,1)))
clusters <- as.integer(runif(sum(mask_data)) * 5)
label_map <- list("Cluster1" = 1, "Cluster2" = 2, "Cluster3" = 3,
"Cluster4" = 4, "Cluster5" = 5)
cluster_map <- new.env()
for (i in 1:5) {
cluster_map[[as.character(i)]] <- which(clusters == i)
}
clustered_vol <- new("ClusteredNeuroVol",
mask = mask,
clusters = clusters,
label_map = label_map,
cluster_map = cluster_map)
## End(Not run)
bspace <- NeuroSpace(c(16,16,16), spacing=c(1,1,1))
grid <- index_to_grid(bspace, 1:(16*16*16))
kres <- kmeans(grid, centers=10)
mask <- NeuroVol(rep(1, 16^3),bspace)
clusvol <- ClusteredNeuroVol(mask, kres$cluster)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.