Skip to content

sina-mansour/normative_brain_charts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

67 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Spectral Normative Modeling of Brain Structure

Spectral Normative Modeling

medRxiv preprint SpectraNorm PyPI License

This repository provides the complete, reproducible analysis code accompanying the manuscript:

Mansour L., S., et al. (2025). Spectral Normative Modeling of Brain Structure. medRxiv. DOI: 10.1101/2025.01.16.25320639

The study introduces Spectral Normative Models (SNMs) β€” a framework for normative modeling of high-dimensional cortical phenotypes using spectral (eigenmode-based) representations. The repository contains every step of the analysis pipeline, from raw data preprocessing through model fitting, performance evaluation, and clinical application, enabling full reproduction of all manuscript figures and results.


🧰 SpectraNorm Package

The analysis code in this repository is built on top of SpectraNorm β€” a dedicated Python package we developed to facilitate the implementation of conventional and spectral normative models.

SpectraNorm Docs PyPI

pip install spectranorm --upgrade

For tutorials, API reference, and further documentation, visit the SpectraNorm documentation site.


πŸ“ Repository Structure

The analysis is organized into 9 sequential stages, each corresponding to a directory of Jupyter notebooks:

Imports and preprocesses cortical thickness data from several large-scale neuroimaging datasets, comprising over 78,000 healthy brains from 30 different datasets. Includes:

  • Applying exclusion criteria to ensure data quality and consistency
  • Processing cortical thickness maps and transforming them to fs_LR 32k surface space
  • Preparing data for downstream analysis

Aggregates and prepares the cleaned data for normative modeling. Includes:

  • Combining cleaned data from multiple datasets
  • Final round of quality control
  • Random train/test split for model validation
  • Generating spectral coefficients of cortical thickness from vertex-wise data

Specifies a direct normative modeling architecture as a backbone for the spectral model. Includes:

  • Implementing a Hierarchical Bayesian Regression normative model (via PyMC)
  • Fitting the model for a single variable (mean cortical thickness) as a function of age, sex, and site β€” used as a sanity check
  • This architecture is reused in subsequent notebooks for both direct and spectral implementations

Generates the spectral basis functions (connectome eigenmodes) used to encode high-resolution cortical phenotypes. Includes:

  • Computing connectome-based brain eigenmodes via SVD of a random walk graph Laplacian shift operator

Fits the full Spectral Normative Model (SNM) using the spectral coefficients of cortical thickness. Includes:

  • Fitting the Spectral Normative Model (SNM)
  • Verifying the generation of normative ranges
  • Saving the fitted model for subsequent evaluation

Evaluates SNM performance and benchmarks it against the direct normative model. Includes:

  • Evaluating accuracy across varying numbers of modes and spatial granularities
  • Comparing SNM and direct model performance
  • Reproducing comparative figures from the manuscript

Uses the fitted SNM to investigate cortical growth gradients across the lifespan. Includes:

  • Mapping three distinct cortical growth gradients
  • Comparing growth gradients to known cortical organization hierarchies
  • Characterizing lifespan trajectories of change

Applies the fitted SNM to a clinical Alzheimer's Disease (AD) sample. Includes:

  • Loading data from the MACC Harmonization dataset
  • Fine-tuning the healthy SNM via normative adaptation (site harmonization)
  • Mapping individual deviations from the normative model
  • Characterizing the normative signature of AD-related cortical atrophy

Shares the data produced in this manuscript. Includes:

  • A pretrained SNM for cortical thickness
  • Normative brain charts for multiple cortical parcellations

🎨 Explore an interactive visualization of the pretrained SNM1000 vertex resolution charts


πŸ—„οΈ Pretrained Model

The pretrained SNM1000 model is available as a release asset:

GitHub Release

Download and decompress:

wget https://github.com/sina-mansour/normative_brain_charts/releases/download/v1.0/pretrained_SNM_1000_V1.0.tar.gz
tar -xzvf pretrained_SNM_1000_V1.0.tar.gz

Load the model in Python:

from spectranorm import snm

snm_1000 = snm.SpectralNormativeModel.load_model(
    "/<path-to-extracted-directory>/pretrained_SNM_1000_V1.0/"
)

For usage examples, refer to Notebooks 07–09 and the SpectraNorm tutorials.

πŸ“Š Provided Normative Charts

Using the pretrained SNM1000 model (trained on >78,000 healthy brains), we derived cortical thickness normative trajectories across 50 parcellation schemes covering 23,242 cortical regions in total. Charts are provided separately for males, females, and the combined sample.

Each item in the table below links to the associated CSV file included in the current release.

Atlas Combined Female Male
Desikan-Killiany (aparc) πŸ“„ πŸ“„ πŸ“„
Destrieux (aparc.a2009s) πŸ“„ πŸ“„ πŸ“„
DKT (aparc.DKTatlas40) πŸ“„ πŸ“„ πŸ“„
Von Economo-Koskinas πŸ“„ πŸ“„ πŸ“„
Gordon 333 πŸ“„ πŸ“„ πŸ“„
HCP MMP 1.0 (Glasser) πŸ“„ πŸ“„ πŸ“„
Yeo 7 Networks (N1000) πŸ“„ πŸ“„ πŸ“„
Yeo 7 Networks (split components) πŸ“„ πŸ“„ πŸ“„
Yeo 17 Networks (N1000) πŸ“„ πŸ“„ πŸ“„
Yeo 17 Networks (split components) πŸ“„ πŸ“„ πŸ“„
Schaefer 100 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 100 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 200 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 200 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 300 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 300 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 400 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 400 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 500 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 500 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 600 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 600 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 700 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 700 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 800 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 800 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 900 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 900 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 1000 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Schaefer 1000 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 100 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 100 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 200 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 200 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 300 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 300 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 400 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 400 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 500 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 500 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 600 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 600 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 700 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 700 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 800 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 800 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 900 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 900 (17 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 1000 (7 Networks) πŸ“„ πŸ“„ πŸ“„
Yan 1000 (17 Networks) πŸ“„ πŸ“„ πŸ“„

Vertex-Wise Normative Charts

In addition to the parcellation-based charts, we also provide normative trajectories at the full vertex resolution of the fs_LR 32k surface mesh (~32,000 vertices per hemisphere).

Resolution Combined Female Male
Vertex-wise (fs_LR 32k) πŸ“„ πŸ“„ πŸ“„

These are stored as .joblib files and can be loaded directly into Python.

import joblib

# Load the normative trajectories
vertex_charts = joblib.load("/<path-to-file>/vertex-wise.fs_LR_32k.normative_trajectories.joblib")

πŸ—ΊοΈ Cortical Maps

The cortical maps derived in this study are publicly available in the data/brainmaps/ directory. Each map is provided in both .dscalar.nii (CIFTI) and .npy (NumPy) formats.

Map CIFTI NumPy
First Thickness Growth Gradient πŸ“„ πŸ“„
Second Thickness Growth Gradient πŸ“„ πŸ“„
Third Thickness Growth Gradient πŸ“„ πŸ“„
Developmental Cortical Pruning πŸ“„ πŸ“„
Aging Thickness Decline πŸ“„ πŸ“„

The .dscalar.nii files can be visualized directly in Connectome Workbench, while the .npy files can be loaded in Python via numpy.load().


πŸ“„ License

This repository is dual licensed:

  • Non-commercial / Academic use: GNU AGPLv3
  • Commercial use: A separate commercial license is required

See the LICENSE file for full details.


πŸ“¬ Contact

If you have questions, encounter issues, or would like to collaborate, feel free to reach out:

Contact

About

A repository hosting codes used for normative models of brain development.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors