Skip to main content
Imaging Neuroscience logoLink to Imaging Neuroscience
. 2026 Jan 22;4:IMAG.a.1102. doi: 10.1162/IMAG.a.1102

Microstructure.jl: A Julia package for probabilistic microstructure model fitting with diffusion MRI

Ting Gong 1,*, Anastasia Yendiki 1
PMCID: PMC12828355  PMID: 41585469

Abstract

Microstructure.jl is a Julia package designed for probabilistic estimation of tissue microstructural parameters from diffusion or combined diffusion–relaxometry MRI data. It provides a flexible and extensible framework for defining compartment models and includes robust and unified estimators for parameter fitting and uncertainty quantification. The package incorporates several established models from the literature, such as the spherical mean technique (SMT), standard model imaging (SMI), and soma and neurite density imaging (SANDI), along with their extensions for analyzing combined diffusion and T2 mapping data acquired at multiple echo times. For parameter estimation, it features methods such as Markov Chain Monte Carlo (MCMC) sampling and Monte Carlo dropout with neural networks, which provide probabilistic estimates by approximating the posterior distributions of model parameters. In this study, we introduce the major modules, functionality, and design of this package. We demonstrate its usage in optimizing acquisition protocols and evaluating fitting performance with synthesized ex vivo datasets for estimating the axon diameter index. We also demonstrate its practical applications for parameter estimation and uncertainty quantification with publicly available in vivo datasets: (1) SMT on 3 b-shell and 1.25-mm isotropic resolution data from the human connectome project, (2) SANDI on 2.0-mm isotropic resolution microstructure data from the high-gradient Connectome 1.0 scanner, and (3) SMI with a free water compartment on 2 b-shell, multi-echo-time, 2.5-mm isotropic resolution data from a Prisma scanner. Microstructure.jl is applicable to in vivo and ex vivo imaging data acquired with typical research, high-performance, or pre-clinical scanners.

Keywords: microstructure, diffusion MRI, diffusion–relaxometry, Bayesian estimation, Julia

1. Introduction

Microstructure modeling allows us to estimate biologically meaningful cellular parameters from MRI data, demonstrating high sensitivity and specificity in quantifying tissue morphology (Alexander et al., 2019; Novikov et al., 2019). This is achieved by parsimonious models that represent the tissue in a voxel as composed of a small set of compartments. Each tissue compartment corresponds to a different cellular structure, for example, neurites or cell bodies, whose distinct geometry and composition give rise to a different MR signal. Given data collected with an appropriate acquisition protocol, one can, therefore, disentangle the signals from these compartments and estimate their free parameters by solving an inverse problem. These parameters are informative on various tissue properties and can, therefore, serve as biomarkers for both healthy and diseased biological processes.

1.1. Challenges and developments

There are several challenges involved in fitting complex microstructural models to MRI measurements that are inherently noisy and exhibit varying sensitivities to different tissue features. (1) Presence of local minima: Non-linear objective functions defined on high-dimensional parameter spaces often have multiple local minima. As a result, optimization algorithms may converge on suboptimal solutions that are inaccurate estimates of the underlying tissue properties, and that are highly dependent on how the algorithm was initialized. (2) Parameter degeneracy: Different combinations of tissue parameters can produce similar MRI measurements, making it difficult to distinguish between them based on the data alone, complicating the interpretation of parameter estimates. (3) Lack of robustness: Various factors, related to either experimental design or true individual variability, can degrade the accuracy of parameter estimates. On the one hand, MRI acquisition parameters, such as gradient strength or echo time (TE), affect both the sensitivity of the measurements to specific tissue features and image quality characteristics such as signal-to-noise ratio (SNR) and artifacts. On the other hand, the heterogeneity of tissue properties across different regions or subjects can introduce estimation errors, if it is not modeled appropriately.

Maximum likelihood optimization methods, which provide a point estimate of parameters, are insufficient for quantifying and addressing these issues. For robust interpretation of the imaging measures, it is critical to provide estimates not only of the parameters of interest, but also of their uncertainty. Bayesian optimization methods allow uncertainty to be quantified by estimating the posterior distribution of parameters. This is also useful for identifying parameter degeneracy. For example, random sampling methods such as Markov Chain Monte Carlo (MCMC) generate samples drawn from the posterior distribution of the parameters (Gilks et al., 1995). These distributions capture the uncertainty around the estimate (Alexander, 2008; Behrens et al., 2003). However, deriving full posterior distributions is computationally intensive, making such methods impractical for high-resolution, whole-brain datasets. In addition, these methods require tuning of the sampling parameters for each model.

Improving the speed and robustness of probabilistic microstructure model fitting is essential for making these models practical in large-scale neuroimaging studies. This involves a two-pronged approach: (i) leveraging high-performance languages and efficient computing to accelerate MCMC estimation methods and (ii) taking advantage of the recent developments in neural network-based estimation methods for even faster inference. Both MCMC and neural network-based approaches allow quantification of uncertainty in parameter estimates, and they may play complementary roles in managing the bias and variance trade-off of parameter estimation. Therefore, both methods are useful for addressing the challenges of microstructure imaging.

1.2. Microstructure models

Here, we introduce microstructure models briefly, to provide a common language for describing the features available in existing toolboxes and in Microstructure.jl.

1.2.1. Orientation-dependent models

This approach models the effects of the fiber orientations on the diffusion-weighted imaging (DWI) signal. The input data used for model fitting are either the DWI measurements collected with different gradient directions or their rotationally invariant features (Alexander et al., 2010; Assaf & Basser, 2005; Behrens et al., 2003; Jespersen et al., 2010, 2007; Novikov et al., 2018; Zhang et al., 2012).

1.2.2. Orientation-averaged models

This approach factors out the effects of fiber orientation through powder averaging (PA) (Callaghan et al., 1979) to focus on estimating other microstructure parameters. Thus, the input data used for model fitting are only direction-averaged signals obtained by averaging or fitting DWI measurements from different gradient directions at each unique b-value and/or diffusion time. Examples include the spherical mean technique (SMT) (Kaden et al., 2016b), soma and neurite density imaging (SANDI) (Palombo et al., 2020), and several water exchange models (Jelescu et al., 2022; Olesen et al., 2022).

1.2.3. Combined diffusion–relaxometry models

These models extend those in the first two categories by introducing compartment-specific T2/T2* and/or T1 values as model parameters (Coelho et al., 2024; Gong et al., 2020, 2022, 2023b; Lampinen et al., 2019; McKinnon & Jensen, 2019; Slator et al., 2021; Veraart et al., 2018). They require DWI measurements to be collected at multiple echo times (TE) and/or inversion recovery times (TI). Whereas the two previous categories of models may yield relaxation-weighted and protocol-dependent estimates of tissue compartment fractions, combined diffusion–relaxometry models enable unbiased estimation. They also provide estimates of compartmental T2/T2*/T1 values that reflect the macromolecular environment of tissue compartments. While these models demand more extensive measurements and thus longer acquisition times, development of novel, efficient acquisition sequences (Dong et al., 2022; Fair et al., 2021; Hutter et al., 2018; Jun et al., 2024; Wang et al., 2019) and robust computation tools (de Almeida Martins et al., 2021; Gong et al., 2021a, 2021b; Palombo et al., 2023) is now making them practical for use in future studies.

1.3. Summary of existing software

1.3.1. MATLAB toolboxes for multi-compartment model fitting

Several well-known toolboxes have made microstructure model fitting more accessible for basic and clinical neuroscience research. For example, the compartment modeling module in the UCL Camino Diffusion MRI Toolkit (Cook et al., 2005) implements a broad range of models, which have been described in a model comparison paper (Panagiotaki et al., 2012). These include models such as ActiveAx for axon diameter estimation (Alexander et al., 2010) and VERDICT for cell size estimation (Panagiotaki et al., 2014). The NODDI toolbox, also from UCL, focuses on orientation-dispersed models for axon diameter (Zhang et al., 2011) and neurite density estimation (Tariq et al., 2016; Zhang et al., 2012). Other MATLAB toolboxes, including the SANDI toolbox (Palombo et al., 2020) and the standard model imaging (SMI) toolbox (Coelho et al., 2022), fit specific models with machine learning.

1.3.2. Python toolboxes for multi-compartment model fitting

There are several Python toolboxes designed to provide consistent frameworks for parameter estimation across various microstructure models. The Microstructure Diffusion Toolbox (MDT) (Harms & Roebroeck, 2018) implements several orientation-dependent models and provides MCMC sampling methods for estimating parameters and quantifying uncertainty. It also supports GPU processing to speed up model fitting. Dmipy (Fick et al., 2019) is another python toolbox that implements a wide range of tissue compartments, including both orientation-distributed and spherical mean-based models, and provides several non-linear solvers for parameter estimation. In addition to MDT and Dmipy, the Amico toolbox (Daducci et al., 2015) implements several models from the literature, including ActiveAx, NODDI, and SANDI, with accelerated processing using linear approximations.

1.3.3. Other open-source tools

Other software tools, such as MRtrix (Tournier et al., 2019) and Dipy (Garyfallidis et al., 2014), focus primarily on signal models for fiber orientation estimation and tractography.

1.4. Features of Microstructure.jl

Microstructure.jl aims to provide a flexible and probabilistic framework for microstructure model fitting, leveraging the intuitive and high-performance language Julia (Bezanson et al., 2014). It is designed not only as an application tool with a user-friendly interface but also as a developer tool that can be easily extended. Compared with existing toolboxes, it has a unique combination of features: (1) Support for combined diffusion–relaxometry modeling. (2) Generic MCMC and neural network estimators for parameter estimation and uncertainty quantification, in which model fitting assumptions can be easily adjusted. (3) Compatibility with other probabilistic programming packages in the Julia ecosystem, such as Turing.jl. Currently, Microstructure.jl focuses primarily on microstructure imaging. In parallel, we are developing a companion Julia package, Fibers.jl, for fiber orientation estimation and tractography.

In the following sections, we describe the main functionality and structure (Section 2) and demonstrate key use cases (Section 3). Microstructure.jl can be installed seamlessly through Julia’s built-in package manager. Source code is available at: https://github.com/Tinggong/Microstructure.jl. Application Programming Interface (API) manuals and tutorials are available at: https://tinggong.github.io/Microstructure.jl/dev/.

2. Package Design

Figure 1 demonstrates an overview of the relationships between major data types and functions in Microstructure.jl. In this section, we introduce each module in detail. Figure 2 includes code snippets that demonstrate key features and use cases introduced in Sections 2 and 3.

Fig. 1.

Fig. 1.

Package overview. The diagram shows the main data types (green boxes) and functions (blue boxes) in each module of Microstructure.jl. The direction of the orange arrow between a green and blue box indicates whether a certain type is an input or output to the respective function.

Fig. 2.

Fig. 2.

Code snippets that demonstrate example usage of the package. (i) Reading DWIs and acquisition parameters and returning the direction-averaged measurements and the associated protocol structure. (The acquisition parameter files that include b-values and optional gradient directions, echo times, diffusion gradient pulse separation, and width are assumed to have the specified extensions.) SNR maps are also returned as the ratio of mean and standard deviation of b = 0 measurements at each echo time. (ii) Generating signals from a compartment or tissue model. (iii) Setting up an MCMC sampler using the two-stage method as an example. (iv) Setting up a neural network estimator and training a network for SMT estimation. (v) Changing the prior distributions used for generating training datasets in (iv). Functionality may evolve as the package is developed—refer to the package documentation website for the latest information and more details, which also includes the full code examples for generating results in the Demonstration section.

2.1. Data I/O

