Learn R Programming

freesurferformats (version 1.1.0)

cifti.header.from.axes: Create the CIFTI-2 XML metadata for a set of axes.

Description

Build the CIFTI-2 XML document (the part of a CIFTI-2 file that describes what the data matrix contains) from a set of axes. This is the inverse of the XML parsing that read.cifti.header performs: pass the result of this function to cifti.parse.xml or to read.cifti.header (after storing it in a file) and you get back the axes you put in.

Usage

cifti.header.from.axes(axes, metadata = NULL)

Value

character string, the CIFTI-2 XML document.

Arguments

axes

list of axes, one per matrix dimension, as created by the cifti.axis.*() functions or by cifti.axis.from.template. If the list is named, the names have to be the matrix dimensions ('0' and '1'), otherwise the axes are assigned to the dimensions in the order in which they are given.

metadata

named character vector or named list or NULL, the metadata of the matrix (e.g. the provenance information), as name/value pairs.

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.label.table(), cifti.parcel(), cifti.parcels(), cifti.series.info(), cifti.structure.data(), cifti.structures(), 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

Run this code
axis_series <- cifti.axis.series(4L, start = 0, step = 2.5)
axis_brain <- cifti.axis.brain.models(list(
  cifti.brain.model.surface("lh", 10L),
  cifti.brain.model.surface("rh", 12L)))
xml <- cifti.header.from.axes(list(axis_series, axis_brain))
cat(substr(xml, 1, 200))

Run the code above in your browser using DataLab