get_brain_mesh: Get brain surface mesh

View source: R/brain_mesh.R

get_brain_meshR Documentation

Get brain surface mesh

Description

Retrieves a brain surface mesh for the specified hemisphere and surface type. By default, provides the inflated fsaverage5 surface from internal data. Other surfaces (pial, white, semi-inflated) require the ggseg3d package.

Usage

get_brain_mesh(
  hemisphere = c("lh", "rh"),
  surface = "inflated",
  brain_meshes = NULL
)

Arguments

hemisphere

"lh" or "rh"

surface

Surface type (default "inflated"). Other surfaces require ggseg3d or a custom brain_meshes argument.

brain_meshes

Optional user-supplied mesh data. Accepts either list(lh = list(vertices, faces), rh = ...) or the legacy list(lh_inflated = list(vertices, faces), ...) format.

Value

A list with vertices (data.frame with x, y, z) and faces (data.frame with i, j, k), or NULL if the mesh is not available.

Examples

mesh <- get_brain_mesh("lh")
head(mesh$vertices)

ggseg.formats documentation built on July 2, 2026, 5:07 p.m.