Skip to main content
Sandbox Physics
MRI spatial encoding

L2 · Chapter 4

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

One readout in Chapter 3 measures a single line: one kyk_y and a run of kxk_x. A two-dimensional image needs encoding along the other direction too. MRI does it by playing a brief yy gradient before each readout to choose kyk_y, reading a whole line, then repeating with the next kyk_y. All the lines together are called k-space, and they are exactly the two-dimensional Fourier transform of the image. This chapter explains what each k-space sample measures, where the scan time comes from, and why raw k-space data look nothing like an image.

Two gradients, two spatial frequencies

With gradients along both xx and yy, the water at (x,y)(x,y) gains the phase 2π(kxx+kyy)2\pi(k_xx+k_yy). The MIT handout writes the coil signal as the two-dimensional integral below: a fast oscillation shared by all positions, times the two-dimensional Fourier transform of the water density.

What does a sample (kx,ky)(k_x,k_y) measure? It compares the water distribution with a stripe pattern ei2π(kxx+kyy)e^{i2\pi(k_xx+k_yy)}. The stripes are perpendicular to the vector (kx,ky)(k_x,k_y) and 1/∣k∣1/|k| apart. Small kk means wide stripes that measure large-scale brightness; large kk means fine stripes that measure detail and edges.

s(kx,ky)=∬ρ(x,y) e−i2π(kxx+kyy) dx dys(k_x,k_y)=\iint\rho(x,y)\,e^{-i2\pi(k_xx+k_yy)}\,dx\,dy
The result on page 12 of the MIT handout without the common precession factor.
kx(t)=γˉ∫0tGx dτ,ky(t)=γˉ∫0tGy dτk_x(t)=\bar\gamma\int_0^tG_x\,d\tau,\qquad k_y(t)=\bar\gamma\int_0^tG_y\,d\tau
The time integrals of the gradients decide which spatial frequency is measured at each moment.
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.

Source: MIT 6.3000 Signal Processing · M. Lustig

Phase encoding: one line per excitation

The readout gradient points along xx, so one readout sweeps a whole line of kxk_x. Before the readout, a yy gradient of fixed duration and adjustable strength sets the kyk_y of that line by its area. There is no yy gradient during the readout, so the whole line shares one kyk_y. This step is called phase encoding because it only gives different yy positions different phases before the readout.

Line mm needs ky=mΔkk_y=m\Delta k, so the gradient areas of neighbouring lines differ by Δk/γˉ\Delta k/\bar\gamma. The longitudinal magnetization has to recover between excitations, so the lines are one repetition time TRT_R apart. The MIT handout works it out: 256 lines at 2 s each take about 8.5 minutes.

Lustig and co-workers point out that in Cartesian sampling the readout direction is always fully sampled; time can only be saved by recording fewer phase-encode lines, and the saving is exactly proportional to the fraction left out. Chapters 5 and 6 are about which lines to leave out and how to fill them in.

Tscan=Nlines×TRT_{\mathrm{scan}}=N_{\mathrm{lines}}\times T_R
One line per excitation. The readout itself takes a few milliseconds; nearly all the scan time is spent waiting for the magnetization to recover.

Source: MIT 6.3000 Signal Processing · M. Lustig

k-space data do not look like an image

The MIT handout shows a set of real k-space data. The magnitude needs a logarithmic scale to be seen at all, with almost all the energy near the centre, and the phase looks random. These measurements are not an image; they are its Fourier transform. Lustig and co-workers also note that most of an image’s energy is concentrated close to the k-space origin.

The image obtained by inverse Fourier transform has both a real and an imaginary part, because the signal path from excitation to reception adds phase delays. The MIT handout therefore takes the magnitude of the complex image as the final image.

The centre sample s(0,0)=∬ρ dx dys(0,0)=\iint\rho\,dx\,dy is the total amount of water in the sample. When the object moves by r0\mathbf r_0, every sample is multiplied by the phase factor e−i2πk⋅r0e^{-i2\pi\mathbf k\cdot\mathbf r_0} and keeps its magnitude. This is the shift theorem, and you will meet it again when you drag the phantom.

ρ(r−r0)  ⟷  s(k) e−i2πk⋅r0\rho(\mathbf r-\mathbf r_0)\;\longleftrightarrow\;s(\mathbf k)\,e^{-i2\pi\mathbf k\cdot\mathbf r_0}
A shift changes only the phase of k-space; the magnitude stays the same.

Source: MIT 6.3000 Signal Processing · M. Lustig

