make_aparc_2_3datlas: Create cortical ggseg3d-atlas from annot-file

View source: R/create-ggseg3d-atlas.R

make_aparc_2_3datlasR Documentation

Create cortical ggseg3d-atlas from annot-file

Description

Function loops through hemispheres and surfaces to create a data frame that is ready to use with ggseg3d.

Usage

make_aparc_2_3datlas(
  annot,
  subject = "fsaverage5",
  hemisphere = c("rh", "lh"),
  surface = c("inflated", "LCBC"),
  subjects_dir = freesurfer::fs_subj_dir(),
  annot_dir = file.path(subjects_dir, subject, "label"),
  output_dir = tempdir(),
  ncores = parallel::detectCores() - 2,
  cleanup = TRUE,
  verbose = TRUE
)

Arguments

annot

annotation file, with name [hemi].[annot].annot abd be in annot_dir

subject

Freesurfer subject, must exist in whatever subject directory specified or set in the environment with $SUBJECTS_DIR

hemisphere

hemisphere, either "rh" or "lh"

surface

Freesurfer surface

subjects_dir

Freesurfer subject directory

annot_dir

path to directory with annot-files

output_dir

output directory path

ncores

number of cores for parallel processing (default numcores-2)

cleanup

logical to toggle removal of all intermediary files

verbose

logical indicating to be verbose or not

Details

It is recommended that you change the region names for the atlas, and the atlas name to something shorter. See the dk_3d atlas for examples.

Value

nested data frame as ggseg3d-atlas

Examples

## Not run: 
dt <- aparc_2_3datlas(annot = "aparc.a2009s")
dt <- aparc_2_3datlas(annot = "aparc.a2009s",
                      surface = "sphere")

## End(Not run)

LCBC-UiO/ggsegExtra documentation built on May 9, 2022, 1:07 a.m.