Learn R Programming

freesurferformats (version 1.1.0)

cifti.axis.labels: Create a CIFTI-2 axis for label maps.

Description

See cifti.axis.scalars; a labels axis is the same thing with integer label keys instead of scalar values, and it stores the label table that defines the keys.

Usage

cifti.axis.labels(names = NULL, label_tables = NULL, metadata = NULL)

Value

a named list with the entries 'type' and 'named_maps', an axis to be passed to cifti.header.from.axes or write.cifti.

Arguments

names

character vector or NULL, the map names. The number of maps is the number of names, so this has to be given (use empty strings for unnamed maps).

label_tables

list of label tables or NULL, one per map. Each label table is a data.frame with the columns 'key' (integer), 'red', 'green', 'blue', 'alpha' (numeric in the range 0 to 1) and 'label' (character string), i.e. the format that cifti.label.table returns. NULL entries are allowed for maps without a label table.

metadata

list of metadata lists or NULL, one per map. Each metadata list is a named list of character strings, as returned for a map by read.cifti.header. This is used for the palette information that Connectome Workbench stores per map.

See Also

Other cifti functions: cifti.axis.brain.models(), cifti.axis.from.template(), 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(), 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
label_table <- data.frame(key = 0:1, red = c(1, 0), green = c(1, 0.5), blue = c(1, 1),
                          alpha = c(0, 1), label = c("???", "PARCEL_A"))
axis <- cifti.axis.labels("parcellation", label_tables = list(label_table))
axis$named_maps[[1]]$labels$label

Run the code above in your browser using DataLab