The exact transform of the phantom

The head phantom in the k-space experiment is a sum of nine uniform ellipses, a teaching phantom defined for this course. A uniform ellipse has an exact Fourier transform that uses the first-order Bessel function J1J_1, the counterpart of a sine for a circular edge, which oscillates and decays as its argument grows. Every k-space sample therefore comes straight from the continuous object; nothing is drawn as pixels and transformed.

The benchmark program checks this formula in two independent ways. It compares J1J_1 with Bessel’s integral directly, a difference of 2.2×10−92.2\times10^{-9}, and it cuts every ellipse into chords and integrates them one by one, which agrees with the formula to 6.7×10−106.7\times10^{-10} of the ellipse area or better.

F(k)=ρ ab J1(2πκ)κ e−i2πk⋅r0,κ=(aku)2+(bkv)2F(\mathbf k)=\rho\,ab\,\frac{J_1(2\pi\kappa)}{\kappa}\,e^{-i2\pi\mathbf k\cdot\mathbf r_0},\qquad \kappa=\sqrt{(ak_u)^2+(bk_v)^2}
Semi-axes aa and bb, centre r0\mathbf r_0; kuk_u and kvk_v are the components of k\mathbf k along the two axes of the ellipse.

Source: MIT 6.3000 Signal Processing · M. Lustig

Worked example: one 64-by-64 scan

Problem: a 256 mm field of view, a 64×6464\times64 matrix, TR=2 sT_R=2\,\mathrm s and phase-encoding gradients that last 1 ms. Find the k-space step, the largest spatial frequency, the pixel width, the scan time and the phase-encoding gradient of the outermost line. This is the full scan of the k-space experiment.

The step is Δk=1/0.256 m=3.906 m−1\Delta k=1/0.256\,\mathrm m=3.906\,\mathrm{m^{-1}}, the largest spatial frequency kmax⁡=32Δk=125 m−1k_{\max}=32\Delta k=125\,\mathrm{m^{-1}} and the pixel 256/64=4 mm256/64=4\,\mathrm{mm}. The scan takes 64×2 s=128 s=2.13 min64\times2\,\mathrm s=128\,\mathrm s=2.13\,\mathrm{min}; with 256 lines, as in the MIT handout, it would take 8.53 minutes.

Each step needs a gradient area of Δk/γˉ=3.906/(42.576×106)=9.17×10−8 T s/m\Delta k/\bar\gamma=3.906/(42.576\times10^6)=9.17\times10^{-8}\,\mathrm{T\,s/m}. Spread over 1 ms, the gradient grows by 0.0917 mT/m per step, and the outermost line, 32 steps out, needs 2.94 mT/m.

A related question from the MIT handout: how many (kx,ky)(k_x,k_y) pairs does a 10-inch square field of view need at 1 mm resolution? Ten inches is 254 mm, so 254 samples per side and 2542=64 516254^2=64\,516 in all; at 2 s per line the scan takes 8.47 minutes.

Source: MIT 6.3000 Signal Processing · M. Lustig

Try it in the Lab

Watch k-space fill line by line

  1. In the “Every line: the full scan” preset, watch the k-space record appear line by line and read the 2.13-minute scan time.
  2. Drag the head inside the bore. Predict from the shift theorem that the log magnitude of the k-space record hardly changes and only the phase does. Check against the record.
  3. Click a row near the edge of the k-space record to drop it, then drop a row at the centre instead. Which changes the image more? Explain it by the centre deciding large-scale brightness.

Exercises with explained answers

  1. How many phase-encode lines do a 200 mm field of view and 2 mm resolution need, and how long does the scan take with 2 s per line?

    Show the answer

    200/2=100200/2=100 lines, so the scan takes 100×2 s=200 s100\times2\,\mathrm s=200\,\mathrm s, about 3.33 minutes. The ISMRM diffusion problem set uses the same 100×100100\times100 matrix.

  2. The object moves 10 mm along yy. By how much does the phase of the line at ky=50 m−1k_y=50\,\mathrm{m^{-1}} change?

    Show the answer

    By 2πkyy0=2π×50×0.01=π2\pi k_y y_0=2\pi\times50\times0.01=\pi: the samples change sign and keep their magnitude.

  3. What can you learn from the single sample at the very centre of k-space?

    Show the answer

    Only s(0,0)=∬ρ dx dys(0,0)=\iint\rho\,dx\,dy, the total amount of water in the sample, with no information about position. That is exactly what the coil measures without any gradient.

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. 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