Acerca de
Toolbox for parameter estimation of the Standard Model of diffusion in white matter
IA y aprendizaje automáticoCrecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- Recopilando historial
- in 15 days
- Recopilando historial
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalStandard Model Imaging (SMI) toolbox
[!IMPORTANT] Maintenance notice: This MATLAB version will no longer be maintained after December 31, 2026. We recommend using the Python implementation of SMI in TMI, part of DESIGNER-v2. DESIGNER-v2, including TMI, is also available as a Docker image; see the Docker installation instructions.
This MATLAB toolbox contains all necessary functions for parameter estimation of the Standard Model (SM) of diffusion in white matter[^note]. Check our recent paper for details on this implementation and on the Standard Model in general. Below we provide instructions on how to run the toolbox. See the 'example.m' script that performs the parameter estimation in an example dataset.
The options and defaults below describe this MATLAB toolbox.
Overview: The Standard Model of diffusion in white matter
Over the last 15-20 years, multiple approaches aimed to model the physics of water diffusion in white matter have relied on similar assumptions. This led to the unifying framework dubbed Standard Model (SM) of diffusion in WM as formulated in (Novikov et al., 2018)[^2]. In a nutshell, this model disentangles signal contributions from different structures, i.e. compartments, present in a white matter voxel.

Briefly, axons (and possibly glial processes) are represented by impermeable zero-radius cylinders (the so-called “sticks”) arranged in locally coherent fiber fascicles. The diffusion in the extra-axonal space of each fascicle is assumed to be Gaussian and described by an axially symmetric diffusion tensor. The third, optional tissue compartment is the cerebro-spinal fluid. Such multicomponent fascicles (also called kernel) are distributed in a voxel according to an arbitrary fiber orientation distribution function (ODF). All fascicles in a voxel are assumed to have the same compartment fractions and diffusivities, and differ from each other only by orientation.
The SM encompasses a number of WM models made of anisotropic Gaussian compartments with axons represented by sticks (Kroenke et al., 2004; Jespersen et al., 2007, 2010; Fieremans et al., 2011; Zhang et al., 2012; Sotiropoulos et al., 2012; Jensen et al., 2016; Jelescu et al., 2016a; Kaden et al., 2016; Reisert et al., 2017; Novikov et al., 2018; Veraart et al., 2018, to mention a few). From the SM point of view, earlier models impose constraints either on compartment parameters or the functional form of the fiber ODF; such constraints improve robustness but may introduce biases into the estimation of remaining parameters.
For more details please look at our recent publication: Reproducibility of the Standard Model of diffusion in white matter on clinical MRI systems, Volume 257, 15 August 2022, 119290, (2022), NeuroImage, or Section 3 in this review by Novikov et al. (2019).
Assumptions in a nutshell
- Sufficient coarse-graining for Gaussian diffusion at the fiber bundle level (thus, no time-dependence)
- All fiber bundles inside a voxel have the same microstructural properties
- Negligible water exchange between compartments in a bundle
- No assumptions on the fibre bundle's diffusivities
- No assumptions on the functional form of the ODF
Note that this model does not apply to gray matter, where exchange and the presence of soma cannot be ignored.
SMI input data
Minimal requirements for linear tensor encoding (LTE)
- This implementation of the SM supports as input a 4D array [nx x ny x nz x N] of diffusion-weighted data, meaning a 3D spatial arrangement of voxels with N diffusion measurements arranged along 4th dimention.
- Protocol files (FSL format) are needed: a b-value (.bval) file, a [1 x N] vector, and a directions file (.bvec), a [3 x N] array.
- A noise standard deviation map (
options.sigma) is optional but strongly recommended. It must be a 3D array of size [nx x ny x nz] in the same signal units as the diffusion data. It can be estimated using MPPCA. If omitted or empty, SMI estimates it from repeated low-b images as described under Recommended usage.
On the b-value units: We recommend microstructural units [milliseconds / (squared micrometers)]. Note that typical scanner units are b=1000 [seconds / (squared millimeters)] which equal 1 [milliseconds / (squared micrometers)], thus to convert from scanner units to microstructural units one should divide by 1000.
Data with non-LTE encodings and variable echo times (TE)
Input data can also have:
- Multiple B-tensor shapes (specified by β). This input must be a [1 x N] vector. Only axially symmetric b-tensors are supported. β is a unitless scalar between -0.5 and 1 that indicates the B-tensor shape (see figure below).
- Multiple echo times (TE, assumed to be in [milliseconds]). This input must be a [1 x N] vector.
In this general scenario, each measurement is thus fully specified by: a b-value (b), a unit direction (u) (axis of symmetry of B), a b-tensor shape (β), and TE. See the figure and equation below to understand how these parameters make a b-tensor B:
- If no β is supplied (this input can be absent or an empty array) the code assumes β=1 (linear tensor encoding, LTE, measurements).
- If no TE is supplied (this input can be absent or an empty array), the code assumes that the TE is the same across all measurements. In this case compartmental T2 values will not be outputted and water fractions will be T2-weighted.
SMI outputs
Standard Model parameters (diffusion) + compartmental T2 values (only if multiple TE data was provided). See figure below for some examples:

