View source: R/show_cluster_composition.R
show_cluster_composition | R Documentation |
Input a matrix of all MNI coordinates within a cluster, and output the cluster composition (i.e., percentage of each brain region within it).
show_cluster_composition(coordinate_matrix, template = c("aal", "ba"))
coordinate_matrix |
A matrix of the size 3 x N, which N is the number of coordinates with the cluster of interest. Three rows correspond to the x, y, z MNI values of each coordinate. |
template |
One character vector which indicates the templates to use
( |
Return a list of frequency table and each of them corresponds to a template. Each table consists the brain region names and the corresponding percentage of the input brain cluster.
If there are coordinates which do not fall into any labeled brain region (e.g., white matter), it will be labeled as "NULL".
show_nii_clusters
# Assume there is a cluster of brain coordinates that you want to know
# its composition.
# The cluster has 10 coordinates which MNI coordinates fall in the cube with
# min corner [10, 10, -5] and max cormer [15, 15, 0]
set.seed(1)
brain_matrix <- matrix(cbind(
x = runif(n = 10, min = 10, max = 15),
y = runif(n = 10, min = 10, max = 15),
z = runif(n = 10, min = -5, max = 0)
), nrow = 3, byrow = T)
show_cluster_composition(brain_matrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.