Build an atlas from individual FreeSurfer .label files rather than a
complete annotation. Each label file defines a single region by listing
which surface vertices belong to it.
The function detects hemisphere from filename prefixes (lh. or rh.) and
derives region names from the rest of the filename.
Usage
create_cortical_from_labels(
label_files,
input_lut = NULL,
atlas_name = NULL,
output_dir = NULL,
views = c("lateral", "medial"),
tolerance = NULL,
smooth_refinements = NULL,
cleanup = NULL,
verbose = get_verbose(),
skip_existing = NULL
)Arguments
- label_files
Paths to
.labelfiles. Each file should follow FreeSurfer naming:{hemi}.{regionname}.label(e.g.,lh.motor.label).- input_lut
Path to a color lookup table (LUT) file, or a data.frame with a
regioncolumn (or a FreeSurfer-stylelabelcolumn) plus colour columns (R, G, B or hex). Rows must be in the same order as the input files.- atlas_name
Name for the atlas. If NULL, derived from the input filename.
- output_dir
Directory to store intermediate files (screenshots, masks, contours). Defaults to
tempdir().- views
Which views to include: "lateral", "medial", "superior", "inferior".
- tolerance
sf simplification is no longer applied during atlas creation. Use
atlas_smooth()on the returned atlas instead. Supplying a value emits a lifecycle warning and is otherwise ignored.- smooth_refinements
sf-side smoothing is no longer applied during atlas creation. Use
atlas_smooth()on the returned atlas instead. Supplying a value emits a lifecycle warning and is otherwise ignored.- cleanup
Remove intermediate files after atlas creation. If not specified, uses
options("ggseg.extra.cleanup")or theGGSEG_EXTRA_CLEANUPenvironment variable. Default is TRUE.- verbose
Verbosity level:
0(silent),1(standard progress, default), or2(debug, includes FreeSurfer output). Logical values are accepted (TRUE= 1,FALSE= 0). If not specified, uses the value fromoptions("ggseg.extra.verbose")or theGGSEG_EXTRA_VERBOSEenvironment variable.- skip_existing
Skip generating output files that already exist, allowing interrupted atlas creation to resume. If not specified, uses
options("ggseg.extra.skip_existing")or theGGSEG_EXTRA_SKIP_EXISTINGenvironment variable. Default is TRUE.
Examples
if (FALSE) { # \dontrun{
labels <- c("lh.region1.label", "lh.region2.label", "rh.region1.label")
atlas <- create_cortical_from_labels(labels)
} # }