cifti.volume: Create a CIFTI-2 axis for a volume.

View source: R/write_cifti_axes.R

cifti.volumeR Documentation

Create a CIFTI-2 axis for a volume.

Description

A volume axis describes the voxel grid that the volume brain models of a CIFTI-2 file refer to: its dimensions and the 4x4 transformation matrix that maps the (0-based) IJK voxel indices to coordinates. The matrix is stored row by row in the file, and the coordinates it produces are in units of 10^meter_exponent (which is -3, i.e. millimeters, for the files that Connectome Workbench writes).

Usage

cifti.volume(dimensions, transformation_matrix, meter_exponent = -3L)

Arguments

dimensions

integer vector of length 3, the dimensions of the voxel grid.

transformation_matrix

4x4 numeric matrix, the transformation from (0-based) voxel indices to coordinates. There is no default: a CIFTI-2 file does not store the voxel size or the position of a volume anywhere else, so a wrong or invented matrix silently puts the voxels of a structure in the wrong place. Pass the matrix that the template file has (see cifti.axis.from.template) if you do not know it.

meter_exponent

integer, the exponent of the unit of the coordinates.

Value

a named list with the entries 'dimensions', 'meter_exponent' and 'transformation_matrix', to be passed to cifti.axis.brain.models or cifti.axis.parcels.

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.structures(), 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

volume <- cifti.volume(c(4L, 4L, 4L), diag(c(2, 2, 2, 1)))
volume$dimensions


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