read.fs.colortable: Read colortable file in FreeSurfer ASCII LUT format.

Description Usage Arguments Value See Also Examples

Description

Read a colortable from a text file in FreeSurfer ASCII colortable lookup table (LUT) format. An example file is 'FREESURFER_HOME/FreeSurferColorLUT.txt'.

Usage

1
read.fs.colortable(filepath, compute_colorcode = FALSE)

Arguments

filepath,

string. Full path to the output colormap file.

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 data.frame that was read from the LUT file. It contains the following columns that were read from the file: 'struct_index': integer, index of the struct entry. 'struct_name': character string, the label name. 'r': integer in range 0-255, the RGBA color value for the red channel. 'g': same for green channel. 'b': same for blue channel. 'a': same for alpha (transparency) channel. If 'compute_colorcode' is TRUE, it also contains the following columns which were computed from the color values: 'code': integer, unique color identifier computed from the RGBA values.

See Also

Other atlas functions: colortable.from.annot(), read.fs.annot(), write.fs.annot.gii(), write.fs.annot(), write.fs.colortable()

Other colorLUT functions: colortable.from.annot(), write.fs.colortable()

Examples

1
2
3
   lutfile = system.file("extdata", "colorlut.txt", package = "freesurferformats", mustWork = TRUE);
   colortable = read.fs.colortable(lutfile, compute_colorcode=TRUE);
   head(colortable);

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