- Fractions (f, fw) and anisotropy (p2,p4) are adimensional.
- Diffusivities are returned in microstructural units [squared micrometers / milliseconds] (independently of input units).
- Compartmental T2 values are returned in [milliseconds].
- Note that compartmental T2 maps will only be outputed if variable TE data was used.
- Rotational invariants for each diffusion shell will also be an output. To normalize them and remove T2 contrast, simply divide by b0 for fixed TE data or by proton density for variable TE data.
Recommended usage
We recommend using the default options but the code provides users with some flexibility. Recommended inputs:
- Diffusion data (4D array) + protocol information + mask (binary 3D array) + noise map (3D array).
- If a mask is not provided the fit will be performed in all voxels present in the first 3 dimensions of the 4D array.
- If
options.sigmais omitted or empty, SMI estimates the noise using a patch-based estimator followed by spatial smoothing on repeated low-b images (b < 0.1 ms/um^2, equivalent to100 s/mm^2). When TE is supplied, only images at the shortest TE are used. This fallback is not recommended; provide a noise map if suitable repetitions are unavailable. - We recommend preprocessing your raw data with DESIGNER before doing SM estimation. DESIGNER outputs a robust noise estimation, otherwise MPPCA can be used to robustly estimate the noise level.
MATLAB defaults
| Setting | Default |
|---|---|
options.compartments |
{'IAS','EAS'}; add 'FW' explicitly to fit free water |
| Training prior | Saved TMI Gaussian prior: SMI_Gaussian_noFWPrior.mat for IAS + EAS, or SMI_Gaussian_wFWPrior.mat when FW is enabled |
| Training samples | 100,000 for both fixed and variable TE, taken directly from the selected file |
options.sigma |
Optional, with fallback estimation as described above |
When options.MLTraining is absent, SMI loads the saved Gaussian training distribution from the priors folder alongside SMI.m, independently of the current working directory. Keep this folder with the toolbox. These are the same files used by the Python TMI command-line tool, with columns [f, Da, Depar, Deperp, fw, T2a, T2e, p2, p4]. The noFW file has fw = 0. The T2 columns are retained: when TE is omitted or empty, no relaxation weighting is applied; when TE is supplied, including a constant TE, the training signals include the stored T2 values. T2 maps are output only for variable TE. Fixed TE includes an omitted or empty options.TE, or a single unique TE across measurements.
The saved priors support options.RotInv_Lmax values 0, 2, and 4. To use order 6, supply custom training bounds or a custom prior containing p6. The files are loaded as stored to reproduce TMI's training distribution. In particular, the Gaussian FW prior is not restricted to fw <= 0.2; see saved prior files and contents for details of the saved samples.
To reproduce the former bounded-uniform default, explicitly set:
% Columns: [f, Da, Depar, Deperp, fw, T2a, T2e, p2]
options.MLTraining.bounds = [0.05, 1, 1, 0.1, 0, 50, 50, 0.05; ...
0.95, 3, 3, 1.2, 0.2, 150, 120, 0.99];
Setting options.MLTraining.bounds selects uniform sampling instead of the saved Gaussian prior. In this mode, options.MLTraining.Ntraining defaults to 100,000 for fixed TE and 200,000 for variable TE, and can be overridden. Fractions are sampled jointly subject to f + fw < 1, before fw is set to zero for an IAS + EAS fit; changing the uniform fw bounds can therefore also change the sampled f distribution. These bounds do not describe the saved Gaussian prior. Existing custom sampled priors remain supported via options.MLTraining.prior with options.MLTraining.bounds = NaN; the saved nine-column arrays can be supplied directly for either fixed or variable TE. Legacy fixed-TE arrays with six to eight columns omit T2a and T2e; these columns are inserted with placeholder values. Variable-TE arrays must include the T2 columns.
When FW is enabled, SMI also performs a second fit with wider fraction priors (fw up to 1), using it for voxels whose second-fit fw exceeds options.WM_fw_threshold (default 0.2) or whose primary-fit f exceeds 0.999. The threshold controls which fit is used; it is not a bound on the primary Gaussian prior or the output free-water fraction. The advanced example below and the examples in example.m explicitly select custom uniform priors; omit options.MLTraining to use the Gaussian default.
Example usage[^note]
We provide three example datasets here that were preprocessed with DESIGNER. These contain
- Multiple b-values
- Multiple b-values and tensor shapes
- Multiple b-values, tensor shapes, and echo times.
See the example file 'example.m' with the SMI fit. Note that data is provided in nifti format, we used this nifti toolbox but feel free to use any and modify the lines where the data is loaded.
% =====================================================================
% Minimal usage:
% Add SMI.m to the path, e.g.:
addpath('/Documents/SantiagoCoelho/Git/SMI')
% Load dwi, protocol, and mask
% Specify protocol information
options.b = bval;
options.dirs = dirs;
% Specify mask and noise map
options.mask = logical(mask);
options.sigma = sigma;
% Run SM fitting (dwi is a 4D array)
[out] = SMI.fit(dwi,options);
% =====================================================================
% More advanced usage:
% Add SMI.m to the path, e.g.:
addpath('/Documents/SantiagoCoelho/Git/SMI')
% Load dwi, protocol, and mask
% Specify protocol information
options.b = bval;
options.beta = beta;
options.dirs = dirs;
options.TE = TE;
% Specify mask and noise map
options.mask = logical(mask);
options.sigma = sigma;
% Specify options for the fit
options.compartments = {'IAS','EAS','FW'}; % Explicitly add FW to the IAS + EAS default
options.NoiseBias = 'Rician'; % use 'None' for zero-mean noise
% Select a custom uniform prior instead of the saved Gaussian default
options.MLTraining.bounds = [0.05, 1, 1, 0.1, 0, 50, 50, 0.05; 0.95, 3, 3, 1.2, 0.5, 150, 120, 0.99];
% The order is: [f, Da, Depar, Deperp, fw, T2a, T2e, p2].
% If TE is omitted or empty, the T2 values do not affect training signals.
% Run SM fitting (dwi is a 4D array)
[out] = SMI.fit(dwi,options);
% =====================================================================
Parameter estimation
First, the rotational invariants of the diffusion signal are estimated. This is done using a least squares estimator. If data has a non-negligible rician bias, we suggest to correct it during the fitting (see advanced options below).
Then, the SM parameters are estimated from the rotational invariants of the signal (up to L=4 as default option). Unlike conventional parameter estimation approaches which rely on an analytical forward model, e.g. maximum likelihood, here we use data-driven machine learning (ML) regression. This is done by applying a sufficiently flexible nonlinear regression to training data generated with the forward model of interest, considering a wide distribution of model parameters, the noise level, and the protocol that was used. Then, such regression is applied to the data of interest.
For typical SNR values found in clinical dMRI experiments, the optimal regression, i.e. minimizing MSE of the training data, can be achieved already by a cubic polynomial, as it captures all relevant degrees of freedom in the data represented by the set of rotational invariants.
Prior distributions and parameter sensitivity
The parameter distributions used to generate the training data act as priors in Bayesian estimation. As measurement information decreases, MSE-minimizing estimates rely increasingly on these priors and, in the limit of vanishing information, approach their mean values. This gradual shift toward the prior mean is a well-studied feature of Bayesian estimation (see Gelman et al., Bayesian Data Analysis, 3rd ed., Section 2.5); it is a continuous effect rather than an on/off transition at a particular SNR. This behavior is described analytically for polynomial regressions in Coelho, Fieremans and Novikov, How do we know we measure tissue parameters, not the prior?, ISMRM 2021, abstract 0397. What constitutes low SNR depends on both the experimental acquisition and the parameter or parameter combination being estimated; no single image-SNR threshold applies to all parameters. Changes in some parameter combinations produce signal differences that can be distinguished from noise, whereas others have little effect on the signal and are therefore more strongly influenced by the prior. Conventional two-shell acquisitions (e.g. b = 1000 and 2000 s/mm²) generally constrain the axonal fraction f and fODF anisotropy p2 better than the compartment diffusivities, as discussed by Liao et al. (2024). Diffusivity estimates can thus remain strongly influenced by the prior at conventional SNR levels where f and p2 are robust.
For reduced datasets, such as two-shell acquisitions, narrower, biologically plausible priors may help detect group differences by reducing estimation variance, provided they preserve sensitivity to the differences of interest; see Liao et al. (2024). This reflects a bias-variance trade-off. It is crucial to use the same priors across groups, ensure that they cover plausible values in both groups, and assess the robustness of the findings to prior choices through simulations matched to the acquisition and SNR.
Default training distributions
The default .mat files each contain 100,000 samples. Gaussian draws are
truncated to parameter-specific bounds, and the FW prior additionally
conditions the fraction pair on f + fw <= 1. The extra-axonal fraction is
1 - f - fw; the noFW prior sets fw = 0. The ODF invariants follow
p4 = U * 0.9 * p2, where U is uniform on [0, 1].

