spectralbrain.utils.atlas#
Brain atlas label registries.
Maps atlas label IDs to human-readable region names, hemispheres,
network assignments, and canonical colours. Covers the 19 atlases
in AtlasScheme.
The two primary use cases are:
Point-cloud extraction: look up label IDs for a structure (
get_label_id("aseg", "Left-Hippocampus") → 17).Geometric connectome: map Schaefer parcels to Yeo networks for block-level aggregation.
Label tables for subcortical atlases (aseg, thalamic nuclei, hippocampal subfields, amygdala nuclei) are embedded. Cortical atlases (Schaefer, DKT, Destrieux) load from FreeSurfer annotation files when available.
Functions
|
Reverse lookup: region name → label ID. |
|
Look up the region name for a label ID. |
|
Get all label IDs for a hemisphere. |
|
Return all label ID → name mappings for an atlas. |
|
Map a Schaefer parcel ID to its Yeo network name. |
- spectralbrain.utils.atlas.get_label_id(atlas, name)[source]#
Reverse lookup: region name → label ID.
- spectralbrain.utils.atlas.get_label_name(atlas, label_id)[source]#
Look up the region name for a label ID.
- spectralbrain.utils.atlas.get_structure_ids(atlas, hemisphere='both')[source]#
Get all label IDs for a hemisphere.
- spectralbrain.utils.atlas.list_labels(atlas)[source]#
Return all label ID → name mappings for an atlas.
- spectralbrain.utils.atlas.schaefer_to_yeo(parcel_id, n_parcels=200, n_networks=7)[source]#
Map a Schaefer parcel ID to its Yeo network name.
Schaefer parcels encode the network in their naming convention:
7Networks_LH_Vis_1→ “Visual”.- Parameters:
- Returns:
str – Network name.
- Return type:
Notes
This is a heuristic based on the standard Schaefer ordering. For exact mapping, load the annotation file and parse names.