View source: R/make_xifti_components.R
make_subcort | R Documentation |
"xifti"
Coerce subcortical data into valid entries for xifti$data$subcort
and xifti$meta$subcort
. The data arguments can be matrices/arrays or
NIFTI file paths. If the mask is not provided, it will be inferred from the
labels.
make_subcort(vol, labs, mask = NULL, idx = NULL, validate_mask = FALSE)
vol |
represents the data values of the subcortex. It is either a NIFTI
file path, 3D/4D data array ( |
labs |
represents the brainstructure labels of each voxel: see
|
mask |
is a NIFTI file path or logical 3D data array ( |
idx |
Only applies if |
validate_mask |
If |
To read in the labels as the primary data, use the labels NIFTI for both
vol
and labs
.
A list with components "data", "labels", "mask", and "trans_mat". The first two will be vectorized and ordered spatially.
The volume can be recovered using:
vol <- unvec_vol(data, mask, fill=NA)
labs <- unvec_vol(labels, mask, fill=0)
xifti$meta$subcort$labels
is a factor with the following levels:
Cortex-L
Cortex-R
Accumbens-L
Accumbens-R
Amygdala-L
Amygdala-R
Brain Stem
Caudate-L
Caudate-R
Cerebellum-L
Cerebellum-R
Diencephalon-L
Diencephalon-R
Hippocampus-L
Hippocampus-R
Pallidum-L
Pallidum-R
Putamen-L
Putamen-R
Thalamus-L
Thalamus-R
These correspond to the same structures as given by
ft_read_cifti
in the cifti-matlab
MATLAB toolbox. Note that
the first two levels (left and right cortex) are not used.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.