colortable.from.annot: Extract color lookup table (LUT) from annotation.

Description Usage Arguments Value See Also Examples

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

1
colortable.from.annot(annot, compute_colorcode = FALSE)

Arguments

annot

An annotation, as returned by read.fs.annot. If you want to assign specific indices, you can add a column named 'struct_index' to the data.frame annot$colortable_df. If there is no such columns, the indices will be created automatically in the order of the regions, starting at zero.

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

1
2
3
4
5
    annotfile = system.file("extdata", "lh.aparc.annot.gz",
     package = "freesurferformats", mustWork = TRUE);
    annot = read.fs.annot(annotfile);
    colortable = colortable.from.annot(annot);
    head(colortable);

freesurferformats documentation built on May 25, 2021, 5:10 p.m.