cifti.structures: Get the brain model table of a CIFTI-2 file.

View source: R/read_cifti_header.R

cifti.structuresR Documentation

Get the brain model table of a CIFTI-2 file.

Description

Get the brain model entries for one matrix dimension of a CIFTI-2 file, i.e. the mapping from matrix indices to surface vertices or volume voxels. Note that a brain structure can appear in several brain model entries: a grayordinates file can contain a surface part and a volume part for the same structure, and a structure can be split into several index ranges. Always use the index ranges from this table to map data values, never the structure names.

Usage

cifti.structures(cii, dim = 0L)

Arguments

cii

an fs.cifti instance, see read.cifti.header.

dim

integer, the matrix dimension to get the brain models for. CIFTI-2 files have two dimensions, so this is usually 0 (Workbench calls it the ROW dimension) or 1 (the COLUMN dimension). See read.cifti.header for details on the dimensions.

Value

a data.frame with one row per brain model entry and the columns 'structure' (character string, the brain structure in the spelling used in the file), 'structure_short' (character string, the normalized name without the CIFTI_STRUCTURE_ prefix, e.g. 'CORTEX_LEFT'), 'model_type' ('SURFACE' or 'VOXELS'), 'index_offset' (integer, 0-based index of the first matrix entry covered by this brain model), 'index_count' (integer, the number of matrix entries covered) and 'surface_number_of_vertices' (integer, the number of vertices of the complete surface, for surface models; NA for volume models). Use index_offset and index_count to extract the data values for a brain model from the data matrix.

See Also

Other cifti functions: cifti.axis.brain.models(), cifti.axis.from.template(), cifti.axis.labels(), cifti.axis.parcels(), cifti.axis.parcels.from.annot(), cifti.axis.scalars(), cifti.axis.series(), cifti.brain.model.surface(), cifti.brain.model.volume(), cifti.dim.labels(), cifti.file.type.for.axes(), cifti.grayordinates(), cifti.header.from.axes(), cifti.label.table(), cifti.parcel(), cifti.parcels(), cifti.series.info(), cifti.structure.data(), cifti.volume(), print.fs.cifti(), print.fs.cifti.data(), print.fs.connectome(), read.cifti(), read.cifti.header(), read.cifti.rows(), read.fs.connectome.cifti(), write.cifti(), write.fs.connectome.cifti(), write.fs.morph.cifti(), write.fs.parcellated.cifti(), write.fs.parcellation.cifti(), write.fs.series.cifti()

Examples

cifti_file <- system.file("extdata", "cifti", "tiny.dscalar.nii", package = "freesurferformats")
cii <- read.cifti.header(cifti_file)
cifti.structures(cii, dim = 1L)


freesurferformats documentation built on Sept. 25, 2026, 1:07 a.m.