---
license: odc-by
language:
- en
task_categories:
- image-classification
tags:
- medical
- brain-data
- mri
pretty_name: 3D Brain Structure MRI Scans
---
## π§ Dataset Summary
3794 3D structural MRI brain scans (T1-weighted MPRAGE NIfTI files) from 2607 individuals included in five publicly available datasets: [DLBS](https://fcon_1000.projects.nitrc.org/indi/retro/dlbs.html), [IXI](https://brain-development.org/ixi-dataset/), [NKI-RS](https://fcon_1000.projects.nitrc.org/indi/enhanced/sharing_neuro.html), [OASIS-1](https://sites.wustl.edu/oasisbrains/home/oasis-1/), and [OASIS-2](https://sites.wustl.edu/oasisbrains/home/oasis-2/). Subjects have a mean age of 45 Β± 24. 3773 scans come from cognitively normal individuals and 261 scans from individuals with an Alzheimer's disease clinical diagnosis. Scans dimensions are 113x137x113, 1.5mm^3 resolution, aligned to MNI152 space (see methods).
Scans have been processed and all protected health information (PHI) is excluded. Only the skull-stripped scan, integer age, biological sex, clinical diagnosis, and scan metadata are included. [Radiata](https://radiata.ai/) compiles and processes publicly available neuroimaging datasets to create this open, unified, and harmonized dataset. For more information see https://radiata.ai/public-studies. Example uses including developing foundation-like models or tailored models for brain age prediction and disease classification.
# License
The use of the dataset as a whole is licensed under the ODC-By v1.0 license. Individual scans are licensed under study-specific data use agreements:
IXI - [CC BY-SA 3.0](https://brain-development.org/ixi-dataset/)
DLBS - [CC BY-NC 4.0](https://fcon_1000.projects.nitrc.org/indi/retro/dlbs.html)
NKI-RS - [Custom DUA](https://fcon_1000.projects.nitrc.org/indi/enhanced/sharing.html)
OASIS-1 - [Custom DUA](https://sites.wustl.edu/oasisbrains/)
OASIS-2 - [Custom DUA](https://sites.wustl.edu/oasisbrains/)
The metadata provide the license for each object.
# Sample images
Age 18 F, NKI-RS
Cognitively normal
|
Age 71 M, OASIS-1
Alzheimer's disease
|
Age 46 F, IXI
Cognitively normal
|
Age 86 M, OASIS-2
Cognitively normal
|
# Subject characteristics table
| Split | n (scans) | n (subjects) | age_mean | age_std | age_range | sex_counts | diagnosis_counts | study_counts |
|-------|-----------|--------------|-----------|-----------|-------------|--------------------------------|--------------------------|----------------------------------------------------------------------------|
| train | 3066 | 2085 | 45.1 | 24.5 | (6, 98) | {'female': 1827, 'male': 1239} | {'CN': 2847, 'AD': 219} | {'NKI-RS': 1854, 'OASIS-1': 340, 'IXI': 326, 'OASIS-2': 296, 'DLBS': 250} |
| validation | 364 | 261 | 46.4 | 24.5 | (6, 90) | {'female': 225, 'male': 139} | {'CN': 339, 'AD': 25} | {'NKI-RS': 213, 'IXI': 43, 'OASIS-1': 38, 'OASIS-2': 38, 'DLBS': 32} |
| test | 364 | 261 | 45.7 | 24.6 | (6, 93) | {'female': 210, 'male': 154} | {'CN': 343, 'AD': 21} | {'NKI-RS': 216, 'IXI': 40, 'OASIS-2': 39, 'OASIS-1': 36, 'DLBS': 33} |
# Folder organization
```bash
brain-structure/
ββ brain-structure.py
ββ metadata.csv
ββ IXI/
β ββ sub-002/
β β ββ ses-01/
β β ββ anat/
β β ββ msub-002_ses-01_T1w_brain_affine_mni.nii.gz
β β ββ msub-002_ses-01_scandata.json
β ββ ...
ββ DLBS/
β ββ ...
ββ ...
```
# Example usage
```
# install Hugging Face Datasets library
pip install datasets
```
```
# load datasets
from datasets import load_dataset
ds_train = load_dataset("radiata-ai/brain-structure", name="all", split="train", trust_remote_code=True)
ds_val = load_dataset("radiata-ai/brain-structure", name="all", split="validation", trust_remote_code=True)
ds_test = load_dataset("radiata-ai/brain-structure", name="all", split="test", trust_remote_code=True)
```
```
# example PyTorch processing of images
import torch
import torch.nn.functional as F
from torch.utils.data import Dataset
import nibabel as nib
class NiiDataset(Dataset):
"""
A PyTorch Dataset that wraps a Hugging Face Dataset containing
MRI .nii.gz file paths, and loads/normalizes/resamples each volume.
"""
def __init__(self, hf_dataset):
"""
hf_dataset: a Hugging Face Dataset object, e.g. ds_train
(each example should have a 'nii_filepath')
"""
self.hf_dataset = hf_dataset
def __len__(self):
return len(self.hf_dataset)
def __getitem__(self, idx):
# Load the dataset example
example = self.hf_dataset[idx]
nii_path = example["nii_filepath"] # e.g., "IXI/sub-017/ses-01/anat/sub-017_ses-01_T1w.nii.gz"
# Load the .nii.gz file with nibabel
cur_t1_file = nib.load(nii_path)
t1_data = cur_t1_file.get_fdata()
# Preprocess: example sub-volume
# (7:105, 8:132, :108) => shape: (98, 124, 108)
t1_data = t1_data[7:105, 8:132, :108]
# Normalize intensities
t1_data = t1_data / t1_data.max()
# Convert to PyTorch tensor, add two channel dims for volumetric interpolation
# shape => (1, 1, 98, 124, 108)
t1_tensor = torch.from_numpy(t1_data).float().unsqueeze(0).unsqueeze(0)
# Downsample/resample to e.g. (96, 96, 96)
img_downsample = F.interpolate(
t1_tensor,
size=(96, 96, 96),
mode="trilinear",
align_corners=False
)
# shape => (1, 96, 96, 96)
# Squeeze out the channel dim if needed: shape => (96, 96, 96)
img_downsample = img_downsample.squeeze(0)
sample = {"img": img_downsample}
return sample
```
# Study descriptions
- IXI: A dataset of nearly 600 MR images from normal, healthy subjects, including T1, T2, PD-weighted, MRA, and diffusion-weighted images collected at three different hospitals in London.
Citation: IXI data was obtained from https://brain-development.org/ixi-dataset/
- DLBS: A dataset from the Dallas Lifespan Brain Study (DLBS) comprising structural MRI, DTI, functional MRI, resting-state fMRI, and amyloid PET scans from 350 healthy adults aged 20-89, including extensive cognitive testing and demographic information.
Citation: DLBS data was obtained from the International Neuroimaging Data-sharing Initiative (INDI) database.
- NKI-RS: A large-scale ongoing neuroimaging dataset (N > 1000) across the lifespan from a community sample, including structural and functional MRI scans such as MPRAGE, DTI, resting-state fMRI, and task-based fMRI.
Citation: NKI-RS data was obtained from Rockland Sample Neuroimaging Data Release.
- OASIS-1: Cross-sectional T1-weighted MRI data from 416 right-handed subjects aged 18 to 96, including 100 over 60 with very mild to moderate Alzheimerβs disease, each with 3 or 4 scans.
Citation: OASIS-1: Cross-Sectional: https://doi.org/10.1162/jocn.2007.19.9.1498
- OASIS-2: A longitudinal MRI dataset of 150 right-handed individuals aged 60-96, with 373 imaging sessions including T1-weighted MRIs, featuring nondemented and demented older adults, including patients with Alzheimerβs disease.
Citation: OASIS-2: Longitudinal: https://doi.org/10.1162/jocn.2009.21407
# Methods
## Image processing
T1-weighted structural MRI scans were processed with [CAT12](https://neuro-jena.github.io/cat12-help/) ([Gaser et al, 2024](https://academic.oup.com/gigascience/article/doi/10.1093/gigascience/giae049/7727520)). The image processing steps were:
- correct for bias, noise, and intensity
- mask to brain-only (gray matter + white matter + CSF)
- register to ICBM 2009c Nonlinear Asymmetric space (MNI152NLin2009cAsym 1.5mm^3) using linear affine registration with 12 degrees of freedom in [FSL FLIRT](https://fsl.fmrib.ox.ac.uk/fsl/docs/#/registration/flirt/index) ('flirt -in t1.nii.gz -ref mni_icbm152_t1_tal_nlin_asym_09c_brain_1_5_mm.nii.gz -dof 12 -noresampblur').
The goal was to get denoised, unsmoothed scans that were maximally aligned to standard space while preserving individual anatomy.
Metadata includes the total intracranial volume (TIV), image quality rating (IQR; larger value = worse quality), MRI scanner manufacturer/model, and field strength.
## Train/validation/test partitioning
Scans were partitioned into train/validation/test datasets with a 80%/10%/10% split. Splits were balanced for age, sex, clinical diagnosis, and study. Subjects with multiple scans only appear in one split.
# Citation
```
@dataset{Radiata-Brain-Structure,
author = {Jesse Brown and Clayton Young},
title = {Brain-Structure: A Collection of Processed Structural MRI Scans},
year = {2025},
url = {https://huggingface.co/datasets/radiata-ai/brain-structure},
note = {Version 1.0},
publisher = {Hugging Face}
}
```