NMR and MRI physics · Intermediate

Diffusion weighting and b-value

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

Diffusion-weighted MRI makes the signal sensitive to random water motion by applying a pair of strong gradient pulses. The b-value combines gradient strength, duration and spacing into a single number that sets how strongly diffusion attenuates the signal. Higher b-values give more diffusion contrast but less signal.

Intuition

Imagine tagging water molecules with a phase 'label' that depends on position along a gradient. A second, opposite gradient then undoes the label. If molecules stayed still, the label would be perfectly undone and the signal would be unchanged. But molecules that wandered to a new position between the two pulses are unlabeled incorrectly, so their phases are scrambled and they contribute less to the net signal. The more the water moves (larger diffusion coefficient D), and the stronger the sensitizing gradients (larger b), the greater the signal loss. Free water, as in CSF, loses signal rapidly; water restricted by cell membranes, as in acute stroke or dense tumor, loses signal more slowly and appears bright on high-b images.

Key equations

S(b)=S0e−bD
(1)

Signal decays mono-exponentially with b-value; D is the diffusion coefficient.

b=γ2G2δ2(Δ−δ3)
(2)

b-value for the Stejskal-Tanner pulsed gradient pair: γ is gyromagnetic ratio, G gradient amplitude, δ pulse duration, Δ pulse separation.

ADC=ln⁡(S1/S2)b2−b1
(3)

Apparent diffusion coefficient estimated from two images with different b-values.

Derivation

  1. Spins at position x acquire phase proportional to γ times G times x times δ during the first gradient pulse.
  2. The second pulse applies the opposite phase after time Delta. Stationary spins have net phase zero.
  3. A spin that has displaced by a random distance has net phase proportional to γGδ times its displacement.
  4. Free diffusion gives Gaussian displacements with variance 2D times the diffusion time.
  5. Averaging the phase factor over a Gaussian distribution gives an exponential of minus one half the phase variance.
  6. Collecting the gradient and timing terms gives e−bD, with b=γ2G2δ2(Δ−δ/3).

Worked example

Problem

A voxel has signal 1000 at b=0 and 450 at b=1000 s/mm². Find the ADC, and the expected signal at b=2000 if decay stays mono-exponential.

  1. Use S=S0exp⁡(−bD), so D=ln⁡(S0/S)/b.
  2. Compute ln(1000/450) = ln(2.222) = 0.799.
  3. D = 0.799 / 1000 = 7.99e-4 mm²/s.
  4. At b=2000: S = 1000 × exp(-2000 × 7.99e-4) = 1000 × exp(-1.598).
  5. exp(-1.598) is about 0.202, so S is about 202.

Answer ADC ≈ 8.0 × 10⁻⁴ mm²/s; predicted signal at b=2000 ≈ 200.

Common mistakes

  • Thinking b-value is a property of the tissue; it is set by the scanner sequence.
  • Confusing ADC with true diffusion: ADC is an apparent value that includes perfusion, restriction and other effects.
  • Forgetting the b=0 reference image when calculating ADC.
  • Assuming a higher b-value is always better; signal-to-noise falls and the decay may be non-Gaussian.
  • Interpreting T2 shine-through as restricted diffusion without checking the ADC map.

Animation

Animation coming soon

The animated version of this lesson is being prepared for the web. In the Signals AI app, lessons are drawn step by step.

Code

scene.py(119 lines)
import sys
import numpy as np
from manim import *
from blocks import *

# Signal attenuation model: S = S0 * exp(-b * ADC)
# Typical brain tissue ADC ~ 0.9 x 10^-3 mm^2/s
ADC_VAL = 0.9e-3  # mm^2/s
S0 = 1.0


def signal(b_val):
    """Computed signal intensity for a given b-value."""
    return S0 * np.exp(-b_val * ADC_VAL)


def compute_trace():
    """Compute signal values for standard b-values."""
    # Standard b-values: 0, 500, 1000, 1500, 2000 s/mm^2
    b_vals = np.array([0, 500, 1000, 1500, 2000])
    sigs = signal(b_vals)
    return b_vals, sigs


B_VALS, SIG_VALS = compute_trace()


class Main(Scene):
    def construct(self):
        self.camera.background_color = "#101418"
        # Title
        TitleCard(self, "Diffusion Weighting", "Signal attenuation vs b-value")

        # Equation
        eq = MathTex(r"S = S_0 \, e^{-b \cdot \text{ADC}}", font_size=36)
        eq.to_edge(UP, buff=0.5).shift(DOWN * 0.5)
        self.play(Write(eq), run_time=1.5)

        # Curve plot
        # b-range: 0 to 2500
        b_range = np.linspace(0, 2500, 200)
        sig_range = signal(b_range)

        plot = CurvePlot(
            lambda b: signal(b),
            x_range=(0, 2500, 500),
            y_range=(0, 1.05, 0.2),
            x_label="b-value (s/mm²)",
            y_label="S / S₀",
            color=C_MAIN,
            x_length=8.0,
            y_length=4.0
        )
        plot.shift(DOWN * 0.5)
        self.play(Create(plot.axes), FadeIn(plot.labels), run_time=1.5)
        self.play(Create(plot.curve), run_time=2)

        # Mark specific b-values
        markers = VGroup()
        for b, s in zip(B_VALS, SIG_VALS):
            # Only mark if within plot range
            if b <= 2500:
                d = plot.dot_at(b)
                # Adjust dot position to be on the curve
                d.move_to(plot.axes.c2p(b, s))
                
                # Vertical dashed line
                line = DashedLine(
                    plot.axes.c2p(b, 0),
                    plot.axes.c2p(b, s),
                    color=C_ACCENT,
                    stroke_width=2
                )
                
                # Label
                lab = Text(f"b={b}", font_size=22, color=C_ACCENT)
                lab.next_to(d, UP, buff=0.15)
                
                # Signal value label on y-axis area
                sig_lab = Text(f"{s:.2f}", font_size=20, color=C_DIM)
                # Place to the right of the y-axis, but left of the curve start
                sig_lab.move_to(plot.axes.c2p(0, s))
                sig_lab.shift(LEFT * 0.3)  # Shift slightly left to avoid overlapping y-axis label
                
                markers.add(line, d, lab, sig_lab)
                self.play(Create(line), FadeIn(d), FadeIn(lab), FadeIn(sig_lab), run_time=0.6)

        # Explanation text
        expl = Text(
            "Higher b-value → stronger diffusion weighting → lower signal",
            font_size=24,
            color=C_DIM
        )
        expl.to_edge(DOWN, buff=0.8)
        self.play(FadeIn(expl), run_time=1)

        StepCaption(self, "The b-value controls the sensitivity to water diffusion.")
        self.wait(2)


if __name__ == "__main__" and "--selftest" in sys.argv:
    # Test 1: At b=0, signal should be S0
    assert abs(signal(0.0) - S0) < 1e-12
    
    # Test 2: Signal decays monotonically
    b_test = np.linspace(0, 2000, 100)
    s_test = signal(b_test)
    assert np.all(np.diff(s_test) < 0)
    
    # Test 3: Specific value check
    # At b = 1000, S/S0 = exp(-1000 * 0.9e-3) = exp(-0.9)
    expected = np.exp(-0.9)
    assert abs(signal(1000) - expected) < 1e-6
    
    # Test 4: Trace values match computation
    for b, s in zip(B_VALS, SIG_VALS):
        assert abs(s - signal(b)) < 1e-12
        
    print("ok")

The Manim scene code that draws this lesson's animation in the Signals AI app (Python, Manim Community).

ccBYNC© 2026 SignalsLab. Lesson text shared as is under CC BY-NC 4.0.