The histograms show the actual saved samples after the sampling constraints,
so their means and widths can differ from those of the underlying Gaussians.
The joint panels show the fraction constraint and the relationship between
p2 and p4. These are the primary training priors; the second fit for
high-free-water voxels uses wider fraction priors as described above.
Download the saved prior files
or the SVG figure.
Some advanced usage options
The code provides some additional flexibility:
- Rician bias correction: to de-bias the DWI before the spherical harmonics fit.
- Variable number of compartments: 'IAS', 'EAS', 'FW'. This will be extended but at the moment the only two options are {'IAS', 'EAS'} (default) or {'IAS', 'EAS', 'FW'}.
- User-defined parameter distributions for the training data (for the machine learning estimator that performs RotInvs -> kernel).
- Output spherical harmonic decomposition of the ODF for fiber tracking (normalized for using it with MRtrix3).
Useful tips
The Standard Model is very complex and this is why noise propagates into the model parameters nonlinearly. This results in the kernel diffusivities and additional compartments being very challenging to estimate. If you have multiple TE and b-tensor shapes your chances of getting accurate and precise parameters are much better but if you only have two-shell data then you will likely only get reliable axonal fraction and p2.
- For conventional 2-shell datasets (b=1000,2000 s/mm^2) set 'options.compartments' to {'IAS', 'EAS'} (no FW compartment).
- For ex-vivo data modify the training distribution bounds to account for the decreased diffusivity values.
Useful papers discussing SMI advantages and limitations
- This paper in Imaging Neuroscience discusses how to get the most from 2-shell datasets using multiple approaches for microstructure estimation (SMI, WMTI, NODDI, SMT).
- This paper in Human Brain Mapping explores how variable TE helps determine the free-water fraction and compares how much microstructure information you can extract from different acquisition times involving a range of diffusion weightings (intermediate b-values, high b-values, variable b-tensor shapes, variable echo times).
SMI Authors
Do not hesitate to reach out to [email protected] (or @santicoelho in Twitter) for feedback, suggestions, questions, or comments[^note].
LICENSE
A US patent contains some of the related developments.
% Authors: Santiago Coelho ([email protected]), Jelle Veraart, Els Fieremans, Dmitry Novikov
% Copyright (c) 2022 New York University
%
% Permission is hereby granted, free of charge, to any non-commercial entity ('Recipient') obtaining a
% copy of this software and associated documentation files (the 'Software'), to the Software solely for
% non-commercial research, including the rights to use, copy and modify the Software, subject to the
% following conditions:
%
% 1. The above copyright notice and this permission notice shall be included by Recipient in all copies
% or substantial portions of the Software.
%
% 2. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
% NOT LIMITED TO THE WARRANTIESOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
% IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF ORIN CONNECTION WITH THE
% SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
%
% 3. In no event shall NYU be liable for direct, indirect, special, incidental or consequential damages
% in connection with the Software. Recipient will defend, indemnify and hold NYU harmless from any
% claims or liability resulting from the use of the Software by recipient.
%
% 4. Neither anything contained herein nor the delivery of the Software to recipient shall be deemed to
% grant the Recipient any right or licenses under any patents or patent application owned by NYU.
%
% 5. The Software may only be used for non-commercial research and may not be used for clinical care.
%
% 6. Any publication by Recipient of research involving the Software shall cite the references listed
% below.
%
% REFERENCES:
% - Coelho, S., Baete, S., Lemberskiy, G., Ades-Aron, B., Barrol, G., Veraart, J., Novikov, D.S., Fieremans, E., 2022. Reproducibility of the Standard Model of diffusion in white matter on clinical MRI systems. Neuroimage. doi: 10.1016/j.neuroimage.2022.119290. Epub 2022 May 8. PMID: 35545197; PMCID: PMC9248353.
% - Novikov, D.S., Veraart, J., Jelescu, I.O., Fieremans, E., 2018. Rotationally-invariant mapping of scalar and orientational metrics of neuronal microstructure with diffusion MRI. NeuroImage 174, 518 – 538.
% - Reisert, M., Kellner, E., Dhital, B., Hennig, J., Kiselev, V.G., 2017. Disentangling micro from mesostructure by diffusion MRI: A Bayesian approach. NeuroImage 147, 964 – 975.
[^note]: Please cite these works if you use the SMI toolbox in your publication: - Coelho, S., Baete, S., Lemberskiy, G., Ades-Aron, B., Barrol, G., Veraart, J., Novikov, D.S., Fieremans, E., 2022. Reproducibility of the Standard Model of diffusion in white matter on clinical MRI systems. Neuroimage. doi: 10.1016/j.neuroimage.2022.119290. Epub 2022 May 8. PMID: 35545197; PMCID: PMC9248353. - Dmitry S. Novikov, Jelle Veraart, Ileana O. Jelescu, Els Fieremans, Rotationally-invariant mapping of scalar and orientational metrics of neuronal microstructure with diffusion MRI, NeuroImage, Volume 174, 2018, Pages 518-538. - Marco Reisert, Elias Kellner, Bibek Dhital, Jürgen Hennig, Valerij G. Kiselev, Disentangling micro from mesostructure by diffusion MRI: A Bayesian approach, NeuroImage, Volume 147, 2017, Pages 964-975.
[^2]: The SM name originates from a tongue-in-cheek association with the Standard Model in particle physics, as both encompass a fair bit of previous modeling effort from various groups. Here “standard” refers to common assumptions among modeling approaches and does not imply “exact”.
Explorar proyectos relacionados
Cargando…