Skip to content

Allen Brain Atlas Annotation

Taiyou edited this page Feb 10, 2026 · 3 revisions

Allen Brain Atlas Annotation & ROI Extraction

Overview

The AllenBrainAtlas/atlas/ directory contains the annotation label definitions and MATLAB scripts for extracting regions of interest (ROIs) from the normalized Allen Brain Atlas. These tools map Allen Brain Atlas (ABA) numerical IDs to named brain regions and generate ROI-specific NIfTI volumes used in downstream fMRI analysis.

Directory Structure

AllenBrainAtlas/atlas/
├── doAllROIextract.m        # Batch ROI extraction from atlas
├── doOneROIExtract.m        # Single ROI extraction
├── newLabel.txt             # ROI label definitions (194 regions, revised 2021)
├── newLabel 2.txt           # ROI label definitions (original 2017 version)
├── ROIlabel.xlsm            # Excel workbook with ROI label reference
├── ABA_ROI.nii              # Original ABA ROI volume (not tracked in git)
├── NormalizedAnno2.nii      # Normalized annotation volume (not tracked in git)
├── atlas.nii                # Atlas volume (not tracked in git)
├── newAtlas_roi.nii          # Extracted ROI atlas (not tracked in git)
├── newatlas.nii              # Alternative atlas output (not tracked in git)
└── PVT.nii                   # Paraventricular thalamus ROI (not tracked in git)

Annotation Label File (newLabel.txt)

Format

The label file is a comma-separated text file with the following columns:

ID, ROIname, ROIs, ROI name from Allen Brain Atlas
Column Description
ID Primary Allen Brain Atlas structure ID
ROIname Abbreviated region name used in analysis
ROIs Array of sub-structure ABA IDs grouped under this region (e.g., [303 311 451])
ROI name from Allen Brain Atlas Full anatomical name from ABA

Known Issues in newLabel.txt

Line Issue Details
4 Missing space in ROIs 844882 should be 844 882 (PMA sub-structure IDs)
103, 138 Duplicate entry OT (ID=754, Olfactory tubercle) appears twice
115, 120 Duplicate entry ILM (ID=51, Intralaminar nuclei) appears twice
119, 114 Duplicate entry MTN (ID=571, Midline group) appears twice
114 Category mismatch PVT (Paraventricular thalamus) is listed near hypothalamus entries but is anatomically a thalamic structure

The duplicates do not cause errors in doAllROIextract.m (only the primary ID column is matched, not ROIname), but they result in the later duplicate overwriting the earlier entry when type=2 is used.

Brain Region Categories

The label file defines 194 rows (with some duplicates) organized into the following categories:

Isocortex (54 regions)

Abbreviation Full Name ABA ID
FP Frontal pole 184
SomatoMA Somatomotor areas 500
PMA Primary motor area 985
SMA Secondary motor area 993
SomatoSA Somatosensory area 453
PSSA Primary somatosensory area 322
PSSA_barrel Primary somatosensory area, barrel field 329
PSSA_nose Primary somatosensory area, nose 353
PSSA_lowLimb Primary somatosensory area, lower limb 337
PSSA_mouth Primary somatosensory area, mouth 345
PSSA_uplimb Primary somatosensory area, upper limb 369
PSSA_trunk Primary somatosensory area, trunk 361
PSSA_unassigned Primary somatosensory area, unassigned 1231
RLLVA Rostrolateral lateral visual area 1221
SupplementalSSA Supplemental somatosensory area 378
GustatoryA Gustatory area 1057
VisceralA Visceral area 677
DorsalAA Dorsal auditory area 1011
LaterolAVA Laterolateral anterior visual area 1241
PrimaryAA Primary auditory area 1002
PostAA Posterior auditory area 1027
VentAA Ventral auditory area 1018
VisualA Visual area 669
pVA Primary visual area 385
alVA Anterolateral visual area 402
amVA Anteromedial visual area 394
lVA Lateral visual area 409
plVA Posterolateral visual area 425
pmVA Posteromedial visual area 533
limA Laterointermediate area 1251
PosthA Postrhinal area 1261
ACC Anterior cingulate area 31
dACC Dorsal anterior cingulate area 39
vACC Ventral anterior cingulate area 48
prelimbic Prelimbic area 972
infralimbic Infralimbic area 44
orbital Orbital area 714
lateralOA Lateral orbital area 723
medialOA Medial orbital area 731
ventralOA Ventral orbital area 738
AgraInsula Agranular insular area 95
dRSC Dorsal retrosplenial area 879
vRSC Ventral retrosplenial area 886
lAgranularRSC Lateral agranular retrosplenial area 894
mmAVA Mediomedial anterior visual area 1281
mmpVA Mediomedial posterior visual area 1288
medialVA Medial visual area 1301
PPAC Posterior parietal association areas 22
AnteriorA Anterior area 1308
rlVA Rostrolateral visual area 417
TAA Temporal association areas 541
PerirhinalA Perirhinal area 922
EctorhinalA Ectorhinal area 895

Olfactory Areas (10 regions)

Abbreviation Full Name ABA ID
MOB Main olfactory bulb 507
AOB Accessory olfactory bulb 151
AON Anterior olfactory nucleus 159
TT Taenia tecta 589
DP Dorsal peduncular area 814
PiriformA Piriform area 961
NLOT Nucleus of the lateral olfactory tract 619
COA Cortical amygdalar area 631
PAA Piriform-amygdalar area 788
TR Postpiriform transition area 566

Hippocampal Formation (8 regions)

Abbreviation Full Name ABA ID
lEnt Lateral entorhinal area 918
mEnt Medial entorhinal area 926
PAR Parasubiculum 843
POST Postsubiculum 1037
PRE Presubiculum 1084
SUB Subiculum 502
ProS Prosubiculum 1351
EP Endopiriform nucleus 942

Amygdala & Striatum (15 regions)

Abbreviation Full Name ABA ID
LA Lateral amygdalar nucleus 131
BLA Basolateral amygdalar nucleus 295
BMA Basomedial amygdalar nucleus 319
PA Posterior amygdalar nucleus 780
CeA Central amygdala nucleus 536
MeA Medial amygdalar nucleus 403
Cl Claustrum 583
CPu Caudoputamen 672
NAc Nucleus accumbens 56
LS Lateral septal nucleus 242
MS Medial septal nucleus 564
GPe Globus pallidus, external segment 1022
GPi Globus pallidus, internal segment 1031
vPAL Ventral pallidum 835
OT Olfactory tubercle 754

Hippocampus (4 regions)

Abbreviation Full Name ABA ID
CA1 Field CA1 382
CA2 Field CA2 423
CA3 Field CA3 463
DG Dentate gyrus 726

Thalamus (20 regions)

Abbreviation Full Name ABA ID
VAL Ventral anterior-lateral complex 629
VM Ventral medial nucleus 685
VP Ventral posterior complex 709
PP Peripeduncular nucleus 1044
MG Medial geniculate complex 475
dLG Dorsal lateral geniculate complex 170
vLG Ventral lateral geniculate complex 178
AM Anteromedial nucleus 127
AD Anterodorsal nucleus 64
lAM Interanteromedial nucleus 1120
dAM Interanterodorsal nucleus 1113
LD Lateral dorsal nucleus 155
MD Mediodorsal nucleus 362
STM Submedial nucleus 366
PVT Paraventricular thalamus 149
RT Reticular nucleus 262
LAT Lateral group of the dorsal thalamus 138
MTN Midline group 571
ILM Intralaminar nuclei 51
EPI Epithalamus 958

Hypothalamus (9 regions)

Abbreviation Full Name ABA ID
PVH Paraventricular hypothalamic nucleus 38
PeriV Periventricular hypothalamic nucleus 286
DMH Dorsomedial nucleus 830
AHN Anterior hypothalamic nucleus 88
MBO Mammillary body 331
TM Tuberomammillary nucleus 557
MPN Medial preoptic nucleus 515
PM Premammillary nucleus 263
VMH Ventromedial hypothalamic nucleus 693

Note: PVT (Paraventricular thalamus, ID=149) appears in the label file adjacent to hypothalamus entries but is anatomically a thalamic midline nucleus. In the label file it is listed at line 114 between the thalamus and hypothalamus sections.

Midbrain & Brainstem (21 regions)

Abbreviation Full Name ABA ID
DRN Dorsal raphe nucleus 872
MRN Median raphe nucleus 679
VTA Ventral tegmental area 749
MHb Medial habenula 483
LHb Lateral habenula 186
SNr Substantia nigra, reticular part 381
SNc Substantia nigra, compact part 374
sSC Sensory-related superior colliculus 302
mSC Motor-related superior colliculus 298
IC Inferior colliculus 4
midRN Midbrain reticular nucleus 128
PAG Periaqueductal gray 795
PRT Pretectal region 1100
LR Linear raphe nucleus 197
NLL Nucleus of the lateral lemniscus 617
lPB Lateral parabrachial nucleus 881
mPB Medial parabrachial nucleus 890
SOC Superior olivary complex 398
aBST Anterior bed nuclei of stria terminalis 359
pBST Posterior bed nuclei of stria terminalis 367
SPF Subparafascicular nucleus 406

Hindbrain (14 regions)

Abbreviation Full Name ABA ID
motP Motor-related pons 987
CN Cochlear nuclei 607
DCN Dorsal column nuclei 720
NTS Nucleus of the solitary tract 651
SPVC Caudal spinal nucleus of the trigeminal 429
AMB Nucleus ambiguus 135
LRN Lateral reticular nucleus 235
MDRN Medullary reticular nucleus 395
PGRN Paragigantocellular reticular nucleus 938
PHY Perihypoglossal nuclei 154
PPY Parapyramidal nucleus 1069
VNC Vestibular nuclei 701
RNMO Raphe nuclei of medulla oblongata 379

Cerebellum (18 regions)

