Skip to contents

neuroatlas provides a unified interface for working with neuroimaging atlases and parcellations in R. Whether you’re conducting ROI-based analyses, visualizing brain data, or integrating different parcellation schemes, neuroatlas streamlines these tasks with consistent, user-friendly functions.

Features

Installation

You can install the development version from GitHub:

# install.packages("pak")
pak::pak("bbuchsbaum/neuroatlas")

TemplateFlow Setup

TemplateFlow access uses the imported pure-R templateflow package. No Python or reticulate setup is required:

neuroatlas::tflow_spaces(pattern = "^MNI")
neuroatlas::show_templateflow_cache_path()

Quick Start

library(neuroatlas)

# Get a Schaefer atlas (200 parcels, 7 networks)
schaefer <- get_schaefer_atlas(parcels = 200, networks = 7)
print(schaefer)

# Extract a specific ROI by label (e.g. the first visual parcel)
roi <- get_roi(schaefer, "Vis_1")

# Get Glasser atlas
glasser <- get_glasser_atlas()

# Access templates via TemplateFlow
mni_brain <- get_template("MNI152NLin2009cAsym", variant = "brain")

Discovering and loading atlases

# See every built-in atlas
list_atlases()

# Load any of them by id (with loader-specific arguments)
schaefer <- get_atlas("schaefer2018", parcels = "100", networks = "7")

HCPex: cortex and subcortex

HCPex adds 66 subcortical regions to the 360 cortical regions of HCP-MMP1.0. Load the upstream v1.1 volume at 1 or 2 mm:

hcp <- get_atlas("hcpex", resolution = 2)
get_roi(hcp, label = "V1_L")
subcortex <- filter_atlas(hcp, division == "subcortical")
roi_metadata(subcortex)  # Abbreviations, full names, hemisphere, and colors
atlas_citations(hcp)

The source declares MNI152NLin2009cAsym template space. HCPex uses its own region ordering; reorder matrices from original HCP-MMP1.0 order before mapping them to this atlas. Downloads are cached and checked against pinned checksums. The upstream atlas data are licensed under GPL-3.0.

Identify and cite a resource

aseg <- get_aseg_atlas()
atlas_metadata(aseg)       # Identity, current geometry, source, and modifications
atlas_citations(aseg)      # R bibliography entries, ready for toBibtex()
atlas_artifacts(aseg)      # Original files, license information, and checksums
atlas_history(aseg)        # Recorded operations and their parameters

Metadata stay attached when objects are saved. Source-file geometry and current object geometry are recorded separately, and unknown provenance is explicit. See Identify, cite, and trace an atlas.

Palette demos

neuroatlas includes perceptually-optimised palettes for atlas ROIs. For instance, you can generate a slice-aware palette for the Schaefer 200×7 atlas and feed it directly into plot_brain():

library(neuroatlas)

schaefer <- get_schaefer_atlas(parcels = 200, networks = 7)

colors <- atlas_roi_colors(
  schaefer,
  method = "maximin_view",
  seed = 1
)

schaefer_surface <- schaefer_surf(parcels = 200, networks = 7)

plot_brain(
  schaefer_surface,
  colors = colors,
  interactive = FALSE,
  style = "ggseg_like"
)

Schaefer-200 (7-network) parcellation on the fsaverage6 surface with a perceptually-optimised maximin colour palette; lateral and medial views of both hemispheres.

Available Atlases

Atlas Function Description
Schaefer get_schaefer_atlas() Cortical parcellations (100-1000 regions, 7 or 17 networks); surface via get_schaefer_surfatlas()
Brainnetome get_brainnetome_atlas() 246-region connectional atlas with Yeo network and cytoarchitectonic metadata
Glasser get_glasser_atlas() 360-region multi-modal cortical parcellation (surface via glasser_surf())
HCPex get_hcpex_atlas() 360 cortical and 66 subcortical regions, native 1/2 mm volumes in MNI152NLin2009cAsym
Harvard-Oxford get_harvard_oxford_atlas() Cortical/subcortical structural atlases via TemplateFlow or FSL
Julich-Brain get_julich_brain_atlas() FSL Julich-Brain cytoarchitectonic atlas
ASEG get_aseg_atlas() FreeSurfer subcortical segmentation
Subcortical get_subcortical_atlas() Harmonized thalamus, cerebellum, and subcortex atlases (AtlasPack/TemplateFlow)
Olsen MTL get_olsen_mtl() Medial temporal lobe atlas with hippocampal subfields
Wang (2015) get_wang_atlas() Probabilistic visual topography on fsaverage (25 areas/hemi); probability volumes via get_wang_prob_atlas()
visfAtlas get_visfatlas() Probabilistic functional atlas of occipito-temporal visual cortex (33 regions)
Visual V1-V5 get_visual_atlas() Cytoarchitectonic early visual areas extracted from Julich-Brain

Documentation

  • neuroim2 - Core neuroimaging data structures
  • neurosurf - Surface-based operations
  • ggseg - Brain visualization

License

MIT © Bradley Buchsbaum

Albers theme

This package uses the albersdown theme. Existing vignette theme hooks are replaced so albers.css and local albers.js render consistently on CRAN and GitHub Pages. The palette family is provided via params$family (default ‘red’). The pkgdown site uses template: { package: albersdown }.