Skip to contents

[Experimental]

Build a brain atlas from GIFTI label files (.label.gii). Assumes fsaverage5 surface space (10,242 vertices per hemisphere).

Usage

create_cortical_from_gifti(
  gifti_files,
  atlas_name = NULL,
  output_dir = NULL,
  hemisphere = c("rh", "lh"),
  views = c("lateral", "medial", "superior", "inferior"),
  tolerance = NULL,
  smooth_refinements = NULL,
  cleanup = NULL,
  verbose = get_verbose(),
  skip_existing = NULL
)

Arguments

gifti_files

Character vector of paths to .label.gii files. Hemisphere is detected from filename patterns (lh., rh., .L., .R.).

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().

hemisphere

Which hemispheres to include: "lh", "rh", or both.

views

Which views to include: "lateral", "medial", "superior", "inferior".

tolerance

[Deprecated] 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

[Deprecated] 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 the GGSEG_EXTRA_CLEANUP environment variable. Default is TRUE.

verbose

Verbosity level: 0 (silent), 1 (standard progress, default), or 2 (debug, includes FreeSurfer output). Logical values are accepted (TRUE = 1, FALSE = 0). If not specified, uses the value from options("ggseg.extra.verbose") or the GGSEG_EXTRA_VERBOSE environment 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 the GGSEG_EXTRA_SKIP_EXISTING environment variable. Default is TRUE.

Value

A ggseg_atlas object.

Examples

if (FALSE) { # \dontrun{
atlas <- create_cortical_from_gifti(
  gifti_files = c("lh.aparc.label.gii", "rh.aparc.label.gii")
)
} # }