Diffusion MRI
From water molecules to white-matter statistics.
Diffusion MRI measures how far water travels in a few tens of milliseconds. Because axons get in the way, that measurement carries the orientation and integrity of white matter. Getting from the raw signal to a defensible result takes eight steps. Every one of them has a demo you can break.
What the scanner measures
A diffusion-weighted sequence applies two strong, brief magnetic field gradients separated by a short delay. The first one tags each water molecule with a phase that depends on its position. The second one undoes that tag, but only for molecules that have not moved. Molecules that diffused during the delay end up with a leftover phase, and their signals no longer add up coherently. The more motion along the gradient direction, the more signal is lost.
How aggressively the sequence probes diffusion is summarised by the b-value, in s/mm². It combines gradient strength, duration, and the delay between the two pulses. For simple Gaussian diffusion the measured signal is
where D is the apparent diffusion coefficient along the gradient direction. In the brain, D is about 3 µm²/ms in cerebrospinal fluid, under 1 in gray matter, and in white matter it depends on where you look: roughly 1.7 along a bundle and 0.3 across it. That directional dependence is the entire reason the method works.
How much signal survives a diffusion gradient
Typical clinical research protocols use b = 1000 s/mm² with 30 to 64 gradient directions. Multi-shell protocols add b = 2000 or 3000 to support richer models. Higher b means more contrast between fiber populations and less signal overall, so the two are always traded against each other.
What a diffusion dataset looks like
A diffusion acquisition is not one image. It is a stack: a few images with no diffusion
weighting (the b=0 volumes, which look like a blurry T2-weighted scan), then one
volume per gradient direction. Each of those is the same slice with signal removed wherever water
moved along that particular direction. The dataset arrives as a 4D NIfTI file plus two text files, .bval and .bvec, listing the b-value and the unit gradient vector for
every volume.
A single diffusion-weighted image
Look at the two vertical bundles when the gradient points straight up: they darken, because water slides freely along the axons. Turn the gradient horizontal and they brighten, because membranes hinder motion across the fibers. The curved bundle shows the same effect but in a direction that changes along its length. A single voxel's signal across all directions is what every later model works from.
The .bvec file is written in the scanner's or converter's coordinate frame, not
necessarily the image's. A sign flip in one axis produces tracts that look plausible and are
completely wrong. Always check the gradient table visually, for example by confirming the
corpus callosum is red (left–right) on a direction-encoded map.
Tools: dcm2niix converts DICOM to NIfTI and writes the bval/bvec files. dwigradcheck in MRtrix3 tests the gradient table by running short tractography with each possible flip.
Artifacts, and where they come from
Diffusion images are acquired with echo-planar imaging, which reads an entire slice in about 50 ms to freeze motion. The price is that EPI is fragile. Three artifacts show up in almost every dataset, and all three are easiest to understand in k-space, the grid of spatial frequencies the scanner actually samples. The image is the inverse Fourier transform of that grid.
Where artifacts come from: the k-space view
Noise
Diffusion weighting throws signal away on purpose, so these are among the noisiest images in MRI. Worse, the magnitude operation turns zero-mean Gaussian noise into a Rician distribution with a positive floor, which biases every later estimate upward at low signal. Modern pipelines denoise first, usually with Marchenko–Pastur PCA, which separates the noise eigenvalues of a local patch from the signal ones.
Gibbs ringing
The scanner only samples k-space out to some maximum frequency. Truncating a Fourier series makes sharp edges overshoot and ring. Around the ventricles the ringing can push a white-matter voxel's b=0 signal below its diffusion-weighted signal, producing a negative diffusivity. Partial Fourier acquisitions make it worse. The standard fix shifts the image by sub-voxel amounts to find the position that minimises the oscillation.
Motion
If the head moves during a few phase-encode lines, those lines carry the wrong phase, and the reconstruction smears copies of the brain along the phase-encode axis. Within a single EPI shot this is rare, but slow drift between volumes is universal and is handled in the next step.
Tools: dwidenoise and mrdegibbs (MRtrix3), Patch2Self (DIPY).
Preprocessing: making the volumes agree
Every model in the next steps assumes that voxel (x, y, z) refers to the same piece of tissue in all 60-odd volumes. Three things break that assumption.
- Eddy currents. Switching the diffusion gradients on and off induces currents in the scanner's conductors, which produce their own small, slowly decaying fields. Each gradient direction induces a different one, so each volume is stretched, sheared, and shifted slightly differently along the phase-encode axis.
- Subject motion. A diffusion scan takes five to fifteen minutes. People drift. Each volume ends up in a slightly different position, and the gradient table needs rotating to match.
- Susceptibility distortion. Air in the sinuses and ear canals warps the main field, and EPI's slow phase-encode direction turns that into stretching and pile-up of signal near the frontal and temporal poles. It is the same in every volume, so it is fixed separately, usually from a pair of b=0 images acquired with opposite phase-encode directions.
Why eddy-current and motion correction come first
Notice what misalignment does to the fit: FA lights up around every edge, because the model sees a signal that changes between volumes and attributes it to anisotropy. The directions in the color map become noisy. None of this is subtle, and none of it is reversible once a model has been fit. Preprocessing is not optional.
Tools: topup and eddy (FSL), dwifslpreproc (MRtrix3 wrapper),
QSIPrep (an end-to-end preprocessing pipeline), SynB0-DisCo for distortion correction without a
reverse-phase scan.
Fitting a model: the diffusion tensor
With clean, aligned volumes, each voxel has one signal value per gradient direction. The oldest and still most common model, diffusion tensor imaging, assumes diffusion is Gaussian but can differ by direction, which is exactly a 3×3 symmetric matrix D. The signal model becomes
Taking the logarithm makes this linear in the six unknown elements of D plus ln S₀, so with at least seven measurements (one b=0 and six directions) it is an ordinary least-squares problem. In practice 30 or more directions are used to beat down noise. Decomposing D into eigenvalues and eigenvectors gives everything the field reports:
- Mean diffusivity (MD): the average of the three eigenvalues. Overall mobility.
- Fractional anisotropy (FA): how unequal the eigenvalues are, from 0 (sphere) to 1 (line). The most-reported number in the field.
- Axial and radial diffusivity: the largest eigenvalue, and the mean of the other two.
- The principal eigenvector: the estimated fiber direction, shown as red–green–blue for left–right, front–back, up–down.
The diffusion tensor as a shape
FA is not a measure of "white-matter integrity", however often the phrase appears. It drops when fibers cross, when axons fan, when a bundle is partial-volumed with cortex, and when SNR falls. It rises in the ventricle edge voxels that Gibbs ringing corrupts. Interpreting an FA change requires knowing which of those changed.
Tools: dtifit (FSL), dwi2tensor (MRtrix3), DIPY's TensorModel,
DSI Studio's reconstruction step.
Beyond the tensor: crossing fibers
A 2 mm voxel contains hundreds of thousands of axons, and in most of the white matter they do not all point the same way. Where the corpus callosum passes through the corticospinal tract, or where association bundles fan into cortex, a single ellipsoid cannot describe what is there. The tensor fit does not fail loudly; it returns a flattened disc with a low FA and a principal direction that points between the bundles.
Two bundles in one voxel
Models that handle this estimate an orientation distribution function, a function on the sphere with a peak for each fiber population, instead of a single direction. The main families:
- Constrained spherical deconvolution (CSD) assumes every bundle has the same response function, measured from the most coherent voxels, and deconvolves it out of the signal to leave the fiber orientation distribution.
- Q-ball and generalized q-sampling imaging (GQI) reconstruct the diffusion ODF more directly from the signal without assuming a response function. GQI is what DSI Studio uses, and it works on any sampling scheme.
- Multi-compartment models such as NODDI or ball-and-stick fit explicit tissue compartments and report their volume fractions, at the cost of stronger assumptions.
These need more and higher-b measurements than a tensor, which is why modern protocols are multi-shell. For scalar metrics GQI gives quantitative anisotropy (QA) per fiber peak rather than one FA per voxel, which is what makes tract-specific statistics possible later.
Tractography
Tractography reconstructs the long-range path of bundles by following local fiber directions from voxel to voxel. The deterministic version is nothing more than numerical integration: start at a seed, read the direction, step a fraction of a voxel, read again. Three parameters govern nearly everything about the result.
- Step size: smaller follows curves better and takes longer.
- Angular threshold: the sharpest turn allowed between steps. Too permissive and streamlines jump between bundles; too strict and they stop in curved ones.
- Termination threshold: stop when anisotropy drops, which keeps streamlines out of gray matter and CSF but also kills them in crossings if the metric is FA.
Streamline tractography, step by step
Probabilistic tractography samples the direction from the ODF instead of taking its peak, producing thousands of slightly different streamlines whose density reflects uncertainty. It finds more of the true pathways and also more false ones. Either way, the output is a set of polylines, and the step that matters most is the one after: filtering, by anatomical constraints, by whether a streamline connects plausible endpoints, or by whether its path is consistent with the signal (SIFT, LiFE).
A streamline is a hypothesis, not an axon. Tractography has a known tendency to generate many more false-positive bundles than false negatives, and the count of streamlines between two regions is not a measure of connection strength. Treat tracts as regions of interest for measuring something else, not as the measurement itself.
Tools: tckgen and tcksift (MRtrix3), DSI Studio's fiber tracking with
its automatic tract recognition, DIPY's LocalTracking, TrackVis.
Group analysis: turning maps into a claim
Every subject now has a map of FA, QA, or whatever metric the model produced, and a set of tracts. The research question is almost always comparative: does the metric differ between groups, change over time, or correlate with a score? Three strategies dominate.
- Region or tract averaging. Define a bundle, average the metric inside it, get one number per subject, run an ordinary test. Robust, low-powered, and blind to where along the bundle the effect sits.
- Voxel-wise and skeleton-based comparison (TBSS). Warp every subject's map to a template, project onto a white-matter skeleton to limit misalignment, test every skeleton voxel. The multiple-comparison problem is enormous, so inference is permutation-based.
- Connectometry and correlational tractography. Instead of testing voxels, test local fiber segments and track along the ones whose metric correlates with the variable of interest. The result is a tract, not a blob, and significance comes from permuting the variable and tracking again to see how long a spurious tract can get.
Finding a group difference along a tract, honestly
The common thread is permutation. Every method above runs the analysis many times on shuffled labels and asks how extreme the real result is against that distribution. It is slow, it is honest, and it is the only part of the pipeline that directly controls how often you publish noise.
Before any of this works, subjects must be in a common space. For diffusion data that means either warping scalar maps with a nonlinear registration or, in DSI Studio's case, building a population-average template of the ODFs themselves so that fiber orientations, not just intensities, align across people.
Tools: randomise and TBSS (FSL), DSI Studio connectometry, fixelcfestats (MRtrix3's fixel-based analysis), TractSeg for automatic bundle segmentation.