Learn R Programming

⚠️There's a newer version (0.0.2) of this package.Take me there.

ggseg.formats

ggseg.formats provides the ggseg_atlas S3 class that powers the ggseg ecosystem for 2D and 3D brain visualisation. It ships three bundled atlases, a set of accessor functions for querying atlas contents, and a pipe-friendly manipulation API for subsetting, renaming, and enriching atlas objects.

Bundled atlases

The package includes three atlases covering the main atlas types:

  • dk — Desikan-Killiany cortical parcellation (68 regions)
  • aseg — FreeSurfer automatic subcortical segmentation
  • tracula — TRACULA white matter tract atlas
library(ggseg.formats)
plot(dk())
plot(aseg())
plot(tracula())

Quick example

Atlas objects are designed for exploration and customisation. You can query regions, filter views, and pipe operations together:

aseg_small <- aseg() |>
  atlas_region_keep("hippocampus|amygdala|thalamus") |>
  atlas_view_keep("coronal_3|axial_3") |>
  atlas_view_gather()
plot(aseg_small)

Installation

Install from the ggsegverse r-universe:

options(repos = c(
    ggsegverse = 'https://ggsegverse.r-universe.dev',
    CRAN = 'https://cloud.r-project.org'))

install.packages('ggseg.formats')

Or install the development version from GitHub:

# install.packages("devtools")
devtools::install_github("ggseg/ggseg.formats")

Learn more

  • vignette("ggseg.formats") — understanding atlas structure and accessors
  • vignette("atlas-manipulation") — region, view, and metadata manipulation

Copy Link

Version

Install

install.packages('ggseg.formats')

Version

0.0.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Athanasia Mo Mowinckel

Last Published

February 18th, 2026

Functions in ggseg.formats (0.0.1)

read_freesurfer_stats

Read in raw FreeSurfer stats file
read_freesurfer_table

Read in stats table from FreeSurfer
is_ggseg3d_atlas

Check if object is a legacy ggseg3d atlas
ggseg_data_tract

Create tract atlas data
is_ggseg_atlas

Check ggseg atlas class
read_atlas_files

Read in atlas data from all subjects
ggseg_data_subcortical

Create subcortical atlas data
atlas_regions

Extract unique region names from an atlas
aseg

FreeSurfer Automatic Subcortical Segmentation Atlas
atlas_meshes

Get atlas meshes for 3D rendering
atlas_sf

Get atlas data for 2D rendering
atlas_manipulation

Manipulate brain atlas regions and views
atlas_labels

Extract unique labels from an atlas
atlas_vertices

Get atlas vertices for 3D rendering
atlas_type

Detect atlas type
as_ggseg_atlas

Coerce to ggseg atlas
ggseg

ggseg: Plot brain segmentations with ggplot
get_brain_mesh

Get brain surface mesh
atlas_palette

Get atlas palette
convert_legacy_brain_atlas

Convert legacy ggseg atlases to ggseg_atlas format
ggseg_atlas

Constructor for ggseg atlas
dk

Desikan-Killiany Cortical Atlas
atlas_views

Get available views in atlas
ggseg_data_cortical

Create cortical atlas data
tracula

TRACULA White Matter Tract Atlas