colortable.from.annot {freesurferformats} | R Documentation |
Extract color lookup table (LUT) from annotation.
Description
Extract a colortable lookup table (LUT) from an annotation. Such a LUT can also be read from files like ‘FREESURFER_HOME/FreeSurferColorLUT.txt' or saved as a file, check the ’See Also' section below.
Usage
colortable.from.annot(annot, compute_colorcode = FALSE)
Arguments
annot |
An annotation, as returned by |
compute_colorcode |
logical, indicates whether the unique color codes should be computed and added to the returned data.frame as an extra integer column named 'code'. Defaults to FALSE. |
Value
the colortable data.frame extracted from the annotation.
See Also
Other atlas functions:
read.fs.annot()
,
read.fs.colortable()
,
write.fs.annot.gii()
,
write.fs.annot()
,
write.fs.colortable()
Other colorLUT functions:
read.fs.colortable()
,
write.fs.colortable()
Examples
annotfile = system.file("extdata", "lh.aparc.annot.gz",
package = "freesurferformats", mustWork = TRUE);
annot = read.fs.annot(annotfile);
colortable = colortable.from.annot(annot);
head(colortable);