In the I/O module, Microstructure.jl handles reading DWI volumes and text files with acquisition parameters to prepare the input data and protocols necessary for microstructure parameter fitting. The module includes functions to read DWI measurements from NIfTI (via calls to the Fibers.jl package). The input data are expected to have been corrected for image artifacts, for example, eddy current and motion. There are two functions to extract rotational invariant measurements for microstructure parameter estimation. The “spherical_mean” function averages the DW measurements across gradient directions, for each unique combination of b-value, TE, diffusion gradient duration, and separation times. The “spherical_fit” function fits the DW measurements to spherical harmonic (SH) bases to get the SH coefficients, which allows the extraction of rotational invariants with a specified maximum SH order; the rotational invariant at order 0 is equivalent to the spherical mean signal. Details about the SH bases and rotational invariants are included in Appendix A.

These functions return a structure of type “MRI” that contains the volume series of rotational invariant measurements, and a structure of type “Protocol” that contains acquisition and estimation parameters of each volume such as the diffusion times, the echo times, the order of the rotational invariants, and the number of measurements used to estimate them. Figure 2(i) shows example code for reading data and generating the spherical mean measurements and imaging protocol.

2.2. Tissue compartments

In Microstructure.jl, tissue compartments are implemented as composite types, with fields that store relevant tissue microstructure parameters. The function “compartment_signals” predicts the normalized signals given a tissue compartment object and an imaging protocol. We take advantage of multiple dispatch in Julia to flexibly implement different methods (meaning the forward model) based on the compartment type. When specified, compartmental T2 values are included in the forward model, as demonstrated in previous work (Coelho et al., 2024; Gong et al., 2020, 2023b; Lampinen et al., 2019; McKinnon & Jensen, 2019; Veraart et al., 2018) for combined diffusion–relaxometry imaging. While we define all relevant parameters for each compartment, this does not mean that they can all be estimated robustly. The decision about which parameters to estimate should be made based on the acquisition protocol of the input data. Our framework allows the user to define explicitly which parameters will be estimated and which will be assumed to be fixed or linked to other parameters, and to pass any such assumptions to the estimator functions.

In all of the following model definitions, b is the diffusion weighting b-value that can be computed from the diffusion gradient duration time δ, separation time Δ and magnitude G, as b= γ2G2δ2(Δ−δ /​3) for a pulsed gradient spin echo encoding, and t is the TE. A relaxation weighting term e−t/T2 is included in each of these models for combined diffusion–relaxometry imaging only if multi-TE data (i.e., data acquired with different values of t) are provided and is otherwise omitted for conventional diffusion microstructure imaging. The forward model formular for each compartment below expresses the DWI signal at a voxel as a function of the unknown microstructural parameters in that voxel, as well as the known protocol variables b and t. In a typical acquisition, multiple measurements of the signal in each voxel are acquired for different values of b and possibly t, to allow estimation of the unknown microstructural parameters. In all expressions below, the DWI signal is assumed to be normalized by the b = 0 signal in the same voxel.

2.2.1. Spherical mean signals

Currently, five different tissue compartments are included, with different forward models for the spherical mean signals (Callaghan et al., 1979; Kaden et al., 2016b; Kroenke et al., 2004).

2.2.1.1. Zeppelin

The Zeppelin model is a tensor with equal water diffusivity in the two perpendicular directions, which is expected to be smaller than the water diffusivity in the parallel direction. This compartment is usually used to represent an anisotropic extra-cellular environment typically seen in the white matter (WM) (Alexander, 2008; Jespersen et al., 2010). The normalized signal follows the spherical mean expression as

Szeppelin(b(δ,Δ,G),  t; D∥,D⊥,T2)=e−t/T2e−bD⊥π4b (D∥−D⊥) erf(b (D∥−D⊥)), (1)

where the three free parameters D∥, D⊥, and T2 are the parallel diffusivity, perpendicular diffusivity, and the T2 value of water within the Zeppelin compartment; and erf(·) is the error function. To constrain D⊥ to be smaller than D∥, D⊥ is represented as D∥ multiplied by a fraction between [0, 1].

2.2.1.2. Cylinder

In the cylinder model, water diffusion in the perpendicular direction in Eq. (1) is related to the cylinder diameter through the Gaussian phase distribution (GPD) approximation (Andersson et al., 2022; Fan et al., 2020; Van Gelderen et al., 1994). This compartment is used to represent axons when the imaging acquisition protocol can provide sensitivity to the axon diameter. Therefore, the normalized signal is

Scylinder(b(δ,Δ,G),  t; D∥,D0, da,T2)= e−t/T2e−bD⊥π4b (D∥−D⊥) erf(b (D∥−D⊥));

and −bD⊥=

−2γ2G2∑m=1∞1D02αm6(ra2αm2−1)(2D0αm2δ−2+2e−D0αm2δ+2e−D0αm2Δ−e−D0αm2(Δ−δ)−e−D0αm2(Δ+δ)), (2)

where the four free parameters D∥,D0, da, and T2 are the parallel diffusivity, intrinsic diffusivity, cylinder diameter, and T2 value, respectively; ra=da​/ 2 is the cylinder radius; αm is the m-th root of J1′(αra) = 0; and J1′ is the derivative of the first-order Bessel function of the first kind. Because cylinder diameter is known to be a biased representation of axon diameter (Burcaw et al., 2015; Veraart et al., 2020), we refer to da as axon diameter index in the rest of the manuscript.

2.2.1.3. Stick

When the imaging protocol is not sensitive to the axon diameter index, a stick model is used to represent the axons (Behrens et al., 2003), where the water diffusivity perpendicular to the axons is approximately zero, and, therefore, the normalized signal is given by

Sstick(b(δ,Δ,G), t;  D∥,T2)=e−t/T2π4bD∥  erf(bD∥ ), (3)

where the two free parameters D∥ and T2 are the parallel diffusivity and T2 values of water, respectively, in the stick compartment. This compartment is used for estimating the intra-neurite signal fraction and diffusivity with lower b-value acquisition protocols.

2.2.1.4. Sphere

The sphere model is an isotropic compartment where diffusion of water molecules is assumed to be restricted in spheres of radius rs. This compartment is used to represent cell bodies more abundant in the gray matter (GM) (Palombo et al., 2020). The normalized signal given by GPD is (Balinov et al., 1993; Neuman, 1974)

Ssphere(b(δ,Δ,G), t;  Dis,rs, T2)=e−t/T2e{−2γ2G2∑m=1∞1Dis2αm6(rs2αm2−2)(2Disαm2δ−2+2e−Disαm2δ+2e−Disαm2Δ−e−Disαm2(Δ−δ)−e−Disαm2(Δ+δ))} (4)

where the three free parameters Dis,rs, and T2 are the water diffusivity, radius, and T2 value, respectively, in the sphere compartment; αm is the m-th root of 1α rsJ32(α rs)= J52(α rs), and Jn is the Bessel function of the first kind.

2.2.1.5. Iso

This compartment is used to model tissue environments in which water exhibits isotropic Gaussian diffusion. Its normalized signal is thus given by

Siso(b(δ,Δ,G), t;  D, T2)=e−t/T2e−bD, (5)

where the free parameters D and T2 are diffusivity and T2 value of water, respectively, in the compartment. An isotropic compartment can be used to model (i) cerebrospinal fluid (CSF), where D is free water diffusivity; (ii) the extra-cellular compartment, where D is dependent on the tissue environment and estimated from the data; or (iii) immobile water in ex vivo tissue, where the diffusivity D is set to 0.

2.2.2. Rotational invariants of higher order

For the Stick, Zeppelin, and Iso compartments, we have implemented forward models of rotational invariants of the DW measurements at a maximum order higher than 0. These are useful for standard model imaging (SMI) in the white matter (Novikov et al., 2018). For modularity, we defined types of Stick_kernel, Zeppelin_kernel, and Iso_kernel that have the same tissue parameters as the Stick, Zeppelin, and Iso described above, but that express the projection of the respective kernel functions onto the Legendre polynomial as

Klstick(b(δ,Δ,G), t;  D∥,T2)= ∫01dξ e−t/T2e−bD∥ξ2 Pl(ξ) (6)
Klzeppelin(b(δ,Δ,G),  t; D∥,D⊥,T2)= ∫01dξ e−t/T2e−bD∥ξ2−bD⊥(1−ξ2) Pl(ξ) (7)
Kliso(b(δ,Δ,G), t;  D, T2)= ∫01dξ e−t/T2e−bD Pl(ξ), (8)

where ξ=g→.n→ is the dot product of the gradient direction g→ and the symmetric orientation of the kernel n→ ; and Pl(ξ) is the Legendre polynomial.

An fODF type compartment is defined to represent the fiber orientation distribution function in terms of SH bases. This is combined with the kernel compartments to predict rotational invariant measurements at different orders. See Appendix B for details on how rotational invariant measurements relate to microstructure parameters.

2.3. Biophysical models

A biophysical model for microstructure imaging is a representation of the signals measured in a tissue voxel by a linear combination of contributions from multiple compartments. In Microstructure.jl, water exchange between compartments is currently not modeled; therefore, one should consider whether the experimental regime is appropriate for this assumption. This section introduces examples specific to modeling GM and WM tissue.

2.3.1. GM models

The package includes the SANDI model (Palombo et al., 2020) and its extensions for GM microstructure modeling. The “SANDI” model is a three-compartment model, where cell soma, neurite, and extra-cellular space are modeled as “Sphere”, “Stick”, and “Iso” compartments, respectively. For ex vivo imaging, the “SANDIdot” model includes an additional “dot” compartment (“Iso” compartment with diffusivity equal to 0) to account for immobile water in ex vivo tissue (Olesen et al., 2022). We have used this model to study cellular changes due to brain development in ex vivo macaque brain samples from early infancy to adulthood (Gong et al., 2024). Lastly, the “MTE_SANDI” model supports data collected with multiple echo times (MTE) and can also estimate the T2 values in the soma, neurite, and extra-cellular compartments (Gong et al., 2023b).

2.3.2. WM models

The package includes two types of WM models. The first type models the axonal space as a “Cylinder” compartment and assumes that the data are acquired with strong enough diffusion gradients to be sensitive to the size of axons (Andersson et al., 2022; Fan et al., 2020). The “ExCaliber” model is one example, where intra-axonal space is modeled as a “Cylinder” compartment, extra-cellular space modeled as a “Zeppelin” compartment, and an “Iso” compartment is used either with diffusivity equal to zero, to represent immobile water when imaging ex vivo tissue (Gong et al., 2025), or with diffusivity equal to that of free water, to represent CSF when imaging in vivo tissue (Fan et al., 2020). The second type of WM model represents axons as a “Stick” compartment and is applicable to data acquired on clinical MRI systems that do not allow high enough b-values to sensitize the signal to axon diameters. Models in this category are “MTE_SMT”, which uses only the spherical mean signals and includes “Stick” and “Zeppelin” compartments (Kaden et al., 2016b); “SMI”, which uses rotational invariants of the signals; and “SMIfw”, which is SMI with the addition of a free water compartment accounting for CSF contamination (Coelho et al., 2024; Novikov et al., 2018).

The function “model_signals” predicts the normalized spherical mean or higher order rotationally invariant signals given a model object and an imaging protocol, similar to the “compartment_signals” function. Figure 2(ii) shows example code for generating signals using a WM tissue model.

2.4. Estimators

Estimators in Microstructure.jl provide flexible settings to determine which parameters of a biophysical model will be estimated and how. Given that the available data may not be suitable for robust estimation of all free parameters in a model, this flexibility allows the evaluation and adjustment of model fitting assumptions. Details about the estimators can be found in our API manuals on the documentation website. Below we provide brief overviews and considerations for choosing between the two types of estimators.

2.4.1. MCMC

Microstructure.jl implements the Metropolis-Hastings sampling algorithm without relying on external sampling libraries. It provides flexible arguments through the “Sampler” and “Noisemodel” inputs, allowing the user to apply the estimator to sample any parameters from any biophysical model. It is also possible to apply other advanced MCMC sampling methods to models in Microstructure.jl with Turing.jl (https://turinglang.org/), a general-purpose library for Bayesian inference. Initial evaluations indicate that Turing.jl sampling is slower than the native MCMC implementation in Microstructure.jl, and more detailed testing will be conducted in the future. To accelerate MCMC sampling for large datasets, Microstructure.jl supports multi-thread processing.

2.4.2. MC dropout with neural networks

The neural network estimator in Microstructure.jl builds a multi-layer perceptron (MLP) model and trains the model with synthetic training data for a specific “BiophysicalModel”. The training data contain pairs of model parameters and predicted normalized measurements given the measurement protocol, noise model, and the noise level for supervised learning. The noise level to be added to the synthetic training data should be chosen by the user based on noise measurements from the real dataset that they intend to analyze. Dropout layers are used as a Bayesian approximation to estimate the parameter posterior distributions (Gal & Ghahramani, 2015). This module uses the machine learning library Flux.jl (https://fluxml.ai/) and provides the user with full flexibility in MLP design (e.g., number of hidden layers and unit per layer) through “NetworkArg” and training options (e.g., loss functions, train/validation split) through “TrainingArg”. While simple network architectures can be effective for microstructure fitting, the accuracy and generalizability of trained network models are highly dependent on the training datasets. For example, training samples generated by fitting microstructural models on real brain datasets can introduce unbalanced prior distributions of the parameters, depending on the population that the training data were acquired from. This can introduce bias to estimates, particularly in regions where the true parameter values in the test data are underrepresented in the training set (Li et al., 2019). The module thus allows the user to specify prior distributions for each microstructure parameter when synthesizing the training dataset.

2.4.3. Considerations for choosing an estimator

(1) Speed. The neural network estimators are much faster. A whole-brain dataset can typically be processed in minutes on a single central processing unit (CPU) across different models, making neural network estimators convenient for processing large-scale datasets. The processing time for the MCMC sampler, however, increases linearly with the size of the data, thus is much slower and may become prohibitive when processing high-resolution, whole-brain datasets. For acceleration, the MCMC sampler currently supports multi-thread processing on CPUs. (2) Priors. The MCMC estimator uses uniform prior distributions within given parameter ranges. In contrast, the neural network estimator allows the incorporation of any prior distributions through synthetic training datasets. Uniform priors yield estimates that are less biased by prior knowledge, while informative priors could improve parameter estimation if such prior knowledge is valid and effective.

In brief, the classical MCMC estimator is helpful for evaluating protocols and fitting at the single voxel level, while the neural network estimator offers faster processing speed and greater flexibility for introducing prior information to improve parameter estimation.

3. Demonstrations

We demonstrate applications of Microstructure.jl focusing on (1) optimizing acquisition protocols and evaluating quality-of-fit: We show how to generate signals from a single tissue compartment (Section 3.1) and how to evaluate fitting strategies for multi-compartment models on simulated data (Section 3.2). (2) Applying models from the literature on publicly available datasets: We show how to use neural network estimators for WM and GM models and adapt the prior distributions in training datasets (Section 3.3). These demonstrations highlight the importance of having an easy-to-use package for optimizing data acquisition and evaluating parameter fitting for microstructure imaging. Lastly, we summarize the computation times for these tasks to demonstrate the performance of the package (Section 3.4).

3.1. Generating signals from compartment models

Generating signals from a compartment model with a given imaging protocol and associated tissue properties is an essential building block of microstructure modeling. Before embarking on an imaging study, this functionality is key for understanding how the data should be collected to improve sensitivity to the tissue properties of interest. We demonstrate this for the task of designing an imaging protocol for estimating axon diameter index with the “Cylinder” compartment.

3.1.1. Sensitivity range of axon diameter index

When estimating axon diameter indices from MRI data, the range of values that we are sensitive to depends both on experimental factors such as gradient strength and diffusion times, and on tissue properties such as the intrinsic diffusivity. Therefore, evaluation of experimental settings is important for understanding the validity of the axon diameter index.

Following the sensitivity criterion for the direction-averaged signal introduced by previous studies (Andersson et al., 2022; Nilsson et al., 2017), we can conveniently calculate the sensitivity range of axon diameter index estimates obtained from Microstructure.jl. The sensitivity criterion concerns whether the normalized signal can be differentiated from the noise floor and the maximum signal. For this, the smallest robustly measurable signal attenuation σ¯ relates to the SNR level of the signal as follows:

σ¯= zαSNRn,

where n is the number of measurements and zα is the z-threshold for the significance level α (zα = 1.64 when α=0.05 ).

The maximum signal from a “Cylinder” compartment is that of a “Cylinder” with zero diameter, which is equal to the signal from a “Stick” compartment (Sstick ). Thus, the signal from a “Cylinder” (Scylinder ) can be differentiated from 0 or Sstick if it falls within the range of [σ¯ , Sstick−σ¯]. Given a single b-value, this signal bound defines the lower and upper bounds of axon diameter, respectively, that is, the minimal diameter that gives Scylinder smaller than Sstick−σ¯ and the maximal diameter that gives Scylinder greater than σ¯ .

3.1.1.1. Experiments

Using this criterion, we calculate the sensitivity ranges of axon diameter estimation at different high b-values feasible on a 4.7 T preclinical scanner with maximum gradient strength Gmax = 660 mT/m. We investigate the effects of diffusion time and b-value to the sensitivity range by using different diffusion times that reach the Gmax with different b-values. We assume that the number of gradient directions is 32 and the ex vivo intrinsic diffusivity is 0.6 µm2/ms (Andersson et al., 2022), within the range seen in ex vivo macaque and human data (Gong et al., 2025). We consider SNR levels of 100, 50, and 30 in the b = 0 measurement.

3.1.1.2. Results

For the same diffusion time, the sensitivity range shifts toward smaller axons when the gradient strength G and thus b-value increases, as shown in Figure 3A–C. Higher gradient strengths yield sensitivity to smaller axons, which are most abundant in tissue. However, they also reduce the sensitivity to very large axons, for example, axons with diameter >7.5 µm for G = 660 mT/m. For the same gradient strength G, shorter diffusion time and, therefore, lower b-value widens the sensitivity range on both sides, likely due to high signal levels at lower b-values. For example, see G ≈ 660 mT/m, b = 25.0, 43.0, and 64.0 ms/µm2 in Figure 3A–C. For the same b-value, shorter diffusion time and thus higher G lowers the lower bound of axon diameters that can be estimated accurately but also reduces sensitivity to larger axons. This analysis suggests that using higher gradient strength and shorter diffusion time to achieve lower b-values is preferable, as it achieves a wider sensitivity range that covers most axon diameters expected in real tissue.

Fig. 3.

Fig. 3.

Sensitivity ranges for axon diameter index estimation from single b-value data with the “Cylinder” model, assuming D0 = 0.6 µm2/ms, n = 32 directions, and different SNR levels in the b = 0 measurements. Different diffusion times (A–C) are considered to achieve different b-values with Gmax ≈ 660 mT/m. For each subplot, the lower (blue) and upper (red) bounds of axon diameter index are plotted against the b value. Vertical lines at b = 11.1 ms/µm2 and at the maximum b-value in each case are shown for reference, and the corresponding gradient strength “G” is indicated.

3.1.1.3. Comparison with in vivo sensitivity ranges

We can also assess the effects of the intrinsic diffusivity of tissue on the sensitivity range (Fig. 4). We consider diffusivities typical of ex vivo brain (D0 = 0.6 µm2/ms) and in vivo brain (D0 = 1.7 µm2/ms). We include acquisition parameters relevant for in vivo human imaging with strong gradients (b = 9.0 ms/µm2, G ~ 300 mT/m), in addition to the acquisition parameters relevant to ex vivo imaging that were detailed above. The lower diffusivity in ex vivo tissue reduces the lower bound of the sensitivity range for axon diameter index estimation (Fig. 4A) compared with the higher diffusivity for in vivo tissue (Fig. 4B).

Fig. 4.

Fig. 4.

Sensitivity ranges for axon diameter estimation in ex vivo (A, D0 = 0.6 µm2/ms) and in vivo (B, D0 = 1.7 µm2/ms) brain tissue from single b-value data using the “Cylinder” model, assuming n = 32 directions and different SNR levels in the b = 0 measurements. For each subplot, the lower (blue) and upper (red) bounds of axon diameter index are plotted against the b value. Vertical lines at b = 9.0 and 43.0 ms/µm2 are shown for reference, and the corresponding gradient strength “G” is indicated. The shaded areas indicate the typical maximum gradient strength in preclinical animal systems and human systems for in vivo imaging.

3.1.1.4. Sensitivity range for multiple high b-values

The above analysis assumes measurements with a single b-value. If data are collected with multiple b-values that are sensitive to the practical range of axon diameters in tissue, the lower and upper bounds of Scylinder (corresponding to the upper and lower bounds of axon diameter) become vectors [σ¯ , Sstick−σ¯]. In this case, we can approximate the sensitivity range by finding the diameters that give minimal mean squared error (MSE) between their Cylinder signals and signal bounds across all shells. For estimating the upper bound of axon diameters, we use only shells of high b-values because data with lower b-values can be sensitive to infinitely large axons, and if included, their signal contributions will dominate the calculation of MSE. Considering the three high b-shells in Figure 3B for ex vivo imaging (b = 18.1, 25, and 43 ms/µm2), the sensitivity ranges are [1.42, 10.5], [1.70, 9.18], and [1.94, 8.32] µm for SNR level of 100, 50, and 30, respectively.

3.2. Evaluating the quality-of-fit for a given model fitting strategy

After fitting a microstructure model, it is important to assess the quality of the fitting by inspecting the parameter posterior samples and determine whether the fitting assumptions should be adjusted to improve fitting quality. We demonstrate this process with a two-stage MCMC fitting method that we developed for estimating axon diameter indices in ex vivo tissue (Gong et al., 2025). Figure 2(iii) shows example code for setting up such a two-stage MCMC sampler in Microstructure.jl.

3.2.1. Inspecting quality of fitting and posterior samples

For estimating axon diameter index in ex vivo tissue, previous studies have used only the intra-axonal compartment with very few, ultra-high b-values (≥20 ms/µm2 for ex vivo tissue). We use the multi-compartment model “ExCaliber”, with the additional consideration that a nonnegligible and spatially varying dot signal is present in ex vivo tissue at high b-values and needs to be differentiated from the intra-axonal signals. We, therefore, model the full signal decay from a range of low and high b-values. The five free parameters in the “ExCaliber” model are the axon diameter index, the intra-axonal parallel diffusivity, the extra-cellular perpendicular diffusivity, and the intra-axonal and dot signal fraction. Parallel diffusivities in the intra-axonal and extra-cellular space are assumed to be equal to the intrinsic diffusivity.

We demonstrate this by simulating an example set of spherical mean measurements. This is done by computing the forward model for ground-truth parameters typical of a WM voxel: axon diameter index da = 2 µm, intra-axonal signal fraction fia = 0.7, dot signal fraction fdot = 0.15, parallel diffusivity D∥ = 0.6 µm2/ms, and perpendicular diffusivity  D⊥ = 0.6 * 0.3 µm2/ms. We add Gaussian-distributed noise to the spherical mean signals to generate measurements at SNR = 100. Figure 5 shows the quality of fit and posterior samples after the first and second MCMC run on these measurements. We use the mean absolute error (MAE) between posterior mean and ground truth as a measure of accuracy, and the standard deviation (STD) of posteriors as a measure of uncertainty. In the first stage, where all five tissue parameters are sampled, we find lower accuracy and higher uncertainty in the axon diameter index (MAE: 1.52 µm; STD: 2.05 µm) and intra-axonal compartment fraction (MAE: 0.20; STD: 0.23) compared with the diffusivity measures. By fixing the parallel diffusivity and extra-cellular perpendicular diffusivity to their posterior means and sampling only the distributions of the other three tissue parameters, the second MCMC run achieves similar likelihood of measurements, but with higher accuracy and lower parameter uncertainty for the axon diameter index (MAE: 0.87 µm; STD: 1.68 µm) and intra-axonal signal fraction (MAE: 0.04; STD: 0.10).

Fig. 5.

Fig. 5.

Fitting curves and posterior samples from the two MCMC runs of a two-stage MCMC fitting approach. We show the posterior distributions as histograms, with the mean estimates and ground-truth (GT) tissue parameters indicated by green and orange lines, respectively. The parameters are the axon diameter index (da/µm), the intra-axonal signal fraction (fia ), the intra-axonal parallel diffusivity (D∥/µm2/ms), the dot signal fraction (fdot ), the extra-cellular signal fraction (fec ), the extra-cellular perpendicular diffusivity represented as a fraction to the parallel diffusivity, the noise level (sigma), and the log likelihood of measurements (log(p)). The histograms are normalized so that the area under each histogram is one.

3.2.2. Evaluation of estimation accuracy and precision

Synthetic datasets with known ground-truth parameters are essential for evaluating the accuracy and precision of microstructure model estimates for different data acquisition protocols. We demonstrate this approach for evaluating axon diameter index estimation, by generating signals using the three-compartment tissue model “ExCaliber” with axon diameter indices ranging from 1 to 10 μm at 1 μm intervals. This range of evaluation extends slightly beyond the sensitivity limits calculated from the “Cylinder” compartment in Section 3.1.

The tissue parameters chosen for the synthetic data were values typically observed in ex vivo WM tissue: intra-axonal signal fraction fia = 0.7, dot signal fraction fdot = 0.15, extra-cellular signal fraction fec = 0.15, parallel diffusivity D∥ = 0.6 µm2/ms, and perpendicular diffusivity D⊥ = 0.6 * 0.3 µm2/ms. We tested three protocols with a single diffusion time and multiple b-values, where the maximum b-value was chosen to reach Gmax = 660 mT/m. The first had δ/Δ = 9.6/12 ms and b = 1, 2.5, 5, 7.5, 11.1, 18.1, 25.0 ms/ µm2 (7 b-values total), the second had δ/Δ = 11/15.192 ms and an additional b = 43.0 ms/ µm2 (8 b-values total), and the third had δ/Δ = 11/21 ms and an additional b = 64.0 ms/ µm2 (9 b-values total). Gaussian-distributed noise was added to generate 100 realizations of noisy spherical mean measurements; we show results for a moderate and lower SNR of 100 and 50 for the spherical mean measurements. Figures 6 and 7 show the estimated parameters using the 2-stage approach of Section 3.2 from the 100 noise realizations as boxplots and the ground-truth values as line plots. The Pearson correlation coefficients between mean diameter index estimates and ground-truth values were calculated to compare parameter fitting performance across different protocols.

Fig. 6.

Fig. 6.

Estimates of axon diameters from single diffusion time data when (A) SNR = 100 and (B) SNR = 50 for spherical mean signal. (i) Data generated with 7 values, bmax = 25.0 ms/µm2 and δ/Δ = 9.6/12 ms; (ii) data generated with 8 b-values, bmax = 43.0 ms/µm2 and δ/Δ = 11/15.2 ms; (iii) data generated with 9 b-values, bmax = 64.0 ms/µm2 and δ/Δ = 11/21 ms. Parameter estimates from 100 noise realizations are shown as boxplots and ground-truth (GT) parameter values are shown as line plots.

Fig 7.

Fig 7.

Estimates of axon diameter from multi-diffusion time data when (A) SNR = 100 and (B) SNR = 50 for the spherical mean signal. (i) Data combining two shorter diffusion times: δ/Δ = 9.6/12 ms and δ/Δ = 11/15.2 ms; (ii) data combining two longer diffusion times δ/Δ = 11/15.2 ms and δ/Δ = 11/21 ms; (iii) data combining all three diffusion times. Parameter estimates from 100 noise realizations are shown as boxplots and ground-truth parameter values are shown as line plots.

3.2.2.1. Measurements with a single diffusion time

Smaller axons had more precise diameter estimates and more accurate intra-axonal signal fractions than larger axons. However, diameter estimates in the low range were biased in a way that made different diameters more difficult to discriminate. In comparison, the diameters and intra-axonal signal fractions of larger axons were always under-estimated, while the dot signal fractions were more accurate. Among the different diffusion times, the shorter ones (Δ = 12 and 15.2 ms) maintained a consistent trend of axon diameter index estimates within the resolution limit (about 2–8 µm). Comparison of the two SNR levels shows that the lower SNR (SNR = 50) decreased estimation precision for smaller axons but increased the discriminability of axon diameter indices in the low range. The lower SNR also increased bias for larger axons. These findings highlight the importance of performing such evaluations to understand the effects of different acquisition parameters on model fitting.

3.2.2.2. Measurements with multiple diffusion times

Including data with multiple diffusion times improved the accuracy of axon diameter estimation versus a single diffusion time (correlation coefficient around 0.95 vs. 0.85), with better discriminability between smaller axons and lower biases and variances for larger axons, particularly at high SNR. However, at lower SNR, there was less to be gained by including multiple diffusion times (see Figs. 6B(i–ii) and 7B(i–ii)), as the differences between signals with different diffusion times were very small. In real datasets, we need to consider whether the SNR is sufficient for the differences between signals acquired with different diffusion times to be significant. When using data from all the diffusion times for fitting, both the bias and variance decreased substantially.

3.3. Neural network estimators

For a neural network estimator, the prior distribution of tissue parameters used for training the model will affect the posterior distributions of parameter estimates. Ideally an uninformative prior such as those used in the MCMC sampler will ensure that the estimates are less biased by prior knowledge and thus truly reflect biological properties. However, due to practical difficulties in parameter estimation, for example, with limited data and low SNR, previous studies have used strategies such as fixing certain parameters and using narrower priors to increase the robustness of estimates. The Microstructure.jl package is designed to investigate these strategies flexibly, as the parameters to estimate in a model and the prior ranges and prior distributions are input arguments for training MLP models. It generates fitting evaluations for a fitting strategy given the protocol and SNR level in the data.

3.3.1. Two-compartment SMT model

3.3.1.1. Datasets

We used the minimally preprocessed datasets from the WashU/UMinn young adult Human Connectome Project (HCP) (Glasser et al., 2013; Van Essen et al., 2012) to demonstrate the fitting of a Stick–Zeppelin model appropriate for WM with the SMT. The HCP data were acquired at 1.25-mm-isotropic resolution with diffusion weightings of b = 1000, 2000, and 3000 s/mm2, 90 directions per shell and 18 b = 0 s/mm2 images interspersed uniformly between the DWIs, resulting in a total of 288 measurements. We used datasets from six subjects for evaluating the variation of estimates.

3.3.1.2. Experiments and results

The SMT model with single TE data is characterized by the intra-axonal signal fraction fia , intra-axonal parallel diffusivity D∥ia , extra-cellular parallel diffusivity D∥ec, and extra-cellular perpendicular diffusivity D⊥ec . This two-compartment SMT model (Kaden et al., 2016a) originally assumed D∥ec=D∥ia=D∥and linked D⊥ec through a model of tortuosity as D⊥ec = (1- fia ) D∥ec , thus reduced the model parameters to fia and D∥. Here, we removed the tortuosity assumption and estimated fia , D∥, and D⊥ec from all three b-shells of the HCP data; D⊥ec was represented as D∥ec = D∥ multiplied by a fraction between [0, 1]. Figure 2(iv–v) shows example code for setting up this model in Microstructure.jl.

We generated 30,000 training samples with tissue parameters sampled from prior ranges of [0, 1] for fia and the D⊥ec /D∥ fraction, and [1, 3] µm2/ms for D∥. We used uniform distributions for sampling the fia and the D⊥ec /D∥ fraction. We tested both a uniform and a more informative Gaussian distribution for the D∥, with a mean value of 2 µm2/ms that is appropriate for WM tissue. We generated signals for the training samples using the forward model and the HCP imaging protocol and added Gaussian noise to the signals to generate noisy measurements.

We first evaluated the estimations on the synthetic training data with both the uninformative and informative prior distributions for the D∥ (Fig. 8). The Gaussian prior for D∥, with a mean value representative of WM tissue, improved the precision and reduced the uncertainty for the diffusivity measures. The estimation accuracy of fia was not affected much by the prior distributions of diffusivities. Figure 9 shows the parameter maps that we obtain when applying the trained models from Figure 8 to the HCP data, where the high uncertainty of fia caused by CSF contamination is highlighted by the high standard deviations in the posteriors. The reduced uncertainty of D∥ resulting from using a Gaussian prior is also evident from the uncertainty map. Distributions of parameter estimates in the WM from six subjects show high consistency.

Fig 8.

Fig 8.

Effect of prior distribution on SMT model fitting with neural network estimator. Data were synthesized assuming the acquisition parameters of the HCP protocol and either uniform (A) or Gaussian (B) prior distribution for D∥. Samples of D⊥ec were generated by multiplying D∥ by random, uniformly distributed numbers between [0, 1]. (a) 2D histograms of ground-truth (GT) values versus estimates (posterior mean); (b) 2D histogram of GT versus the standard deviation (Std) of the posterior distribution normalized by the difference between upper and lower bounds of prior range; (c) distributions of parameters in the training samples/ground-truth parameters.

Fig. 9.

Fig. 9.

SMT model fitting on in vivo human data. The trained models with (A) uniform and (B) Gaussian priors were used for inference on six randomly selected datasets from the WashU/UMinn young adult HCP. (a) Mean and standard deviation maps for estimates of different microstructural parameters from one subject. The high uncertainty caused by CSF contamination in fia is highlighted by the white arrows in both (A) and (B). The reduced uncertainty of D∥ when using a Gaussian prior is highlighted by the orange arrows. (b) Probability density of the estimates in WM shows high overlap across six subjects.

3.3.2. Three-compartment SANDI model

3.3.2.1. Datasets

We used high b-value data acquired on the MGH Connectome 1.0 scanner (Tian et al., 2022) to demonstrate fitting of the Stick-Sphere-Iso model of SANDI (Palombo et al., 2020). The datasets were acquired at 2.0-mm-isotropic resolution with 2 diffusion times, Δ = 19 or 49 ms, diffusion-encoding gradient duration δ = 8 ms, 8 different b-values for each diffusion time (50, 350, 800, 1500, 2400, 3450, 4750, and 6000 s/mm2 for Δ = 19 ms; 200, 950, 2300, 4250, 6750, 9850, 13,500, and 17,800 s/mm2 for Δ = 49 ms), 32 (for b < 2400 s/mm2) or 64 (for b ≥ 2400 s/mm2) diffusion encoding directions uniformly distributed on a sphere. We used a subset of the data with shorter diffusion time (b = 0, 350, 800, 1500, 2400, 3450, 4750, and 6000 s/mm2 and Δ = 19 ms) for SANDI, considering that the assumption of no water exchange may be invalid at Δ = 49 in the GM (Palombo et al., 2020). We used datasets from three subjects with a scan and rescan to evaluate the stability of estimates.

3.3.2.2. Experiments and results

The free parameters in the SANDI model are the intra-soma signal fraction fis , soma radius Rs, intra-neurite signal fraction fin , intra-neurite parallel diffusivity D∥in, and diffusivity of the isotropic extra-cellular space Dec . Figure 2(vi) shows example code for setting up this model in Microstructure.jl.

We generated 60,000 training samples with tissue parameters uniformly sampled from prior ranges of [2, 12] µm for Rs, [1.5, 2.5] µm2/ms for D∥in , and [0.5, 3.0] µm2/ms for Dec . The compartment fractions were sampled from a Dirichlet distribution with equal concentration parameters for the three compartments. We generated signals for the training samples using the forward model and added Gaussian noise to the signals to generate noisy measurements. The noise level was set based on the temporal SNR of the b = 0 images and the number of measurements used for direction averaging.

First, we evaluated the quality of SANDI model fitting on the synthetic training data as described above (Fig. 10). While other model parameters can be accurately estimated, the D∥in cannot be estimated with the evaluated protocol, and the estimates tend to be biased toward the mean values of the prior distribution. Figure 11 further shows the parameter estimates when applying the trained model to the human data. The uncertainty map of fin features WM regions in the genu of corpus callosum with very low fin estimates, which could potentially be outliers. The uncertainty maps of all parameters also feature a GM region with atypical values in the fin , Rs, and Dec . The distributions of parameters in GM regions including caudate and putamen show high consistency among the six scans.

Fig. 10.

Fig. 10.

Fitting evaluations of the SANDI model on synthetic training data with uninformative priors. (A) 2D histograms of ground-truth (GT) values versus estimates (posterior mean); (B) 2D histogram of GT versus the standard deviation (Std) of the posterior distribution normalized by the difference between upper and lower bounds of prior range; (C) distributions of parameters in the training samples/ground-truth parameters. The signal fractions of the three tissue compartments are summed to 1 and follow the Dirichlet distribution. This evaluation suggests that the protocol is not sensitive to D∥in .

Fig. 11.

Fig. 11.

SANDI model fitting on in vivo human data acquired with ultra-high gradient strength. Only the four parameters that can be estimated robustly, based on the evaluation of Figure 10, are shown here. (A) Parameter maps from one subject. The WM region highlighted by orange arrows in the genu of corpus callosum with low fin values shows high uncertainty, suggesting potential outlier estimates. The GM region highlighted by white arrows showing atypical values in the fin , Rs, and Dec exhibits high uncertainties in all the parameters. (B) Probability density of estimates in GM ROIs of caudate and putamen (segmented with FreeSurfer pipeline and included in the open data; Tian et al., 2022) from six scans.

3.3.3. Three-compartment diffusion–T2 SMI model

3.3.3.1. Datasets

We used a multi-TE dMRI dataset acquired on a 3 T Siemens Prisma scanner (Wongkornchaovalit et al., 2025) to demonstrate the fitting of the standard model with combined diffusion–T2 modeling. The dataset contains dMRI data at 2.5-mm-isotropic resolution with 8 different TEs: 62, 72, 82, 92, 102, 112, 122, and 132 ms. For data at each TE session, 2 b-shells at b = 700 s/mm2 and b = 2000 s/mm2 were acquired in 30 gradient directions with 4 additional b = 0 images. Additionally, sessions with TE = 62 and 132 ms were acquired twice; however, we only used one session per TE for this demonstration. Diffusion times were fixed with gradient width and separation set at δ/Δ = 15.2/25.2 ms for all b-values and TEs.

3.3.3.2. Experiments and results

We included an isotropic compartment to account for free water contamination, given the lower image resolution of this dataset. We extracted rotational invariants up to the second order to fit this three-compartment Stick–Zeppelin–Iso model. The eight free parameters are the intra-axonal signal fraction fia , parallel diffusivity D∥ia and T2 T2ia , the extra-cellular parallel diffusivity D∥ec , perpendicular diffusivity D⊥ec and T2 T2ec , the free water fraction fiso, and the p2; we fixed the free water diffusivity and T2 to 3.0 µm2/ms and 2000 ms, as the data protocol is not sensitive to the two parameters.

We generated 500,000 training samples with tissue parameters uniformly sampled from prior ranges of [1.0, 3.0] µm2/ms for D∥ia and D∥ec , and [40.0, 200.0] ms for T2ia and T2ec , and [0.0, 1.0] for p2 and the fraction of D⊥ec /D∥ec . The compartment fractions were sampled from a Dirichlet distribution with equal concentration parameters for the three tissue compartments. We generated signals for the training samples using the forward model and added Gaussian noise to the signals to generate noisy measurements.

Evaluations on synthetic data (Fig. 12) suggest high estimation accuracy for several parameters of interest, including fia , p2, fiso , and T2ia ; parameter biases exist for D⊥ec , D∥ec, and T2ec , and degeneracy exists for D∥ia . Using more informative priors might help constrain the parameter estimation. Figure 13 further shows the parameter maps on human data with the uninformative priors. Parameter maps of fia and p2 show good contrast between GM and WM, and the fiso map highlights regions with free water contamination. We also see that T2ia is higher than T2ec in the WM, consistent with previous studies (Gong et al., 2020; Veraart et al., 2018).

Fig. 12.

Fig. 12.

Fitting evaluations of the SMIfw model on synthetic training data with uninformative priors. (A) 2D histograms of ground-truth (GT) values versus estimates (posterior mean); (B) 2D histogram of GT versus the standard deviation (Std) of the posterior distribution normalized by the difference between upper and lower bounds of prior range; (C) distributions of parameters in the training samples/ground-truth parameters. The signal fractions of the three tissue compartments are summed to 1 and follow the Dirichlet distribution. The evaluation suggests that the estimation of intra-axonal parallel diffusivity is subject to parameter degeneracy.

Fig. 13.

Fig. 13.

SMIfw model fitting on in vivo human data. (A) Parameter maps from one subject. (B) Probability density of parameter estimates in brain WM (voxels with fractional isotropy greater than 0.2) from three subjects.

3.4. Processing times

Table 1 summarizes the computation time for different tasks introduced in Sections 3.2 and 3.3. Most analyses in this study were performed on a laptop equipped with an Apple M2 chip. On this system, the two-stage MCMC sampling required approximately 0.24 s per voxel using eight threads. Training the neural network models for SMT and SANDI on the CPU took less than 10 s, indicating that GPU acceleration is not necessary for training small networks of this scale such as those demonstrated for SMT and SANDI.

Table 1.

Processing times.

2-stage MCMC (task 3.2; single-diffusion time data) Training for SMT (task 3.3.1) Training for SANDI (task 3.3.2) Training larger model
Macbook Air laptop with Apple M2 chip (16 GB) 0.95 s/voxel
(CPU; single thread)
0.24 s/voxel
(CPU; 8 threads)
2.8 s/model
(CPU)
8.1 s/model
(CPU)
6.5 min/model
(CPU)
Workstation with Inter Xeon w7-3455 processor and
NVIDIA RTX 6000 Ada Generation graphics card (48 GB)
1.17 s/voxel
(CPU; single thread)
0.15 s/voxel
(CPU; 20 threads)
4.3 s/model
(CPU)
13.4 s/model
(CPU)
18.5 min/model
(CPU)
6 min/model
(GPU)

Considering that some compartment models, such as MTE models, will have higher dimensional inputs and outputs, leading to larger network models to train, we also tested training time for a network model with more units per hidden layer (150 vs. 48) and a larger training dataset (500,000 vs. 60,000 samples) than the one demonstrated for SANDI. Training this larger network model took approximately 6.5 min on the laptop and 18 min on a Linux workstation using the CPU. On the workstation, GPU acceleration significantly reduced training time for the larger model.

4. Discussion

We introduce Microstructure.jl, a package for quantifying tissue microstructure and composition across several compartment models, applicable to data acquired with typical research scanners or with high-performance/pre-clinical scanners, in vivo or ex vivo. We demonstrate some key use cases in optimizing protocols, evaluating model fitting accuracy and precision, and computationally efficient processing of high-resolution data. Microstructure.jl is included in the general Julia package registry and can thus be easily installed and updated through Julia’s built-in package manager. All versions and releases can be accessed, and we maintain a website documenting its features, API manuals, and tutorials.

4.1. Compartment models and tissue parameters

The current release includes five tissue compartments: Stick and Cylinder for representing axons/dendrites in typical and high-gradient data, Zeppelin for representing anisotropic extra-cellular environments, Sphere for representing cell bodies, and Iso for representing isotropic diffusion environments such as free water, extra-cellular, or dot compartments. Depending on the tissue type (GM/WM), a biophysical model combines two or more compartments and estimates as many of the parameters of interest as possible with the available data. Our demonstrations assessed several models, that is, ExCaliber, SMT, SANDI, and SMIfw, which require data acquired with different protocols to achieve robust estimation of the relevant microstructure parameters. As we fit the models on the spherical mean or higher order rational invariants of the DWI measurements, the data need to be acquired on q-shells.

As suggested by previous studies (Andersson et al., 2022; Drobnjak et al., 2016; Fan et al., 2020; Nilsson et al., 2017; Veraart et al., 2020), the ExCaliber model requires data of ultra-high gradient strength to gain sensitivity to smaller axons most abundant in the WM. Such acquisitions are feasible only on high-performance scanners with ultra-high gradient strengths. In a separate study, we introduced this model in detail (Gong et al., 2025) and demonstrated protocol design and fitting evaluation using the toolbox presented here. This evaluation suggests that shorter diffusion time and higher gradient improve the sensitivity range of axon diameter index and that including data of multiple short diffusion times reduces estimation bias for small axons and improves estimation precision dramatically.

With data from clinical scanners, we demonstrated both SMT and SMIfw fitting in the WM. We demonstrated SMT fitting on HCP data, where we constrained D∥ec to be equal to D∥ia so that the free parameters could be fit using data with only three b-shells. We demonstrated unconstrained parameter estimations of the SMIfw model with multi-TE diffusion MRI data, where higher order rotational invariants other than just spherical mean were used for parameter estimation. This could provide additional data points in areas exhibiting anisotropy, for example, voxels with coherent fibers (Novikov et al., 2018). We observed parameter degeneracy in intra-axonal parallel diffusivity, as evaluated on a synthetic dataset using uninformative priors. This agrees with previous studies suggesting that unconstrained estimation of the standard model parameters generally needs data acquired with multidimensional diffusion encoding to resolve parameter degeneracy (Coelho et al., 2019; Reisert et al., 2019). Such data are not available in typical large-scale studies such as the HCP. Our package is designed to be extendable, for example, to include other diffusion encodings in the future.

The SANDI model was originally demonstrated using data from the MGH Connectome 1.0, that is, a high-performance scanner with ultra-high gradient strength. However, recent evaluation of SANDI reproducibility suggests that it is practical on data from performant clinical scanners such as the Prisma (Schiavi et al., 2023). In this study, we demonstrated SANDI fitting on an in vivo human data acquired with high b-values up to 6 ms/µm2 and short diffusion time (<20 ms), as in the original study. For users interested in applying the SANDI model with Microstructure.jl, a fitting evaluation like the one in Figure 10, matching the acquisition protocol and SNR level to their own data, is recommended.

4.2. Estimators

4.2.1. MCMC

The effectiveness of MCMC sampling for approximating posterior distributions can be affected by various factors. On the one hand, chain convergence is affected by sampling parameters such as step sizes in parameter proposal distributions and length of chain. On the other hand, the acquisition protocol or SNR of the input data may limit sensitivity to the sampled model parameters. We have not tested or optimized sampling parameters for each model exhaustively. However, our package includes chain diagnostic tools (Vehtari et al., 2019), which allow the users to optimize MCMC sampling parameters for their data protocol and parameters of interest. Example diagnostics are given on our documentation website.

The length of chain is the major factor that affects computation time; implementing shorter chains than those currently demonstrated, as recommended by Harms & Roebroeck (2018), will reduce computation time for whole-brain datasets. Moreover, using a more informed initial guess as a starting point, rather than a random one, could potentially accelerate the sampling process. This initial guess can be provided for a whole-brain dataset with minimal additional computational cost by leveraging (potentially biased) neural-network estimators (Gong et al., 2023a).

4.2.2. Neural network

We demonstrate the use of neural network estimators for different models and highlight how one can evaluate model fitting on synthetic data and compute uncertainty measures that could be helpful for interpreting results from real data acquired with a certain protocol. While parameter priors can be optimized to improve estimation of certain parameters, we have focused on demonstrating this flexibility rather than showing optimized results.

For neural network estimators, the package offers full flexibility in terms of the size of the MLP, how the MLP is trained, and what data the MLP is trained on. In our experience, small MLPs, for example, 3 hidden layers with 32 or 48 neurons in each layer, are sufficient for fitting the SMT and SANDI models. For more complex tasks with higher-dimensional parameter spaces, for example, diffusion–relaxometry models, increasing the size of the MLP could improve the network’s ability to fit the data. Increasing the depth of the MLP has been suggested to be more effective than increasing its width (Shwartz-Ziv et al., 2024).

Based on the size of the MLP, the number of training samples can be chosen to approximate the maximum capacity of the MLP to fit data. Based on practical evaluations (Shwartz-Ziv et al., 2024), small MLPs in easier tasks can usually fit more training samples than the number of parameters in the MLP model. However, for larger MLPs, the number of samples the model can fit is usually lower than the number of parameters; it is thus not recommended to include a large number of training samples due to increased training time. We have added functionality to recommend a number of training samples equal to the number of parameters multiplied by a factor of 50 (between 10 and 100) for smaller MLPs. In other circumstances, we recommend trying a number of training samples slightly higher than the number of training parameters.

As we have demonstrated, the prior distributions of the training data have a significant impact on parameter estimation. Previously, we have generated samples using prior distributions of tissue parameters estimated from typical human brains. This allows us to synthesize DWI signals with realistic structures for training convolutional neural networks (CNN) to estimate fiber orientation distribution (Lin et al., 2019). While priors including brain structure benefit CNN training, they introduce imbalanced distributions of parameters in the parameter space and result in biased estimates, particularly in regions where the true parameter values are underrepresented in the training sample. This issue was demonstrated in our diffusion kurtosis imaging study (Li et al., 2019) and highlighted in a simulation study (Gyori et al., 2022). In Microstructure.jl, the training distributions can be flexibly specified to improve estimation for certain parameters.

We used the root-mean-squared error from all model parameters as the loss function during training, where we also scaled the parameters to similar range (below 1) to maintain more balanced optimization errors across different model parameters. Other loss functions, such as mean-squared errors or user-defined functions, can also be tested and compared for different tasks.

4.3. Limitations and future work

Parameter posterior distributions contain rich information that the current release of Microstructure.jl does not explore fully. A recent study fits parameter posterior distribution to Gaussian mixture models for the evaluation of parameter degeneracy, estimation uncertainty, and ambiguity at voxel level (Jallais & Palombo, 2024). Currently, we only save mean and standard deviations from posteriors due to computation time and memory constraints. In future updates, we will add functionality to save more summary and diagnostic metrics from posterior distributions when processing larger datasets.

More advanced models besides what is demonstrated require extensive validation and evaluation, which was beyond the scope of this paper. For example, we are evaluating MTE-SANDI in a separate study with multi-echo and high b-value dMRI data acquired on a high-performance scanner. We hypothesize that training data synthesized using uniform and univariant parameter distributions in a high-dimensional parameter space might introduce unrealistic or degenerate tissue parameter configurations into the training data, thus biasing parameter estimation. While the package already has the capability to perform such fitting and evaluation, further experiments are needed to optimize the data protocol and neural network estimator settings. We will further validate the toolbox and give instructions for such tasks.

The current release does not model inter-compartment water exchange. Water exchange is a highly active research area, and many different methods have been developed to model it (Bai et al., 2020; Jelescu et al., 2022; Jensen, 2024; Kärger, 1985; Olesen et al., 2022). However, water exchange time reported by different studies varies widely depending on the fitting method and data acquisition protocol (Li et al., 2023). Furthermore, estimates of water exchange time are hard to validate compared with other microstructural features. More recent work also suggests that non-permeable geometrical features (e.g., dendritic spines) can lead to exchange-like effects in the diffusion signal (Şimşek et al., 2025), providing more possibilities to account for such effects. Considering these factors, we have limited our current release to non-exchanging models and have used data with short diffusion time to minimize the impact of water exchange to model fitting in the GM. Nevertheless, the package is extendable to include connected compartments and hence incorporating exchange models is possible in future releases.

5. Conclusion

We introduce Microstructure.jl, a Julia package featuring fast and probabilistic parameter estimation for microstructural compartment models. The package offers a consistent and extendable framework that is designed to be user friendly both for users who would like to fit the currently supported models to their data and for developers who would like to add support for new models.

Acknowledgment

The authors thank contributors of all publicly available toolboxes mentioned in the introduction, whose valuable work has assisted in validating the compartment signals generated by Microstructure.jl.

Appendix A. Rotational Invariants of The DW Measurements

Rotational invariants are derived by expanding the DW measurements in terms of a series of SH basis functions. An SH basis function Ylm(g→) is defined on the unit sphere and gives a value along any direction g→ , where l denotes the order and −l≤m≤l the phase index of the SH basis in the series.

Given an SH basis type and a chosen maximum order Lmax for truncating the series, the DW signal along any gradient direction g→ can be expressed as

S(b,t,g→)= ∑l=0Lmax∑m=−llSlm(b,t)Ylm(g→),

where S(b,t,g→) is the DW signal at a specific b-value b, echo time t, and gradient direction g,→ and Slm(b,t) are the SH coefficients. These coefficients can be estimated from measurements acquired over multiple gradient directions via linear least squares fitting. The number of measurements determines the feasible maximum order Lmax .

A rotationally invariant measurement for a given order l is defined as

Sl(b,t)= ∑m=−ll|Slm(b,t) |2​/Nl,

where Nl=4π(2 l+1). As Y00 is a constant of value 1/4π with respect to g→ , the rotational invariant at l=0 corresponds to the spherical mean signal. Considering the antipodal symmetry of DW measurements and fiber orientation distributions, only even-order SH bases (l=0 , 2, 4,…) are typically used. Consequently, rotational invariants are computed for these even orders.

Appendix B. Relating Rotational Invariant Measurements to Microstructure

The DW signal S(b,t,g→) can be considered as the convolution between the fiber response kernel κ(b, t,ξ) and the fODF Π(n→) over the unit sphere:

S(b,t,g→)=∫dn→ P(n→)κ(b, t,ξ),

where ξ=g→.n→ denotes the dot product between the diffusion-encoding gradient direction g→ and the kernel orientation n→ . The response kernel κ(b, t,ξ) depends on tissue microstructure parameters.

In the SH domain, this convolution becomes a simple product:

Slm(b,t)= plmKl(b,t),

where Slm(b,t) and plm are the SH coefficients of the signals and fODF, respectively, and Kl(b,t) is the projection of the kernel response κ(b,t,ξ) onto the Legendre polynomial Pl(ξ):

Kl(b,t)= ∫01dξ κ(b,t,ξ)Pl(ξ).

Similarly, the rotational invariants of the fODF are defined as Novikov et al. (2018):

pl= ∑m=−ll|plm|2​​/​Nl.

Thus, the rotational invariant of the signal at order l can be expressed as:

Sl(b,t)= plKl(b,t).

This relationship links the rotational invariants to the underlying microstructural parameters. The terms 0≤pl≤1 (l = 2,4…) serve as measures of the anisotropy of the fODF while p0=1 . In practice, p2 is most informative, while higher-order terms are typically too small to be useful for model fitting.

Microstructure kernel. The kernel response κ(b,t, ξ) reflects the underlying tissue microstructure and can be modeled as a combination of multiple compartments. In standard white matter models, a Stick and a Zeppelin compartment are typically used, while an additional isotropic compartment can account for CSF contamination particularly in low-resolution clinical data.

Data and Code Availability

The package source code can be found at https://github.com/Tinggong/Microstructure.jl. The code for implementing the experiments described in the demonstration section can be found at our documentation website as user tutorials: https://tinggong.github.io/Microstructure.jl/dev/. Data used in this study are either synthetic (as introduced in the tutorials) or publicly available.

Author Contributions

Ting Gong: Conceptualization, Methodology, Software, Visualization, Writing—original draft, Writing—review and editing. Anastasia Yendiki: Conceptualization, Funding acquisition, Supervision, Writing—review and editing.

Funding

This work was supported by the National Institute of Neurological Disorders and Stroke (R01-NS119911, R01-NS127353, and UM1-NS132358) and the National Institute of Biomedical Imaging and Bioengineering (K99-EB037396).

Ethics

The publicly available human datasets complied with all relevant ethical regulations. Refer to the original publications associated with each dataset for details.

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

References

  1. Alexander, D. C. (2008). A general framework for experiment design in diffusion MRI and its application in measuring direct tissue-microstructure features. Magn Reson Med, 60, 439–448. 10.1002/mrm.21646 [DOI] [PubMed] [Google Scholar]
  2. Alexander, D. C., Dyrby, T. B., Nilsson, M., & Zhang, H. (2019). Imaging brain microstructure with diffusion MRI: Practicality and applications. NMR Biomed, 32(4), e3841. 10.1002/nbm.3841 [DOI] [PubMed] [Google Scholar]
  3. Alexander, D. C., Hubbard, P. L., Hall, M. G., Moore, E. A., Ptito, M., Parker, G. J. M., & Dyrby, T. B. (2010). Orientationally invariant indices of axon diameter and density from diffusion MRI. Neuroimage, 52, 1374–1389. 10.1016/j.neuroimage.2010.05.043 [DOI] [PubMed] [Google Scholar]
  4. Andersson, M., Pizzolato, M., Kjer, H. M., Skodborg, K. F., Lundell, H., & Dyrby, T. B. (2022). Does powder averaging remove dispersion bias in diffusion MRI diameter estimates within real 3D axonal architectures? Neuroimage, 248, 118718. 10.1016/j.neuroimage.2021.118718 [DOI] [PubMed] [Google Scholar]
  5. Assaf, Y., & Basser, P. J. (2005). Composite hindered and restricted model of diffusion (CHARMED) MR imaging of the human brain. Neuroimage, 27, 48–58. 10.1016/j.neuroimage.2005.03.042 [DOI] [PubMed] [Google Scholar]
  6. Bai, R., Li, Z., Sun, C., Hsu, Y. C., Liang, H., & Basser, P. (2020). Feasibility of filter-exchange imaging (FEXI) in measuring different exchange processes in human brain. Neuroimage, 219, 117039. 10.1016/J.NEUROIMAGE.2020.117039 [DOI] [PubMed] [Google Scholar]
  7. Balinov, B., Jönsson, B., Linse, P., & Söderman, O. (1993). The NMR self-diffusion method applied to restricted diffusion. Simulation of echo attenuation from molecules in spheres and between planes. J Magn Reson A, 104, 17–25. 10.1006/JMRA.1993.1184 [DOI] [Google Scholar]
  8. Behrens, T. E. J., Woolrich, M. W., Jenkinson, M., Johansen-Berg, H., Nunes, R. G., Clare, S., Matthews, P. M., Brady, J. M., & Smith, S. M. (2003). Characterization and propagation of uncertainty in diffusion-weighted MR imaging. Magn Reson Med, 50, 1077–1088. 10.1002/MRM.10609 [DOI] [PubMed] [Google Scholar]
  9. Bezanson, J., Edelman, A., Karpinski, S., & Shah, V. B. (2014). Julia: A fresh approach to numerical computing. SIAM Rev, 59, 65–98. 10.1137/141000671 [DOI] [Google Scholar]
  10. Burcaw, L. M., Fieremans, E., & Novikov, D. S. (2015). Mesoscopic structure of neuronal tracts from time-dependent diffusion. Neuroimage, 114, 18–37. 10.1016/j.neuroimage.2015.03.061 [DOI] [PMC free article] [PubMed] [Google Scholar]
  11. Callaghan, P. T., Jolley, K. W., & Lelievre, J. (1979). Diffusion of water in the endosperm tissue of wheat grains as studied by pulsed field gradient nuclear magnetic resonance. Biophys J, 28, 133. 10.1016/S0006-3495(79)85164-4 [DOI] [PMC free article] [PubMed] [Google Scholar]
  12. Coelho, S., Baete, S. H., 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, 257, 119290. 10.1016/J.NEUROIMAGE.2022.119290 [DOI] [PMC free article] [PubMed] [Google Scholar]
  13. Coelho, S., Liao, Y., Szczepankiewicz, F., Veraart, J., Chung, S., Lui, Y. W., Novikov, D. S., & Fieremans, E. (2024). Assessment of precision and accuracy of brain white matter microstructure using combined diffusion MRI and relaxometry. Hum Brain Mapp, 45, e26725. 10.1002/HBM.26725 [DOI] [PMC free article] [PubMed] [Google Scholar]
  14. Coelho, S., Pozo, J. M., Jespersen, S. N., Jones, D. K., & Frangi, A. F. (2019). Resolving degeneracy in diffusion MRI biophysical model parameter estimation using double diffusion encoding. Magn Reson Med, 82, 395–410. 10.1002/mrm.27714 [DOI] [PMC free article] [PubMed] [Google Scholar]
  15. Cook, P. A., Bai, Y., Hall, M. G., Nedjati-Gilani, S., Seunarine, K. K., & Alexander, D. C. (2005). Camino: Diffusion MRI reconstruction and processing. 10.54294/fgfrtv [DOI] [Google Scholar]
  16. Daducci, A., Canales-Rodríguez, E. J., Zhang, H., Dyrby, T. B., Alexander, D. C., & Thiran, J. P. (2015). Accelerated Microstructure Imaging via Convex Optimization (AMICO) from diffusion MRI data. Neuroimage, 105, 32–44. 10.1016/j.neuroimage.2014.10.026 [DOI] [PubMed] [Google Scholar]
  17. de Almeida Martins, J. P., Nilsson, M., Lampinen, B., Palombo, M., While, P. T., Westin, C. F., & Szczepankiewicz, F. (2021). Neural networks for parameter estimation in microstructural MRI: Application to a diffusion-relaxation model of white matter. Neuroimage, 244, 118601. 10.1016/j.neuroimage.2021.118601 [DOI] [PMC free article] [PubMed] [Google Scholar]
  18. Dong, Z., Wang, F., Wald, L., & Setsompop, K. (2022). SNR-efficient distortion-free diffusion relaxometry imaging using accelerated echo-train shifted echo-planar time-resolving imaging (ACE-EPTI). Magn Reson Med, 88, 164–179. 10.1002/MRM.29198 [DOI] [PubMed] [Google Scholar]
  19. Drobnjak, I., Zhang, H., Ianuş, A., Kaden, E., & Alexander, D. C. (2016). PGSE, OGSE, and sensitivity to axon diameter in diffusion MRI: Insight from a simulation study. Magn Reson Med, 75, 688–700. 10.1002/MRM.25631 [DOI] [PMC free article] [PubMed] [Google Scholar]
  20. Fair, M. J., Liao, C., Manhard, M. K., & Setsompop, K. (2021). Diffusion-PEPTIDE: Distortion- and blurring-free diffusion imaging with self-navigated motion-correction and relaxometry capabilities. Magn Reson Med, 85, 2417–2433. 10.1002/MRM.28579 [DOI] [PubMed] [Google Scholar]
  21. Fan, Q., Nummenmaa, A., Witzel, T., Ohringer, N., Tian, Q., Setsompop, K., Klawiter, E. C., Rosen, B. R., Wald, L. L., & Huang, S. Y. (2020). Axon diameter index estimation independent of fiber orientation distribution using high-gradient diffusion MRI. Neuroimage, 222, 117197. 10.1016/j.neuroimage.2020.117197 [DOI] [PMC free article] [PubMed] [Google Scholar]
  22. Fick, R. H. J., Wassermann, D., & Deriche, R. (2019). The Dmipy Toolbox: Diffusion MRI multi-compartment modeling and microstructure recovery made easy. Front Neuroinform, 13, 480105. 10.3389/FNINF.2019.00064 [DOI] [PMC free article] [PubMed] [Google Scholar]
  23. Gal, Y., & Ghahramani, Z. (2015). Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. In 33rd International Conference on Machine Learning, ICML 2016 3 (pp. 1651–1660). ACM. 10.1145/1102351.1102389 [DOI] [Google Scholar]
  24. Garyfallidis, E., Brett, M., Amirbekian, B., Rokem, A., van der Walt, S., Descoteaux, M., & Nimmo-Smith, I. (2014). Dipy, a library for the analysis of diffusion MRI data. Front Neuroinform, 8, 71423. 10.3389/FNINF.2014.00008 [DOI] [PMC free article] [PubMed] [Google Scholar]
  25. Gilks, W. R., Richardson, S., & Spiegelhalter, D. (1995). Markov chain Monte Carlo in practice. CRC Press. 10.1201/b14835 [DOI] [Google Scholar]
  26. Glasser, M. F., Sotiropoulos, S. N., Wilson, J. A., Coalson, T. S., Fischl, B., Andersson, J. L., Xu, J., Jbabdi, S., Webster, M., Polimeni, J. R., Van Essen, D. C., & Jenkinson, M. (2013). The minimal preprocessing pipelines for the Human Connectome Project. Neuroimage, 80, 105–124. 10.1016/j.neuroimage.2013.04.127 [DOI] [PMC free article] [PubMed] [Google Scholar]
  27. Gong, T., Dann, E., Maffei, C., Lee, H.-H., Lee, H., Bachevalierm, J., Huang, S., Haber, S., & Yendiki, A. (2024). Untangling grey matter microstructure development: Insights from soma, neurite, and myelin imaging on macaques. In Proceedings of the OHBM 2024 Annual Meeting, Seoul. p. 1315. 10.52294/001c.120593 [DOI] [Google Scholar]
  28. Gong, T., Fair, M. J., Setsompop, K., & Zhang, H. (2022). Enabling compartment-specific T2 and T2* mapping with Diffusion-PEPTIDE imaging. In Proceedings of the 2022 ISMRM & ISMRT Annual Meeting, London. p. 1347. 10.58530/2022/1347 [DOI] [Google Scholar]
  29. Gong, T., Grussu, F., Wheeler-Kingshott, C. A. M., Alexander, D. C., & Zhang, H. (2023a). Machine-learning-informed parameter estimation improves the reliability of spinal cord diffusion MRI. arXiv preprint arXiv:2301.12294. 10.58530/2022/0394 [DOI] [Google Scholar]
  30. Gong, T., He, H., Zhong, J., & Zhang, H. (2021a). MTE-NODDI made practical with learning-based acquisition and parameter-estimation acceleration. In Proceedings of the OHBM 2021 Annual Meeting. p. 2087. https://www.humanbrainmapping.org/files/ohbm2021_abstracts_v2.pdf [Google Scholar]
  31. Gong, T., Maffei, C., Dann, E., Lee, H.-H., Lee, H., Augustinack, J. C., Huang, S. Y., Haber, S. N., & Yendiki, A. (2025). Interplay between MRI-based axon diameter and myelination estimates in macaque and human brain. Imaging Neurosci, 3, imag_a_00576. 10.1162/IMAG_A_00576 [DOI] [PMC free article] [PubMed] [Google Scholar]
  32. Gong, T., Tax, C. M., Mancini, M., Jones, D. K., Zhang, H., & Palombo, M. (2023b). Multi-TE SANDI: Quantifying compartmental T2 relaxation times in the grey matter. In Proceedings of the 2023 ISMRM & ISMRT Annual Meeting, Toronto. p. 0766. 10.58530/2023/0766 [DOI]
  33. Gong, T., Tong, Q., He, H., Sun, Y., Zhong, J., & Zhang, H. (2020). MTE-NODDI: Multi-TE NODDI for disentangling non-T2-weighted signal fractions from compartment-specific T2 relaxation times. Neuroimage, 217, 116906. 10.1016/j.neuroimage.2020.116906 [DOI] [PubMed] [Google Scholar]
  34. Gong, T., Tong, Q., Li, Z., He, H., Zhang, H., & Zhong, J. (2021b). Deep learning-based method for reducing residual motion effects in diffusion parameter estimation. Magn Reson Med, 85, 2278–2293. 10.1002/MRM.28544 [DOI] [PubMed] [Google Scholar]
  35. Gyori, N. G., Palombo, M., Clark, C. A., Zhang, H., & Alexander, D. C. (2022). Training data distribution significantly impacts the estimation of tissue microstructure with machine learning. Magn Reson Med, 87(2), 932–947. 10.1002/mrm.29014 [DOI] [PubMed] [Google Scholar]
  36. Harms, R. L., & Roebroeck, A. (2018). Robust and fast Markov chain Monte Carlo sampling of diffusion MRI microstructure models. Front Neuroinform, 12, 97. 10.3389/FNINF.2018.00097/BIBTEX [DOI] [PMC free article] [PubMed] [Google Scholar]
  37. Hutter, J., Slator, P. J., Christiaens, D., Teixeira, R. P. A. G., Roberts, T., Jackson, L., Price, A. N., Malik, S., & Hajnal, J. V. (2018). Integrated and efficient diffusion-relaxometry using ZEBRA. Sci Rep, 8(1), 15138. 10.1038/s41598-018-33463-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
  38. Jallais, M., & Palombo, M. (2024). μGUIDE: A framework for quantitative imaging via generalized uncertainty-driven inference using deep learning. eLife, 13, RP101069. 10.7554/elife.101069.2 [DOI] [PMC free article] [PubMed] [Google Scholar]
  39. Jelescu, I. O., de Skowronski, A., Geffroy, F., Palombo, M., & Novikov, D. S. (2022). Neurite Exchange Imaging (NEXI): A minimal model of diffusion in gray matter with inter-compartment water exchange. Neuroimage, 256, 119277. 10.1016/j.neuroimage.2022.119277 [DOI] [PMC free article] [PubMed] [Google Scholar]
  40. Jensen, J. H. (2024). Diffusional kurtosis time dependence and the water exchange rate for the multi-compartment Kärger model. Magn Reson Med, 91, 1122–1135. 10.1002/MRM.29926 [DOI] [PMC free article] [PubMed] [Google Scholar]
  41. Jespersen, S. N., Bjarkam, C. R., Nyengaard, J. R., Chakravarty, M. M., Hansen, B., Vosegaard, T., Østergaard, L., Yablonskiy, D., Nielsen, N. C., & Vestergaard-Poulsen, P. (2010). Neurite density from magnetic resonance diffusion measurements at ultrahigh field: Comparison with light microscopy and electron microscopy. Neuroimage, 49, 205–216. 10.1016/J.NEUROIMAGE.2009.08.053 [DOI] [PMC free article] [PubMed] [Google Scholar]
  42. Jespersen, S. N., Kroenke, C. D., Østergaard, L., Ackerman, J. J. H., & Yablonskiy, D. A. (2007). Modeling dendrite density from magnetic resonance diffusion measurements. Neuroimage, 34, 1473–1486. 10.1016/j.neuroimage.2006.10.037 [DOI] [PubMed] [Google Scholar]
  43. Jun, Y., Liu, Q., Gong, T., Cho, J., Fujita, S., Yong, X., Huang, S. Y., Ning, L., Yendiki, A., & Rathi, Y. (2024). PRIME: Phase Reversed Interleaved Multi-Echo acquisition enables highly accelerated distortion-free diffusion MRI. arXiv preprint arXiv:2409.07375. 10.58530/2024/1010 [DOI] [PubMed] [Google Scholar]
  44. Kaden, E., Kelm, N. D., Carson, R. P., Does, M. D., & Alexander, D. C. (2016a). Multi-compartment microscopic diffusion imaging. Neuroimage, 139, 346–359. 10.1016/J.NEUROIMAGE.2016.06.002 [DOI] [PMC free article] [PubMed] [Google Scholar]
  45. Kaden, E., Kruggel, F., & Alexander, D. C. (2016b). Quantitative mapping of the per-axon diffusion coefficients in brain white matter. Magn Reson Med, 75, 1752–1763. 10.1002/MRM.25734 [DOI] [PMC free article] [PubMed] [Google Scholar]
  46. Kärger, J. (1985). NMR self-diffusion studies in heterogeneous systems. Adv Colloid Interface Sci, 23, 129–148. 10.1016/0001-8686(85)80018-X [DOI] [Google Scholar]
  47. Kroenke, C. D., Ackerman, J. J. H., & Yablonskiy, D. A. (2004). On the nature of the NAA diffusion attenuated MR signal in the central nervous system. Magn Reson Med, 52, 1052–1059. 10.1002/MRM.20260 [DOI] [PubMed] [Google Scholar]
  48. Lampinen, B., Szczepankiewicz, F., Novén, M., van Westen, D., Hansson, O., Englund, E., Mårtensson, J., Westin, C. F., & Nilsson, M. (2019). Searching for the neurite density with diffusion MRI: Challenges for biophysical modeling. Hum Brain Mapp, 40, 2529–2545. 10.1002/hbm.24542 [DOI] [PMC free article] [PubMed] [Google Scholar]
  49. Li, C., Fieremans, E., Novikov, D. S., Ge, Y., & Zhang, J. (2023). Measuring water exchange on a preclinical MRI system using filter exchange and diffusion time dependent kurtosis imaging. Magn Reson Med, 89, 1441–1455. 10.1002/MRM.29536 [DOI] [PMC free article] [PubMed] [Google Scholar]
  50. Li, Z., Gong, T., Lin, Z., He, H., Tong, Q., Li, C., Sun, Y., Yu, F., & Zhong, J. (2019). Fast and robust diffusion kurtosis parametric mapping using a three-dimensional convolutional neural network. IEEE Access, 7, 71398–71411. 10.1109/ACCESS.2019.2919241 [DOI] [Google Scholar]
  51. Lin, Z., Gong, T., Wang, K., Li, Z., He, H., Tong, Q., Yu, F., & Zhong, J. (2019). Fast learning of fiber orientation distribution function for MR tractography using convolutional neural network. Med Phys, 46(7), 3101–3116. 10.1002/mp.13555 [DOI] [PubMed] [Google Scholar]
  52. McKinnon, E. T., & Jensen, J. H. (2019). Measuring intra-axonal T 2 in white matter with direction-averaged diffusion MRI. Magn Reson Med, 81, 2985–2994. 10.1002/mrm.27617 [DOI] [PMC free article] [PubMed] [Google Scholar]
  53. Neuman, C. H. (1974). Spin echo of spins diffusing in a bounded medium. J Chem Phys, 60, 4508–4511. 10.1063/1.1680931 [DOI] [Google Scholar]
  54. Nilsson, M., Lasič, S., Drobnjak, I., Topgaard, D., & Westin, C. F. (2017). Resolution limit of cylinder diameter estimation by diffusion MRI: The impact of gradient waveform and orientation dispersion. NMR Biomed, 30(7), e3711. 10.1002/NBM.3711 [DOI] [PMC free article] [PubMed] [Google Scholar]
  55. Novikov, D. S., Fieremans, E., Jespersen, S. N., & Kiselev, V. G. (2019). Quantifying brain microstructure with diffusion MRI: Theory and parameter estimation. NMR Biomed, 32(4), e3998. 10.1002/nbm.3998 [DOI] [PMC free article] [PubMed] [Google Scholar]
  56. 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. 10.1016/J.NEUROIMAGE.2018.03.006 [DOI] [PMC free article] [PubMed] [Google Scholar]
  57. Olesen, J. L., Østergaard, L., Shemesh, N., & Jespersen, S. N. (2022). Diffusion time dependence, power-law scaling, and exchange in gray matter. Neuroimage, 251, 118976. 10.1016/j.neuroimage.2022.118976 [DOI] [PMC free article] [PubMed] [Google Scholar]
  58. Palombo, M., Ianus, A., Guerreri, M., Nunes, D., Alexander, D. C., Shemesh, N., & Zhang, H. (2020). SANDI: A compartment-based model for non-invasive apparent soma and neurite imaging by diffusion MRI. Neuroimage, 215, 116835. 10.1016/j.neuroimage.2020.116835 [DOI] [PMC free article] [PubMed] [Google Scholar]
  59. Palombo, M., Valindria, V., Singh, S., Chiou, E., Giganti, F., Pye, H., Whitaker, H. C., Atkinson, D., Punwani, S., Alexander, D. C., & Panagiotaki, E. (2023). Joint estimation of relaxation and diffusion tissue parameters for prostate cancer with relaxation-VERDICT MRI. Sci Rep, 13(1), 1–13. 10.1038/s41598-023-30182-1 [DOI] [PMC free article] [PubMed] [Google Scholar]
  60. Panagiotaki, E., Schneider, T., Siow, B., Hall, M. G., Lythgoe, M. F., & Alexander, D. C. (2012). Compartment models of the diffusion MR signal in brain white matter: A taxonomy and comparison. Neuroimage, 59, 2241–2254. 10.1016/j.neuroimage.2011.09.081 [DOI] [PubMed] [Google Scholar]
  61. Panagiotaki, E., Walker-Samuel, S., Siow, B., Johnson, S. P., Rajkumar, V., Pedley, R. B., Lythgoe, M. F., & Alexander, D. C. (2014). Noninvasive quantification of solid tumor microstructure using VERDICT MRI. Cancer Res, 74, 1902–1912. 10.1158/0008-5472.CAN-13-2511 [DOI] [PubMed] [Google Scholar]
  62. Reisert, M., Kiselev, V. G., & Dhital, B. (2019). A unique analytical solution of the white matter standard model using linear and planar encodings. Magn Reson Med, 81(6), 3819–3825. 10.1002/mrm.27685 [DOI] [PubMed] [Google Scholar]
  63. Schiavi, S., Palombo, M., Zacà, D., Tazza, F., Lapucci, C., Castellan, L., Costagli, M., & Inglese, M. (2023). Mapping tissue microstructure across the human brain on a clinical scanner with soma and neurite density image metrics. Hum Brain Mapp, 44(13), 4792–4811. 10.1002/HBM.26416 [DOI] [PMC free article] [PubMed] [Google Scholar]
  64. Shwartz-Ziv, R., Goldblum, M., Bansal, A., Bruss, C. B., LeCun, Y., & Wilson, A. G. (2024). Just how flexible are neural networks in practice? ArXiv. 10.48550/ARXIV.2406.11463 [DOI]
  65. Şimşek, K., Chakwizira, A., Nilsson, M., & Palombo, M. (2025). The role of dendritic spines in water exchange measurements with diffusion MRI: Time-Dependent Single Diffusion Encoding MRI. arXiv. 10.48550/arXiv.2506.18229 [DOI] [PMC free article] [PubMed] [Google Scholar]
  66. Slator, P. J., Palombo, M., Miller, K. L., Westin, C. F., Laun, F., Kim, D., Haldar, J. P., Benjamini, D., Lemberskiy, G., Martins de Almeida, J. P., & Hutter, J. (2021). Combined diffusion-relaxometry microstructure imaging: Current status and future prospects. Magn Reson Med, 86(6), 2987–3011. 10.1002/mrm.28963 [DOI] [PMC free article] [PubMed] [Google Scholar]
  67. Tariq, M., Schneider, T., Alexander, D. C., Gandini Wheeler-Kingshott, C. A., & Zhang, H. (2016). Bingham-NODDI: Mapping anisotropic orientation dispersion of neurites using diffusion MRI. Neuroimage, 133, 207–223. 10.1016/j.neuroimage.2016.01.046 [DOI] [PubMed] [Google Scholar]
  68. Tian, Q., Fan, Q., Witzel, T., Polackal, M. N., Ohringer, N. A., Ngamsombat, C., Russo, A. W., Machado, N., Brewer, K., Wang, F., Setsompop, K., Polimeni, J. R., Keil, B., Wald, L. L., Rosen, B. R., Klawiter, E. C., Nummenmaa, A., & Huang, S. Y. (2022). Comprehensive diffusion MRI dataset for in vivo human brain microstructure mapping using 300 mT/m gradients. Sci Data, 9(1), 1–11. 10.1038/s41597-021-01092-6 [DOI] [PMC free article] [PubMed] [Google Scholar]
  69. Tournier, J. D., Smith, R., Raffelt, D., Tabbara, R., Dhollander, T., Pietsch, M., Christiaens, D., Jeurissen, B., Yeh, C. H., & Connelly, A. (2019). MRtrix3: A fast, flexible and open software framework for medical image processing and visualisation. Neuroimage, 202, 116137. 10.1016/J.NEUROIMAGE.2019.116137 [DOI] [PubMed] [Google Scholar]
  70. Van Essen, D. C., Ugurbil, K., Auerbach, E., Barch, D., Behrens, T. E. J., Bucholz, R., Chang, A., Chen, L., Corbetta, M., Curtiss, S. W., Della Penna, S., Feinberg, D., Glasser, M. F., Harel, N., Heath, A. C., Larson-Prior, L., Marcus, D., Michalareas, G., Moeller, S.,… Yacoub, E. (2012). The Human Connectome Project: A data acquisition perspective. Neuroimage, 62(4), 2222–2231. 10.1016/j.neuroimage.2012.02.018 [DOI] [PMC free article] [PubMed] [Google Scholar]
  71. Van Gelderen, P., Des Pres, D., Van Zijl, P. C. M., & Moonen, C. T. W. (1994). Evaluation of restricted diffusion in cylinders. phosphocreatine in rabbit leg muscle. J Magn Reson B, 103, 255–260. 10.1006/JMRB.1994.1038 [DOI] [PubMed] [Google Scholar]
  72. Vehtari, A., Gelman, A., Simpson, D., Carpenter, B., & Bürkner, P.-C. (2019). Rank-normalization, folding, and localization: An improved R^ for assessing convergence of MCMC. arXiv [stat.CO]. 10.48550/ARXIV.1903.08008 [DOI]
  73. Veraart, J., Novikov, D. S., & Fieremans, E. (2018). TE dependent Diffusion Imaging (TEdDI) distinguishes between compartmental T 2 relaxation times. Neuroimage, 182, 360–369. 10.1016/j.neuroimage.2017.09.030 [DOI] [PMC free article] [PubMed] [Google Scholar]
  74. Veraart, J., Nunes, D., Rudrapatna, U., Fieremans, E., Jones, D. K., Novikov, D. S., & Shemesh, N. (2020). Noninvasive quantification of axon radii using diffusion MRI. eLife, 9, e49855. 10.7554/eLife.49855 [DOI] [PMC free article] [PubMed] [Google Scholar]
  75. Wang, F., Dong, Z., Reese, T. G., Bilgic, B., Katherine Manhard, M., Chen, J., Polimeni, J. R., Wald, L. L., & Setsompop, K. (2019). Echo Planar Time-resolved Imaging (EPTI). Magn Reson Med, 81, 3599. 10.1002/MRM.27673 [DOI] [PMC free article] [PubMed] [Google Scholar]
  76. Wongkornchaovalit, P., Shao, B., Li, L., Chen, Y., He, H., Zhong, J., & Gong, T. (2025). Multi-TE diffusion MRI dataset for exploring combined diffusion-relaxometry methods in microstructure imaging. Sci Data, 12(1), 1–10. 10.1038/s41597-025-05544-1 [DOI] [PMC free article] [PubMed] [Google Scholar]
  77. Zhang, H., Hubbard, P. L., Parker, G. J. M., & Alexander, D. C. (2011). Axon diameter mapping in the presence of orientation dispersion with diffusion MRI. Neuroimage, 56, 1301–1315. 10.1016/j.neuroimage.2011.01.084 [DOI] [PubMed] [Google Scholar]
  78. Zhang, H., Schneider, T., Wheeler-Kingshott, C. A., & Alexander, D. C. (2012). NODDI: Practical in vivo neurite orientation dispersion and density imaging of the human brain. Neuroimage, 61, 1000–1016. 10.1016/j.neuroimage.2012.03.072 [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The package source code can be found at https://github.com/Tinggong/Microstructure.jl. The code for implementing the experiments described in the demonstration section can be found at our documentation website as user tutorials: https://tinggong.github.io/Microstructure.jl/dev/. Data used in this study are either synthetic (as introduced in the tutorials) or publicly available.


Articles from Imaging Neuroscience are provided here courtesy of MIT Press

RESOURCES