Package 'ggseg.meshes'

Title: Additional Brain Surface Meshes for the 'ggsegverse' Ecosystem
Description: Provides additional brain surface meshes for cortical and cerebellar visualisation in the 'ggsegverse' ecosystem. Cortical surfaces include pial, white, midthickness, semi-inflated, sphere, smoothwm, and orig at fsaverage5 resolution. Cerebellar surfaces include the Spatially Unbiased Infratentorial Template (SUIT) flatmap. All meshes follow the same vertices/faces data frame format used by 'ggseg.formats' and 'ggseg3d'.
Authors: Athanasia Mo Mowinckel [aut, cre] (ORCID: <https://orcid.org/0000-0002-5756-0223>), Center for Lifespan Changes in Brain and Cognition (LCBC), University of Oslo [cph]
Maintainer: Athanasia Mo Mowinckel <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1.9000
Built: 2026-10-13 12:06:33 UTC
Source: https://github.com/ggsegverse/ggseg.meshes

Help Index


List available cerebellar surfaces

Description

List available cerebellar surfaces

Usage

available_cerebellar_surfaces()

Value

Character vector of available surface names.

See Also

Other cerebellar meshes: get_cerebellar_flatmap()

Examples

available_cerebellar_surfaces()

List available cortical surfaces

Description

List available cortical surfaces

Usage

available_cortical_surfaces()

Value

Character vector of available surface names.

See Also

Other cortical meshes: get_cortical_mesh()

Examples

available_cortical_surfaces()

Get SUIT cerebellar flatmap mesh

Description

Retrieves the SUIT cerebellar flatmap surface mesh. This is a 2D flattened representation of the cerebellar cortex, useful for visualising cerebellar parcellations without 3D rendering.

Usage

get_cerebellar_flatmap(surface = .cerebellar_surfaces)

Arguments

surface

Surface type. Currently only "suit_flat".

Details

The projection is exactly flat: z is 0 for every one of the 28,935 vertices.

The flatmap's vertices are the first 28,935 of the 30,013 in the SUIT 3D pial surface in ggseg.formats, in the same order. The remaining 1,078 are the peduncular cap, which has no flatmap counterpart. A cerebellar atlas vertex index below 28,935 therefore applies to this mesh unchanged; indices from 28,935 upwards cannot be drawn on the flatmap. 101 of the 28,935 vertices appear in no face, so values on them are carried but never rendered.

Value

A list with vertices (data.frame with x, y, z) and faces (data.frame with i, j, k, 0-based indices matching ggseg.formats convention for cerebellar meshes). Has attribute face_index_base = 0L.

See Also

Other cerebellar meshes: available_cerebellar_surfaces()

Examples

mesh <- get_cerebellar_flatmap()
str(mesh, max.level = 2)
head(mesh$faces)
attr(mesh, "face_index_base")

Get cortical brain surface mesh

Description

Retrieves a cortical brain surface mesh for the specified hemisphere and surface type. All surfaces are fsaverage5 resolution (10,242 vertices, 20,480 faces per hemisphere).

Usage

get_cortical_mesh(hemisphere = c("lh", "rh"), surface = .cortical_surfaces)

Arguments

hemisphere

"lh" or "rh"

surface

Surface type: "pial", "white", "midthickness", "semi-inflated", "sphere", "smoothwm", or "orig"

Details

The stored coordinates are rotated 90 degrees from FreeSurfer's native axes, so they do not mean what the names x, y, z usually mean on a FreeSurfer-derived surface. x is the anterior-posterior axis (positive anterior), y is the left-right axis (positive left, so the left hemisphere sits at positive y), and z is the superior-inferior axis (positive superior, unrotated). Plotting x against z therefore gives a lateral view with anterior to the right and superior at the top; plotting y against z gives a coronal view.

Value

A list with vertices (data.frame with x, y, z, in the rotated convention described above) and faces (data.frame with i, j, k, 1-based indices). Has attribute face_index_base = 1L.

See Also

ggseg.formats::get_brain_mesh() for the inflated cortical mesh bundled with the core packages, whose faces are 0-based, and ggseg3d::resolve_brain_mesh(), which resolves these surfaces for 3D rendering.

Other cortical meshes: available_cortical_surfaces()

Examples

mesh <- get_cortical_mesh("lh", "pial")
str(mesh, max.level = 2)
head(mesh$faces)
attr(mesh, "face_index_base")