Skip to main content
Sandbox Physics
MRI spatial encoding

FR35 · An interactive course

MRI spatial encoding: from Bloch dynamics to k-space, undersampling and diffusion

An MRI scanner never takes a photograph. It records the voltage that precessing water induces in a coil, and every pixel is computed from that voltage. This course follows how: magnetization that precesses and relaxes, gradients that turn position into frequency, k-space filled one line at a time, the price of recording fewer lines, and a gradient pair that measures how far water moves. Each formula is worked out with numbers and checked against a simulation you can run.

readout of one lineline spacing: field of viewsolid: recordeddashed: skippedcentre dot: zero frequency
Each excitation records one line of k-space: the phase-encoding gradient picks kyk_y and the readout sweeps kxk_x. Solid lines are recorded and dashed lines skipped, as when every other line is kept. The spacing Δk=1/FOV\Delta k=1/\mathrm{FOV} sets the field of view; the extent NΔkN\Delta k sets the pixel. Original schematic.

From one spinning arrow to an image, a shortcut and a diffusion map

The first chapter follows the magnetization of water as it precesses and relaxes, and the second shows how a spin echo recovers the signal an uneven field seems to destroy. The third adds a gradient so that position becomes frequency and the coil signal becomes a Fourier transform. The fourth fills k-space one line per excitation and explains where the scan time goes. The fifth asks what happens when lines are left out, and the sixth repairs the damage with extra coils or with random skipping and a sparse fit. The seventh uses a pair of gradient pulses to measure how far water wanders. The last chapter reads the 2007 Sparse MRI paper.

You need derivatives, sines and cosines, and the idea of a vector. Complex numbers, the Fourier transform and the random walk are introduced where they first appear. FR35

  1. 01 · L1

    How proton magnetization precesses, tips over and recovers

    Derive the Bloch equations from torque, then compute the 3 T precession frequency, the field a 90° pulse needs, and the T1 and T2 relaxations.

  2. 02 · L2

    How a spin echo recovers a signal that seemed lost

    An uneven field makes the signal fade faster than T2. See how a 180° pulse realigns the phases, how T2* differs from T2, and why motion still costs signal.

  3. 03 · L2

    How a gradient turns position into frequency

    A field that grows with position makes water precess at a different frequency everywhere. Derive the Fourier signal, field of view, pixel size and folding.

  4. 04 · L2

    k-space: measuring the Fourier transform of an image line by line

    Gradients along two axes give a 2D spatial frequency. Fill k-space one line per excitation, compute scan time and gradient steps, and read raw k-space data.

  5. 05 · L3

    Sampling, wraparound and resolution: what one missing line does

    The k-space step sets the field of view; the largest frequency sets the pixel. See why skipped lines fold the head, centre-only lines blur, and noise grows.

  6. 06 · L3

    Undersampled reconstruction: why random skipping can be repaired and regular skipping cannot

    Regular skipping folds the image into copies that only extra coils can separate. Random skipping spreads the gap as noise that a sparsity prior removes.

  7. 07 · L3

    Diffusion encoding: how a gradient pair measures how far water moves

    Two opposed gradient pulses rephase still water but not moving water. Derive the exponential decay from a random walk, compute b, and see membranes slow it.

  8. 08 · L4

    Reading the 2007 Sparse MRI paper by Lustig, Donoho and Pauly

    Read the founding compressed-sensing MRI paper: its three requirements, Eq. [1], sampling design, reconstruction and results, with two claims recomputed.

Experiments along the way

All three experiments run models, not scanner data. Frequency encoding computes the coil signal of uniform water tubes in closed form and checks it against a Bloch-equation integration of many small groups of water; the k-space experiment samples the exact Fourier transform of a teaching phantom made of ellipses; diffusion encoding follows thousands of random walkers through a gradient pair. Each shows its independent checks beside the model output, and none makes a clinical claim. Chapters 1 and 2 also use two earlier experiments on free induction and inversion recovery.

Sources and what we recomputed

  1. MIT 6.3000 Signal Processing, Magnetic Resonance Imaging lecture handout (6 May 2025), data and examples from E. Adalsteinsson

    Read in full. Page 9: the proton gyromagnetic ratio rounded to 42.58 MHz/T. Pages 11–13: gradient fields, the phase integral and the definition of k as the time integral of the gradient. Pages 15–18: k-space data, the complex image and its magnitude. Page 19: 256 lines at 2 s each, about 8.5 minutes. Pages 20–21: keeping only even columns of k-space. Pages 24–36: two-coil unfolding, including the coil pair whose sensitivities cannot separate the folded pixels. The handout uses the sign convention of the Fourier kernel that this course follows.

  2. F. Bloch, Nuclear induction, Physical Review 70, 460 (1946), doi:10.1103/PhysRev.70.460

    Read in full from a scanned copy. Eq. 11 (precession of the polarization), Eq. 32 (longitudinal relaxation time), Eqs. 33–35 (transverse relaxation time from an effective field irregularity, with the estimate of about 1e-4 s), Eq. 37 and Eqs. 38a–c (the equations with both relaxation times), Eqs. 40–42 (the rotating-frame variables). Bloch writes in Gaussian units with H for the field; the course restates the equations in SI units with B.

  3. J. Hrabe, G. Kaur and D. N. Guilfoyle, Principles and limitations of NMR diffusion measurements, Journal of Medical Physics 32(1), 34–42 (2007), doi:10.4103/0971-6203.31148

    Read in full (PubMed Central). Introduction: Hahn’s 1950 observation, the Stejskal–Tanner pulsed gradients and Eqs. 1–3. Eqs. 4–10 (the binomial random walk, D from Eq. 7, Einstein’s relation in Eqs. 8 and 10). Eq. 11 (Larmor frequency, with 2π × 42.576 MHz/T for the proton). Eqs. 12–14 (signal of the lattice walk, the b-value of Eq. 13 and the discrete Stejskal–Tanner form) and Eqs. 15–17 (the continuous limit). The pitfalls section: imaging gradients, local gradients, dependence on the diffusion time and tissue compartments. The 1950 and 1965 papers it cites were not opened.

  4. F. Szczepankiewicz and J. Hutter, Diffusion MRI acquisition basics, problems and answers, ISMRM 2019 educational session

    Read in full. Problem A1 and its answer (Eqs. 2–4): two 40 mT/m, 10 ms pulses with onsets 50 ms apart give 0.53 ms/µm², and three axes together triple b. Problem A2 and its answer (Eqs. 1 and 5–7): b as the time integral of q squared and its closed form for rectangular pulses. Part B: the echo-time budget of a spin-echo diffusion sequence. The value of γ used there is 2.68 × 10⁸ per second per tesla.

  5. M. Lustig, D. Donoho and J. M. Pauly, Sparse MRI: the application of compressed sensing for rapid MR imaging, Magnetic Resonance in Medicine 58, 1182–1195 (2007), doi:10.1002/mrm.21391

    Read in full. Fig. 1 and the three requirements of compressed sensing; Fig. 2 (a 256-sample sparse signal, 8-fold undersampled); Eq. 1 (spread of the interference) and its derivation in Appendix B, which the text calls Appendix II; the remark that single-slice 2DFT interference is D^{1/4} larger; Eq. 2 (transform point spread); Eqs. 3–4 (constrained reconstruction); Appendix A, Eqs. A1–A3 (Lagrangian form and nonlinear conjugate gradients, 80 to 200 iterations); Results and Discussion (2.4-fold brain, 5-fold angiography from 22 s to 4.4 s, loss of low-contrast features). The in-vivo images are described, not reproduced.

FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy