Read a FreeSurfer color lookup table file (e.g., FreeSurferColorLUT.txt
or ASegStatsLUT.txt). These files map label indices to region names
and RGBA colours.
See also
get_ctab() to read and add hex colours, write_ctab() to write
Examples
ctab_file <- tempfile()
writeLines(c(
" 0 Unknown 0 0 0 0",
" 1 Left-Cerebral-Cortex 205 130 176 0"
), ctab_file)
read_ctab(ctab_file)
#> idx label R G B A
#> 1 0 Unknown 0 0 0 0
#> 2 1 Left-Cerebral-Cortex 205 130 176 0