Abbreviation Full Name ABA ID
LING Lingula (I) 912
CENT2 Lobule II 976
CENT3 Lobule III 984
CUL4 Lobule IV 992
CUL5 Lobule V 1001
CUL4-5 Lobule IV-V 1091
DEC Declive (VI) 936
FOTU Folium-tuber vermis (VII) 944
PYR Pyramus (VIII) 951
UVU Uvula (IX) 957
NOD Nodulus (X) 968
SIM Simple lobule 1007
ANcr1 Crus 1 1056
ANcr2 Crus 2 1064
PRM Paramedian lobule 1025
COPY Copula pyramidis 1033
PFL Paraflocculus 1041
FL Flocculus 1049

Fiber Tracts & Other Structures (20 regions)

Abbreviation Full Name ABA ID
CBX Cerebellar cortex 1144
CBN Cerebellar nuclei 519
lotg Lateral olfactory tract 21
lln Optic nerve 848
llln Oculomotor nerve 832
sV Sensory root of trigeminal nerve 229
Vlln Facial nerve 798
Vllln Cochlear nerve 933
cett Cervicothalamic tract 932
sst Spinothalamic tract 871
scp Superior cerebellar peduncle 326
icp Inferior cerebellar peduncle 1123
corpus-callosum Corpus callosum 776
cst Corticospinal tract 784
lfbst Thalamus-related fibers 896
eps Extrapyramidal fiber systems 1000
mfbs Medial forebrain bundle system 991
VS Ventricular systems 73
grv (1032) Grooves of the cerebral cortex 1032
grv (1040) Grooves of the cerebellar cortex 1040

MATLAB Scripts

doAllROIextract.m — Batch ROI Extraction

Extracts multiple ROIs from a normalized atlas volume based on the label definitions.

Inputs:

Parameter Description
roipath Path to label file (e.g., newLabel.txt)
datapath Path to normalized atlas NIfTI file
filename Output filename for the new atlas
type Output mode: 1 = preserve original ABA IDs, 2 = assign sequential IDs

Usage:

roipath = 'newLabel.txt';
datapath = 'NormalizedAnno2.nii';
filename = 'newAtlas_roi.nii';

% Type 1: Keep original ABA IDs as voxel values
doAllROIextract(roipath, datapath, filename, 1);

% Type 2: Assign sequential IDs (1, 2, 3, ...) for each region
doAllROIextract(roipath, datapath, filename, 2);

Behavior:

  1. Reads the label file as a CSV table using readtable(roipath, 'Delimiter', ',')
  2. Loads the normalized annotation NIfTI volume using load_untouch_nii(datapath)
  3. For each row in the label file, finds voxels matching the primary ID column value
  4. Creates a new volume with either the original IDs (type=1) or sequential row indices (type=2)
  5. Saves the resulting atlas as a NIfTI file

Note: The in-code docstring example (roipath = '~/ABA_ROI.nii') is misleading — roipath should point to the text label file, not a NIfTI file. The usage example above is correct.

Note on type=2: When using sequential IDs, the ROI ID assigned is the row number in the label file (1-indexed). If duplicate entries exist in the label file (e.g., OT, ILM, MTN), the later entry overwrites the earlier one.

doOneROIExtract.m — Single ROI Extraction

Extracts a single brain region as a binary mask from an atlas volume.

Inputs:

Parameter Description
AtlasData Path to atlas NIfTI file
ROIid ABA structure ID to extract
filename Output filename for the binary mask

Usage:

% Extract the paraventricular thalamus (PVT, ID=149) as a binary mask
doOneROIExtract('newAtlas_roi.nii', 149, 'PVT.nii');

% Extract the dorsal raphe nucleus (DRN, ID=872)
doOneROIExtract('newAtlas_roi.nii', 872, 'DRN.nii');

Behavior:

  1. Loads the atlas NIfTI file
  2. Creates a binary mask where voxels matching ROIid are set to 1
  3. Saves the mask as a NIfTI file preserving the original voxel structure

Workflow

                    Allen Brain Atlas
                          │
                          ▼
              ┌──────────────────────┐
              │  Normalization        │
              │  (AllenAtlasNorm.r)  │
              └──────────────────────┘
                          │
                          ▼
              NormalizedAnno2.nii
                          │
                          ▼
              ┌──────────────────────┐
              │  doAllROIextract.m   │◄── newLabel.txt
              │  (batch extraction)   │
              └──────────────────────┘
                          │
                          ▼
              newAtlas_roi.nii
                          │
                          ▼
              ┌──────────────────────┐
              │  doOneROIExtract.m   │
              │  (single ROI mask)    │
              └──────────────────────┘
                          │
                          ▼
              Individual ROI masks
              (e.g., PVT.nii, DRN.nii)
                          │
                          ▼
              ┌──────────────────────┐
              │  fMRI ROI Analysis   │
              │  (extGroupTSROI.m)   │
              └──────────────────────┘

Data Availability

The NIfTI files in this directory (ABA_ROI.nii, atlas.nii, newAtlas_roi.nii, newatlas.nii, NormalizedAnno2.nii, PVT.nii) are not tracked in the git repository due to their size (~11 MB each). The scripts and label files are available in the repository.

To obtain the NIfTI data files, please contact Hiro Taiyo Hamada (hiroaki.hamada@oist.jp).

Relationship to Other Modules

References