This repository implements a full computational pipeline for diffusion MRI (dMRI) microstructure modelling, covering:
- Non-linear parameter estimation and whole-brain mapping of the ball-and-stick model
- Multi-start global optimisation with physics-informed constraint encoding via surrogate reparameterisation
- Uncertainty quantification via the classical bootstrap and Markov Chain Monte Carlo (MCMC, Metropolis-Hastings)
- Model selection across a hierarchy of two-compartment models using AIC and BIC information criteria, applied to the ISBI 2015 white matter benchmark dataset
All numerical experiments are reproducible from publicly available data. The codebase is written in MATLAB and is structured for clarity, modularity, and scientific correctness.
This repository is accompanied by a scientific report describing the modelling framework, optimisation procedures, uncertainty quantification, and model selection experiments.
Report: docs/report.pdf
Diffusion-weighted MRI encodes tissue microstructure through the attenuation of the MR signal by the self-diffusion of water molecules. The measured signal at b-value
where
| Model | Free Parameters | ||
|---|---|---|---|
| Diffusion Tensor (DT) | — | 7 | |
| Ball-and-Stick (BS) | 5 | ||
| Zeppelin-and-Stick (ZS) | 6 | ||
| Zeppelin-Stick-Tortuosity (ZST) | 5 |
The fibre direction is parameterised in spherical coordinates:
Physical constraints (
| Physical | Surrogate | Mapping |
|---|---|---|
Models are ranked using the Akaike Information Criterion (AIC) and Bayesian Information Criterion (BIC):
where
| Method | RESNORM | RESNORM / Expected | ||
|---|---|---|---|---|
| Unconstrained (fminunc) | 7.08 | — | — | |
| Constrained (transform) | 1.36 | 0.61 | 4 | |
| DT-informed start (M2) | 1.36 | 0.79 | 2 |
Best-fit parameters:
| Method |
|
|
|
|---|---|---|---|
| Bootstrap (T=1000) | |||
| MCMC (N=18,000) |
| Model | RESNORM | AIC | BIC | Rank | |
|---|---|---|---|---|---|
| Diffusion Tensor | 7 | 223.85 | −10029 | −9980 | 4 |
| Ball-and-Stick | 5 | 15.11 | −19771 | −19734 | 3 |
| Zeppelin-and-Stick | 6 | 10.82 | −20975 | −20932 | 1 |
| Zeppelin-Stick-Tortuosity | 5 | 11.61 | −20723 | −20686 | 2 |
The Zeppelin-and-Stick model is selected by both AIC and BIC, indicating that anisotropic extra-cellular diffusion is a statistically justified addition. The tortuosity constraint imposes
diffusion-mri-microstructure/
│
├── README.md
│
├── data/
│ └── README.md # Data download instructions
│
├── src/
│ ├── models/
│ │ ├── ball_stick_ssd.m # Unconstrained SSD objective
│ │ ├── ball_stick_ssd_constrained.m # Constrained SSD (surrogate space)
│ │ ├── ball_stick_residuals.m # Residual vector (LM-compatible)
│ │ ├── zeppelin_stick_residuals.m # Zeppelin-and-Stick residuals
│ │ └── zeppelin_stick_tort_residuals.m # ZS + tortuosity residuals
│ │
│ ├── optimisation/
│ │ ├── multistart_fit.m # Multi-start LM optimisation engine
│ │ └── constraint_transforms.m # Surrogate ↔ physical transforms
│ │
│ ├── uncertainty/
│ │ ├── bootstrap_uncertainty.m # Classical bootstrap (Algorithm 5.1)
│ │ └── mcmc_sampler.m # Metropolis-Hastings MCMC
│ │
│ ├── mapping/
│ │ └── parameter_map_slice.m # Whole-slice parameter mapping
│ │
│ ├── model_selection/
│ │ └── compute_information_criteria.m # AIC, BIC, Akaike weights
│ │
│ └── utils/
│ ├── load_hcp_data.m # Load HCP dMRI data + bvecs
│ ├── load_isbi_data.m # Load ISBI 2015 protocol + data
│ ├── diffusion_tensor_fit.m # Weighted linear DT estimation
│ ├── compute_brain_mask.m # Intensity-threshold brain mask
│ └── plot_model_fit.m # Data vs model visualisation
│
└── scripts/
├── run_section1_parameter_estimation.m
├── run_section2_uncertainty_estimation.m
└── run_section3_model_selection.m
- MATLAB R2019b or later (Optimization Toolbox required for
fminunc,fmincon,lsqnonlin) - No additional toolboxes required for core fitting
Section 1 & 2 — Human Connectome Project (HCP) data:
https://www.dropbox.com/s/q6qeump8knlaav2/data_p1.zip
Extract into data/. Expected files: data.mat, bvecs.
Section 3 — ISBI 2015 white matter benchmark:
Available from the ISBI 2015 challenge supplementary materials (Ferizi et al., 2017).
Expected files: isbi2015_data_normalised.txt, isbi2015_protocol.txt — place in data/.
Add the source tree to your MATLAB path:
addpath(genpath('src'));Then run each section:
run('scripts/run_section1_parameter_estimation.m')
run('scripts/run_section2_uncertainty_estimation.m')
run('scripts/run_section3_model_selection.m')The probability of identifying the global minimum in a single random-start run is estimated empirically as:
The minimum number of runs required to find the global minimum with probability
The classical (non-parametric) bootstrap resamples the
The posterior
If you use this code in your research, please cite:
@misc{tyriard2026dmri,
author = {Tyriard, Camille},
title = {Diffusion MRI Microstructure Modelling},
year = {2026},
publisher = {GitHub},
url = {https://github.com/camille-tyriard/diffusion-mri-microstructure-modelling}
}