Get the label table of one label map (a .dlabel file can
contain several maps). The label table maps integer label keys to names and
RGBA colors, and is the CIFTI analogue of a FreeSurfer color lookup table.
Arguments
- cii
an
fs.ciftiinstance, seeread.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.headerfor details on the dimensions.- map
integer, the number of the label map to get the label table for (1-based). A CIFTI label file can contain several maps, use
cii$matrix$indices_mapsor themap_namefield of the result to find out which one you need.
Value
a data.frame with one row per label and the columns 'key' (integer,
the label key used in the data), 'red', 'green', 'blue', 'alpha' (numeric,
in range 0 to 1) and 'label' (character string, the label name), plus 'x',
'y', 'z' (numeric, the optional label coordinates; NA if not present in
the file). Returns NULL if the specified matrix dimension does not contain
label maps, or if the specified map has no label table.
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.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
cifti_file <- system.file("extdata", "cifti", "tiny.dlabel.nii", package = "freesurferformats")
cii <- read.cifti.header(cifti_file)
cifti.label.table(cii, dim = 0L, map = 1L)
#> key red green blue alpha label x y z
#> 1 0 1 1.0 1 0 ??? NA NA NA
#> 2 1 0 0.5 1 1 PARCEL_A NA NA NA
#> 3 2 0 0.5 1 1 PARCEL_B NA NA NA
#> 4 3 0 0.5 1 1 PARCEL_C NA NA NA