Build a brain atlas from a CIFTI dense label file (.dlabel.nii).
A single CIFTI file contains data for both hemispheres. The file must
be in fsaverage5 space (10,242 vertices per hemisphere).
No FreeSurfer installation is needed for 3D-only atlases (steps = 1).
Usage
create_cortical_from_cifti(
cifti_file,
atlas_name = NULL,
output_dir = NULL,
hemisphere = c("rh", "lh"),
views = c("lateral", "medial", "superior", "inferior"),
tolerance = NULL,
smoothness = NULL,
snapshot_dim = NULL,
cleanup = NULL,
verbose = get_verbose(),
skip_existing = NULL,
steps = NULL
)Arguments
- cifti_file
Path to a
.dlabel.niiCIFTI file.- 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
Simplification tolerance for 2D polygons. Higher values produce simpler shapes with fewer vertices (typical range: 0.1–2). Passed to
sf::st_simplify(). If not specified, usesoptions("ggseg.extra.tolerance")or theGGSEG_EXTRA_TOLERANCEenvironment variable. Default is 1.- smoothness
Smoothing factor for 2D contours. Higher values produce smoother region boundaries (typical range: 3–15). Passed to
smoothr::smooth(). If not specified, usesoptions("ggseg.extra.smoothness")or theGGSEG_EXTRA_SMOOTHNESSenvironment variable. Default is 5.- snapshot_dim
Width and height (in pixels) for brain surface snapshots. Higher values capture more detail for dense parcellations. If not specified, uses
options("ggseg.extra.snapshot_dim")or theGGSEG_EXTRA_SNAPSHOT_DIMenvironment variable. Default is 800.- 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.- steps
Which pipeline steps to run. See
create_cortical_from_annotation()for step descriptions. Usesteps = 1for 3D-only atlas.
Examples
if (FALSE) { # \dontrun{
atlas <- create_cortical_from_cifti(
cifti_file = "parcellation.dlabel.nii",
steps = 1
)
ggseg3d::ggseg3d(atlas = atlas)
} # }