Learn R Programming

freesurferformats (version 0.1.18)

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

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

read.fs.colortable(filepath, compute_colorcode = 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.

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.

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

Run this code
   lutfile = system.file("extdata", "colorlut.txt", package = "freesurferformats", mustWork = TRUE);
   colortable = read.fs.colortable(lutfile, compute_colorcode=TRUE);
   head(colortable);

Run the code above in your browser using DataLab