API Reference

Visualization Functions

Core plotting functions for 2D and 3D brain visualization

geom_brain
ggseg3d Create an interactive 3D brain atlas visualization.

Atlases

Built-in brain atlases

dk
aseg
tracula

3D Modifiers

Functions to modify 3D plots (pipe-style)

pan_camera Set camera position using R ggseg3d-style view names.
set_background Set the background color of the 3D plot.
add_glassbrain Add a transparent glass brain mesh for context.
set_legend Configure the legend visibility.
remove_legend Remove the legend from the plot.
set_hover Configure hover information.

Data Handling

Functions for joining data with atlases

brain_join Merge user data with atlas geometry.

Atlas Utilities

Functions for querying and manipulating atlases

atlas_regions Extract unique region names from an atlas.
atlas_labels Extract unique labels from an atlas.
atlas_views Get available views in atlas.
atlas_palette Get atlas color palette.
atlas_sf Get atlas 2D geometry data.
atlas_type Get atlas type.
atlas_region_remove Remove regions matching a pattern.
atlas_region_keep Keep only regions matching a pattern.
atlas_region_rename Rename regions matching a pattern.
atlas_region_contextual Keep region geometry but remove from core/palette.
atlas_view_remove Remove views matching pattern from sf data.
atlas_view_keep Keep only views matching pattern.
atlas_view_gather Reposition views to close gaps after view removal.
atlas_view_reorder Reorder views and reposition.
atlas_view_remove_region Remove specific region geometry from sf data only.
atlas_view_remove_small Remove region geometries below a minimum area threshold.
atlas_core_add Join additional metadata columns to atlas core.

Themes

Plotnine themes for brain plots

theme_brain Clean theme for brain plots with minimal axes.
theme_darkbrain Dark theme for brain plots.
theme_custombrain Customizable theme for brain plots.
theme_brain_void Void theme with no axes, background, or grid.

Classes

Core data structures

BrainAtlas Brain atlas container for 2D and 3D visualization.
CorticalAtlas
SubcorticalAtlas
TractAtlas