Start here
An MRI scanner makes its picture from the radio signal of the protons in water. The page
builds that up in four steps, one per tab.
1 · One axis. A row of spins, tipped over by a pulse, turns in a magnetic field.
The field rises along the sample (the tilted line), so each spin turns at a rate that tells
where it is, and the signal's spectrum is a picture of the sample along that line. Drag the
pieces of the sample and watch the spectrum follow; tilt the field line and watch it widen.
2 · A slice. A head, and a gradient along the body. A pulse that holds only a
narrow band of frequencies tips only the spins whose frequency is in the band: one slice.
Drag the band, or click the head where you want the slice; watch the spins tip over.
3 · The second axis. The slice's spins, coloured by their phase; k-space, filling
one row each time the sequence plays; and the picture made from the rows measured so far,
which sharpens as they come in. Watch the stripes the gradients wind in the spins: each row
of k-space is the slice measured against one set of stripes. Click a row to measure it;
point at k-space to see its stripes.
4 · Contrast and artefacts. The finished picture, with its settings: drag the TR
and TE lines and watch which tissues turn bright; shrink the field of view, drop lines, add
noise, shift the fat. Then the same picture in weaker magnets, down to the Earth's field,
where the signal is tiny. And how MRI began, in 1973, without phase encoding.
1. A field that rises along x turns position into frequency
Two tubes of water, 12 mm and 6 mm wide, in a field that rises by $G=2$ mT/m along $x$.
A π/2 pulse tips every spin into the plane (the NMR demo shows how), and
then each turns at its own Larmor frequency,
$$f(x)=\bar\gamma\,(B_0+Gx),\qquad \bar\gamma=\frac{\gamma}{2\pi}=42.58\ \mathrm{MHz/T}.$$
The page watches from a frame that turns at $f_0=\bar\gamma B_0$ (63.87 MHz at 1.5 T), as the
receiver does, so what is left is $\bar\gamma Gx$: 85.2 Hz for every millimetre. Watch the
arrows: those on the right turn clockwise, those on the left the other way, the faster the
further out. The signal is the sum of all the arrows, and its spectrum is the sample: each
tube becomes a band of frequencies as wide as it is, $\Delta f=\bar\gamma G\,w$ (1.02 kHz
for the 12 mm tube). Read it backwards, $x=\Delta f/\bar\gamma G$, and you have a picture
along one line: a one-dimensional image. Now drag the gradient to zero: every spin turns at
$f_0$, the arrows stay together, and the spectrum is one line.
2. Move a tube, and its frequencies move with it
One tube, 20 mm wide, 10 mm left of the centre. Drag it about by its middle, or widen it by
its sides: its band in the spectrum follows, through the lines that join each edge to its
frequency. Every 10 mm it moves, its band moves $10\,\bar\gamma G=0.852$ kHz; at the
centre it sits at $f_0$, and its spins stand still in this frame. Point at the spectrum: the
dashed line goes back up to the spins that turn at that frequency. Drag the top of a tube
down to give it fewer protons (a tube of oil, or of a gel): its band is lower in proportion,
since the spectrum counts the spins at each frequency.
3. A stronger gradient spreads the same tubes over more frequencies
The same two tubes at $G=5$ mT/m: 212.9 Hz per mm, so the spectrum is 2.5 times as wide and
1 kHz is now 4.70 mm, not 11.74 mm. The lines from the tubes to the spectrum fan out further.
The arrows also wind up 2.5 times as fast, so the record needed for the same detail is shorter,
1.174 ms instead of 2.936 ms (the page stops listening when neighbouring arrows, 2 mm apart,
point opposite ways: experiment 5). Scanners use gradients of tens of mT/m, and a field of
1.5 T rises by only $5\times32=0.16$ mT across this sample, about a ten-thousandth of
itself; that is enough.
4. The phase winds across the sample, and the signal is how much of it is left
One tube, 20 mm wide, slowed down. Under the gradient the phase winds along $x$ (the
colours in the strip): after a time $t$ it has wound once every $1/k$ mm, with
$$k=\bar\gamma G\,t,$$
the turns per millimetre (the top axis of the signal's record). The signal is the sum of the
arrows, so it is the overlap of the tube with that winding. At $t=1/(\bar\gamma G w)=0.587$
ms exactly one turn fits in the tube: its arrows point every way, and the signal is zero.
Half a turn more and the signal comes back, upside down, to 21.6% at 0.840 ms (the first lobe
of a sinc, the transform of a block, is 21.7%; the magnet's slight unevenness takes the
rest). So each moment of the record measures one spatial frequency $k$ of the
sample: its Fourier component $\int\rho(x)\,e^{-2\pi ikx}dx$. That is why its spectrum is
the profile: the record is the profile's Fourier transform, written down one $k$ at a time.
5. The longer you listen, the finer the detail
Three tubes 3 mm wide and 7 mm apart. The spectrum so far starts as one blob, and only
later splits into three: a record that has reached $k$ can show detail down to $1/2k$ (the
readout says how fine, as it goes). The page stops at $k=0.25$ per mm, when neighbouring
arrows 2 mm apart point opposite ways, and the detail is 2 mm: the arrows are the pixels of
this one-dimensional image. Listening longer would show finer detail, but only for spins
closer together than the arrows. (Under More , a magnet whose field is not quite
even: with $T_2^*=2$ ms neighbouring spins drift apart even with no gradient, and the signal
falls by $e$ every 2 ms; in the spectrum each edge blurs by about $1/\pi T_2^*=159$ Hz, 1.9 mm
at this gradient.)
6. A pulse with a band of frequencies tips one slice
Now a gradient along the body, $G_z=4$ mT/m: the Larmor frequency rises 170.3 Hz for every
millimetre up the head (the line on the left). The pulse is a sinc in time, 3 ms long, so its
frequencies are a band, nearly a box (the close-up): it holds $f_0\pm0.75$ kHz and almost
nothing else. A spin is tipped only if the pulse holds its frequency, so only the spins
where the band meets the line are tipped (the arrows on the right fall over; the rest stay
up along $B_0$), a slab
$$\Delta z=\frac{\Delta f}{\bar\gamma G_z}=\frac{1.5\ \mathrm{kHz}}{170.3\ \mathrm{Hz/mm}}=8.81\ \mathrm{mm}$$
thick. The slab the spins show is 9.45 mm wide at half height: the rule holds for small
tips (8.86 mm at 30°, under More ), and a 90° pulse tips a little wider. This is a
resonance doing the work: a spin out of the band is driven at the wrong frequency, and the
pulse only makes it wobble.
7. Tune the pulse, and the slice moves
The slice is wherever the spins' frequency matches the pulse's, at
$z=f_c/\bar\gamma G_z$. The pulse is tuned to $f_c=-6.47$ kHz below $f_0$, which puts the
slice 38 mm down, through the eyes (the picture from above, top right). Drag the band, or
click the head: up at $z=+40$ mm ($f_c=+6.81$ kHz) the ventricles have gone, and above the top
of the head there is nothing to tip. A scanner moves its slices this way, by retuning the
pulse, not by moving the patient.
8. Two ways to a thinner slice
The band at half its width, $\Delta f=0.75$ kHz: the rule says 4.40 mm, but the spins show
5.60 mm. A sinc 3 ms long that holds so few frequencies has hardly any lobes beside its
middle (look at the pulse), and its band is rounded rather than a box. Instead put the band
back to 1.5 kHz and double the gradient to 8 mT/m: the slice is again 4.40 mm by the rule,
and 4.72 mm as tipped, because the pulse is the same. A sharp band needs a pulse that lasts
many times $1/\Delta f$: under More , a 0.5 kHz band takes an 8 ms pulse to tip
3.22 mm (2.94 by the rule; 4.75 with 3 ms). Strong gradients are how scanners make thin
slices quickly.
9. The gradient twists the slab; the reversed lobe untwists it
The rephasing lobe is off. While the pulse plays, the gradient is on, so the spins across
the slab keep turning at their different frequencies: the slab ends twisted, its phase
changing from one face to the other (the colours across it). Twisted, its spins add up to
only 3.0% of what they would in step, and the slice would give almost no signal. Turn the
lobe on: after the pulse the gradient is reversed for half the pulse's length, and every
spin turns back by the twist it gained since the middle of the pulse (where, for a sinc,
the tipping happens). The slab ends in step, 95.5% (a 90° tip leaves a little twist). The
page watches from a frame that turns with the slab's centre, so its spins end along $x'$
wherever the slice is.
10. One step of phase encoding winds one plane wave across the slice
One line in slow motion, row +10 of k-space. Watch the spins as the $G_y$ lobe plays
(the third row of the sequence): for 2 ms the field rises along $y$ by $G_y=0.459$ mT/m, the
spins high in the slice turn faster than those low down, and the phase winds into stripes
along $y$,
$$k_y=\bar\gamma\,G_y\,T_{pe}=0.0391\ \mathrm{per\ mm},$$
one turn every 25.6 mm. Then the lobe stops and the stripes stay: the spins remember. That is
the whole trick of the second axis. Each line winds a different number of turns across $y$,
one step of the ladder of $G_y$ lobes, and the signal measures how much of the slice is in
step with those stripes, exactly as a plane wave $e^{-2\pi i\vec k\cdot\vec r}$ of the
plane-wave demo picks out one Fourier component. The readout then
adds stripes along $x$ that sweep while the ADC listens, so one line measures a whole row of
k-space, at one $k_y$. (In a spin echo the lobe winds $-k_y$ and the π pulse turns it into
$+k_y$: the dot in k-space jumps through the centre.) Point at any pixel of k-space to see the
stripes it stands for: the 2D Fourier transform demo 's pixels mean the
same.
11. Line by line, the picture forms
The scan from the start, as the view opens: the first lines slowly, then faster. Each line
fills one row of k-space (in the FFT demo's colours: hue for the phase, brightness for the
size), and the picture on the right is the inverse 2D Fourier transform of the rows measured
so far, the rest taken as zero. The middle rows come first (Centre out ): after 7 of
them the head is a blur, detail along $y$ only down to 36.6 mm, but already as bright as it
will be; with every pair of rows the detail along $y$ improves, to 4.0 mm with all 64, as fine
as the readout gives along $x$. A real scanner waits a repeat time, TR = 500 ms here, between
lines, so this 64-line picture takes 32 s; the page skips the waiting.
12. The middle of k-space holds the picture; the edges hold its edges
Only the middle 16 rows of 64. They hold 86.7% of the signal's energy, and with them alone
the picture has its brightness right (its mean is 1.06 of the true one) but no sharp edges:
the middle of k-space is the slow variations, the contrast between tissues. Press Only the
edges : the other 48 rows, 13% of the energy, give only outlines, a picture whose mean is
31% of the true one. Fine detail lives far from the centre of k-space, because a sharp edge
needs stripes close together to describe it. (Fast scans use this: measure the middle often
and the edges once.)
13. The π pulse: why a spin echo sits in the middle of k-space
A poor magnet: every spin is a little off its frequency (a spread of width
$1/\pi T_2'$ with $T_2'=8$ ms), so after the π/2 pulse the spins drift out of step, speckling
the phase picture with random colours, and the signal would fade as $e^{-t/T_2'}$. At TE/2
comes the π pulse (one spin's view of it in the NMR demo ). It turns every spin's phase around, $\varphi\to-\varphi$, so a spin that
had run ahead is now as far behind, and it goes on running ahead at the same rate: at TE they
are all back in step, whatever their offsets. The same π pulse turns the gradients' phase
around too, $\vec k\to-\vec k$ (the dot jumps through the centre of k-space), so the readout
passes through $k=0$ exactly at TE. There the speckle has gone and the echo is 100% of what
the spins give; then it fades again. Choose Gradient echo (no π pulse; TE kept at
20 ms): the gradient still makes an echo at $k=0$, but nothing undoes the magnet's spread,
and the echo is 7.3% of the spin echo's (about $e^{-TE/T_2'}=8\%$). That is the difference
between $T_2$ and $T_2^*$ weighting (experiment 15), and the reason the π pulse is there.
14. Move during the scan
Three disks, scanned at 5 lines a second from the bottom row of k-space to the top, as most
scanners go. Half-way through, drag a disk (the bright one, fat) to another place on the left
picture. The rows measured before the move saw it in one place, the rest in the other, and no
single picture has that k-space: the disk shows twice, each half as bright, and ghosts of it are
smeared along $y$, the phase-encoding direction, where each row is a different moment.
Along $x$ the picture is sharp, because each row was read out in 3 ms. This is why patients
are asked to hold still, and why breathing and the heartbeat smear MRI pictures along the
phase-encoding direction. (Once a scan is over, any change measures every row again at
once.)
15. TR and TE choose what is bright
The same slice; only two times change, and as the view opens they glide by themselves
from T₁- to T₂-weighting and back (drag either line to take over; Sweep restarts it). After each π/2 pulse the spins recover along $z$
at their own pace, $1-e^{-t/T_1}$ (left), and the next pulse, a repeat time TR later, can only
tip what has come back. After the pulse the echo fades as $e^{-t/T_2}$ (right), and it is
read at the echo time TE. So each tissue's brightness is
$$S=\rho\,(1-e^{-TR/T_1})\,e^{-TE/T_2},$$
the dots where the lines cross the curves. T₁-weighted , TR 500 ms and TE 15 ms:
the tissues differ in how far they have recovered, and fat (T₁ 260 ms) is brightest, 0.672,
the fluid in the ventricles (T₁ 4 s) darkest, 0.117; white matter (0.318) is brighter than
grey (0.282), and the lesion is dark (0.237). T₂-weighted , TR 3000 ms and TE 100 ms:
all have nearly recovered, and what differs is the fading, so fluid with its long T₂ is
brightest, 0.502, with the oedema of the lesion close behind (0.472): this is how lesions are
found. Proton density , TR 3000 ms and TE 15 ms: little fading and much recovery,
so the count of protons shows (fat 0.788, grey 0.659, white 0.587); the fluid is still only
0.524, because 3 s is not long for its T₁, and a TR of 8 s makes it the brightest (0.858).
Drag the lines; the picture follows at once.
16. A field of view smaller than the head wraps it round
The field of view is 180 mm, and the head is 220 mm from front to back. K-space is sampled
every $1/\mathrm{FOV}$ along $k_y$, and a signal sampled that often cannot tell $y$ from
$y\pm\mathrm{FOV}$ (the phase it winds differs by whole turns), so what lies outside the
field of view is folded in, 180 mm away: the scalp at the back of the head, $y=-110$ to
$-104$ mm, shows at $+70$ to $+76$ mm, inside the front of the picture, and the front of
the head at the back. Along $x$ nothing folds: the receiver samples the readout faster than
it needs and filters out frequencies from outside the field of view (the head's sides are
simply cut off). Widen the field of view to 220 mm and the wrap goes; scanners choose the
phase-encoding direction along the shorter side of the body to keep it short.
17. Fewer phase-encoding lines: blur and ringing along y
Only the middle 32 rows of 128. Along $x$ the readout still gives 2 mm pixels, but along
$y$ the highest spatial frequency measured is 16 rows from the centre, so detail along $y$ is
only $256/32=8$ mm: the thin scalp is smeared to 74% of its height, and the edges ring, in
ripples along $y$ that make the white matter swing from 95% to 106% of its value (the Gibbs
ripple of a Fourier series cut short). Along $x$ there is no ringing. A scan with fewer lines
is faster in proportion, which is the usual trade; the lines can be chosen cleverly, the
middle ones most (experiment 12).
18. Noise, and averaging it away
The receiver adds noise to every sample, here 5% of the brightest pixel's signal; since the
inverse FFT is unitary, the picture's pixels get the same 5%, the grain in the dark around
the head. Measure every line 4 times and average: the signal stays, the noise falls as
$1/\sqrt4$, to 2.5%, and the scan takes 4 times as long. Signal-to-noise is the currency of
MRI: it grows with the volume of a pixel and with $\sqrt{\text{time}}$, and with the field,
which is why scanners went from 0.15 T to 3 T and more.
19. Fat's chemical shift moves it along the readout
Fat's protons sit in molecules whose electrons shield them a little more than water's, so
they turn 3.4 parts per million slower: 217 Hz at 1.5 T. The readout reads frequency as
position, $x=f/\bar\gamma G_x$, so fat is drawn $217\ \mathrm{Hz}/\bar\gamma G_x$ too
far to the low side: about 1.3 mm with $G_x=4$ mT/m, hardly a pixel. Here $G_x$ is 0.5 mT/m, and
the shift is 10.2 mm: the scalp's fat slides off the skull to the left (a bright band where
it overlaps the brain's edge, a dark gap on the right), and the pocket of fat leaves its
place (dashed: where the fat is). A weak readout gradient also means a long readout, so TE
cannot be shorter than 31.5 ms. Along $y$ nothing moves: phase encoding is the same for fat
and water. At 3 T the shift doubles.
20. The echo fades while it is read, and the picture smears along x
So far each line was read as if all of it came at the echo. But a readout takes time, and
the echo goes on changing while it is read. Here the readout gradient is weak (0.3 mT/m) and
the pixels 1 mm, so the readout lasts 78.3 ms (the band on the echo's curves), and the magnet
is a poor one, $T_2'=4$ ms (half experiment 13's); Decay during the readout is on.
The π pulse brings the spins of each pixel back in step only at the echo; before and after,
they drift apart again, as $e^{-|t-TE|/T_2'}$. The early and late samples are the edges of
k-space along $k_x$, and a spread of frequencies in a pixel is a spread of positions along
the readout: each pixel is smeared along $x$, into a Lorentzian as wide as
$$\Delta x=\frac{1}{\pi T_2'\,\bar\gamma G_x}=\frac{T_{ro}}{\pi T_2'}\ \text{pixels}=6.23\ \text{mm}.$$
The scalp, 7 mm thick, keeps its 7.0 mm at the front and back (along $y$), but at the sides
it spreads to 11.1 mm and its brightness falls from 0.26 to 0.16; the pocket of fat is
drawn out sideways. Along $y$ nothing smears: each line's phase is wound before its readout
begins. Give the magnet back its 60 ms (under More ): 0.42 pixels; or the readout
gradient 4 mT/m, a readout of 5.9 ms: 0.47 pixels. T₂ goes on fading during the readout
too, but it dims as it smears: a T₂ short enough to smear a tissue by a pixel has faded it
below $e^{-\pi/2}=21\%$ by the echo, so in a readout centred on the echo its smear hardly
shows. Choose Gradient echo : $T_2^*$ is under 4 ms and the echo comes at 81 ms, by
when nothing is left (the bars); the picture, scaled up some 700 000 times, is what the start
of the readout caught before the signal faded, the edges of k-space: outlines. (View 1 shows the same smear in one
dimension, experiment 5.)
21. At 0.117 T, T₁ is shorter and grey and white matter look alike
The TeachSpin's magnet of the NMR demo , 0.117 T, protons
at 5.000 MHz; low-field scanners image heads at about this field. Three things change from
1.5 T. The signal: each proton gives $(B_0/1.5\ \mathrm{T})^2=1/163$ as much (its
polarization falls with the field, and so does the voltage it induces, turning more slowly),
which a low-field scanner makes up with bigger pixels and longer scans. The chemical shift,
3.4 ppm of 5 MHz: 17 Hz, 0.10 mm at 4 mT/m. And T₁: the protons of tissue give up their
energy through the slow motions of big molecules, which match a low Larmor frequency better,
so T₁ shortens with the field: grey matter 427 ms, white 341, fat 155 (950, 650 and 260 at
1.5 T; from values measured in heads at 50 mT, O'Reilly and Webb 2022). Water's barely
changes, 3.77 s: its molecules tumble far faster than any of these frequencies. T₁-weighted
(TR 500 ms, TE 15 ms), every tissue has recovered further, and grey (0.475) and white matter
(0.456) look alike: at 1.5 T white was 13% brighter than grey, here it is 4% darker. A
shorter TR does not bring it back (250 ms: 0.305 against 0.308): the ratio of their T₁s has
fallen from 1.46 to 1.25, too little to beat white matter's fewer protons. Press
T₂-weighted : T₂ hardly depends on the field, and the picture is nearly the 1.5 T
one (fluid 0.522, grey 0.294, white 0.230, against 0.502, 0.282 and 0.228), which is why
low-field scanners lean on T₂.
22. The same picture at 46 µT: what changes and why
No magnet at all: the Earth's field, 46.0 µT where the NMR demo's
board is, protons at 1959.8 Hz. The sample is the honest
one at this field, tubes standing in the board's coil: tap water, water with copper
sulphate, oil, and two thin tubes of water. The gradient must be weak next to $B_0$:
100 µT/m, 4.26 Hz per mm (not the 170 of 4 mT/m). Stronger, it would be a good part of the
field itself, and by Maxwell's equations a $B_z$ that grows along $x$ comes with a $B_x$ that
grows along $z$, which misplaces the tubes' ends, 50 mm up and down, by $Gz^2/2B_0=2.72$ mm.
So the readout is slow, 58.7 ms (1.5 ms at 1.5 T), and the echo cannot come before TE =
134 ms. The relaxation times : water's are seconds at every field, and the copper
sulphate's ions bring its T₁ to 0.3 s and T₂ to 0.25 s; at so long an echo oil (T₂ 80 ms) has
nearly gone (0.178), the copper sulphate dims (0.586), and tap water is brightest (0.654), short
of 1 because 3 s of polarizing is not much more than its T₁ of 2.5 s. The chemical
shift : 3.4 ppm of 1960 Hz is 6.7 mHz, which the readout reads as 0.0016 mm, so the oil
stays where it is (dashed); at 1.5 T it moves 1.3 mm. The signal : the Earth's field
would polarize the water 170 times less than the board's coil does (7.84 mT for 3 s before
each line), and the voltage a proton induces goes as the field it turns in, so each gives
1.6 × 10⁻⁷ of its signal at 1.5 T. With the board's coil and receiver (0.46 nV/√Hz of
noise), a 4 mm pixel of water, 1.6 mL through the tubes' height, has a signal-to-noise ratio
of 5.7 per average; the brightest tube 3.7, and averaging 8 times makes it 10.5 (the noise
falls as $1/\sqrt n$), in 32 lines × 8 × 3 s = 12.8 minutes. Turn the polarizing
coil off and the picture drowns (0.062): making it up would take $170^2=29\,000$ times as
many averages, 258 days. Then choose 1.5 T: the same tubes, clean, at 170 Hz per mm and TE
15 ms, the oil bright (0.788). (The board itself has no gradient coils or pulses; Earth's-field
imagers add them, as Callaghan's group did, Halse and others 2006. In view 1, 46 µT shows
the one-dimensional picture in µT/m and Hz.)
23. How it began: Lauterbur's projections (1973)
The first MR image, of two tubes of water, was made without phase encoding. Paul
Lauterbur put the sample in a gradient, which by view 1 makes the FID's spectrum the sample's
profile along the gradient: its projection. Then he turned the gradient and measured again,
and made the picture from the projections by back-projection, as a CT scanner does (the
tomography demo ). He used four angles; here they are 4, 45° apart:
see how little four projections say. Raise the angles to 12, 60, 180: the picture sharpens, as
in the tomography demo, and turn the ramp filter off to see the plain back-projection's blur.
Phase encoding, filling k-space on a grid so that one FFT makes the picture, came two years
later (Kumar, Welti and Ernst, 1975; Edelstein and others' "spin warp", 1980), and every scanner
since has used it. Lauterbur and Mansfield shared the Nobel prize in 2003.
How it works
The signal. Protons in a field $B$ precess at the Larmor frequency
$f=\bar\gamma B$, with $\bar\gamma=\gamma/2\pi=42.58$ MHz/T. A π/2 pulse tips them into
the transverse plane (the NMR demo ); in a frame turning at
$f_0=\bar\gamma B_0$, as the receiver demodulates, a spin at $\vec r$ in a gradient $\vec G$
turns at $\bar\gamma\,\vec G\cdot\vec r$, clockwise for positive offsets (protons have
$\gamma>0$). Its transverse magnetization $M_x+iM_y$ goes as $e^{-2\pi i\bar\gamma\int\vec G\cdot\vec r\,dt}$,
and the signal is the sum over the slice,
$$s(t)=\int m(\vec r)\,e^{-2\pi i\,\vec k(t)\cdot\vec r}\,d^2r,\qquad \vec k(t)=\bar\gamma\int_0^t\vec G(t')\,dt',$$
where $m$ is the proton density times the weighting. So the signal at time $t$ is the Fourier
transform of the slice at the spatial frequency $\vec k(t)$, and the gradients steer $\vec k$
through k-space: this is the whole of MRI. The units here: mm, ms, mT/m, kHz, and
$\bar\gamma=0.042577$ kHz per (mT/m·mm), or turns per mm per (mT/m·ms).
Frequency encoding (view 1). A constant gradient $G_x$ during the readout moves $k_x$
steadily, $k_x=\bar\gamma G_x t$, so the record is the profile's Fourier transform and its
spectrum is the profile, $x=f/\bar\gamma G_x$. Recording until $k_x$ reaches $k_{\max}$ gives
detail $\Delta x=1/2k_{\max}$, and sampling every $\Delta k=1/\mathrm{FOV}$ covers a field of
view FOV. In view 1 the record starts at $k=0$ (an FID); a real readout first moves $k$ to
$-k_{\max}$ with a prephasing lobe, so the echo, $k=0$, comes in the middle (view 3).
Slice selection (view 2). While a gradient $G_z$ is on, a pulse tips only the spins
whose frequency it contains. For small tips the tip angle at offset $\Delta f$ is
$2\pi$ times the pulse's Fourier transform there, so a sinc in time, whose transform is a box,
tips a slab $\Delta z=\Delta f/\bar\gamma G_z$ thick at $z=f_c/\bar\gamma G_z$. The gradient
winds a phase across the slab while the pulse plays (as if all from the pulse's middle), and a
lobe of $-G_z$ for half the pulse unwinds it. The page solves the Bloch equations for 501
spins through the pulse (the profile is a little wider than the rule at 90°).
Phase encoding (view 3). Before each readout a lobe of $G_y$ lasting $T_{pe}$ moves
$k_y$ to $\bar\gamma G_yT_{pe}$, a different step of the ladder each repeat; the readout then
sweeps one row of k-space. With $N$ rows $\Delta k$ apart, the inverse 2D FFT gives an $N\times N$
picture of the slice, the same in both directions. The page's sequence plays the parts one
after another: the slice's pulse and its rephasing lobe, the phase-encoding lobe, the readout's
prephaser, for a spin echo the π pulse at TE/2, and the readout centred at TE. A π pulse about
$x'$ turns every spin's phase around ($M_x+iM_y\to M_x-iM_y$), so it turns $\vec k$ into
$-\vec k$, and phases wound by an uneven field are undone at TE: the spin echo. The live
pictures use 128 × 128 spins, each with an offset drawn from a Lorentzian of width
$1/\pi T_2'$; the k-space data are the FFT of the weighted picture on the scan's own grid.
Contrast (view 4). With a repeat time TR, a spin-echo picture weights each tissue by
$\rho\,(1-e^{-TR/T_1})\,e^{-TE/T_2}$ (for a 90° pulse); a gradient echo has
$1/T_2^*=1/T_2+1/T_2'$ instead of $T_2$. The tissues' values, at 1.5 T: water (CSF)
$\rho=1$, $T_1=4000$, $T_2=2000$ ms; fat 0.95, 260, 80; grey matter 0.8, 950, 100; white matter
0.7, 650, 90; a lesion (oedema) 0.9, 1500, 200. $T_1$ grows with the field (to 4300, 370,
1330, 830, 2000 at 3 T); $T_2$ hardly does. At low field $T_1$ is shorter: measured in heads at
50 mT (O'Reilly and Webb, Magn. Reson. Med. 87, 884, 2022), CSF 3695, fat 130, grey 327,
white 275 ms; between 50 mT and 1.5 T the page takes a power of the field through the two
values, $T_1=T_1(50\,\mathrm{mT})\,(B_0/50\,\mathrm{mT})^b$, which at 0.117 T gives 3769, 155,
427, 341 (the lesion's is a guess, scaled as grey matter's). The tubes: tap water $\rho=1$,
$T_1=2.5$ s, $T_2=2$ s, and water with copper sulphate 0.3 and 0.25 s, at every field; oil as
fat, with $T_1=0.1$ s while the board's coil polarizes it (the NMR demo's values).
Decay during the readout (More in view 4 holds $T_2'$). The readout reaches
$k_x$ at $\tau=k_x/\bar\gamma G_x$ from the echo, so each column of k-space is weighted, tissue
by tissue, by what the echo has left then: $e^{-\tau/T_2}$ (from the π/2 pulse, so more before
the echo than after) times $e^{-|\tau|/T_2'}$ for a spin echo, whose π pulse undoes the field's
spread only at the echo, or $e^{-\tau/T_2'}$ for a gradient echo. A symmetric
$e^{-|\tau|/T}$ in k-space is a Lorentzian in the picture, of full width at half height
$1/(\pi T\bar\gamma G_x)$, or $T_{ro}/\pi T$ pixels, since $\bar\gamma G_x\,\Delta x=1/T_{ro}$.
The page makes k-space as the sum of each tissue's FFT times its weights.
The magnets. 46.0 µT (the Earth's, where the NMR demo's board is: 1959.8 Hz),
0.117 T (the TeachSpin's: 5.000 MHz), 1.5 T (63.87 MHz) and 3 T (127.7 MHz). The protons'
polarization is $\tanh(\gamma\hbar B/2kT)\approx\gamma\hbar B/2kT$, 5.2 parts per million at
1.5 T and 20 °C, so their magnetization goes as the field that polarizes them, $B_{pol}$; the
voltage it induces in a coil goes as the rate it turns, $\propto B_0$: per proton the signal
is $B_{pol}B_0/(1.5\ \mathrm T)^2$ of a 1.5 T scanner's. In the Earth's field the board's coil
polarizes ($B_{pol}=7.84$ mT, 170 times $B_E$) and the protons are heard in $B_E$. How the
noise scales depends on whether the coil or the body makes it, so for the scanners the noise is
the slider's; at 46 µT it is the board's. A litre of water fully polarized there induces
1.199 µV, 285 times the receiver's noise in its 82.65 Hz bandwidth, so the noise at the coil is
$1.199\ \mu\mathrm V/(285\sqrt{82.65\ \mathrm{Hz}})=0.463$ nV/√Hz, and a pixel of volume $V$ in
a picture of $N_y$ lines, each read for $T_{ro}$ and averaged $n$ times, has
$$\mathrm{SNR}=\frac{1.199\ \mu\mathrm V\,(V/1\ \mathrm L)\sqrt{N_yT_{ro}\,n}}{0.463\ \mathrm{nV}/\sqrt{\mathrm{Hz}}}$$
(to factors of order one), with no slice: the tubes are seen through their 100 mm height. Three
more things go with the field. The field's unevenness, in tesla, is a fixed fraction of it, so
$T_2'$ grows as $1/B_0$: 60 ms at 1.5 T, 30 at 3 T, 770 at 0.117 T, and 1.5 s in the Earth's
field (the board's 5 nT across its bottle). Fat's chemical shift is 3.4 ppm of $f_0$. And
the gradients must stay small next to $B_0$: a field whose $z$ part grows along $x$ has, by
$\nabla\times\mathbf B=0$, an $x$ part $Gz$ that grows along $z$, so at height $z$ the field is
$\sqrt{(B_0+Gx)^2+(Gz)^2}\approx B_0+Gx+G^2z^2/2B_0$, and the spins there are read
$Gz^2/2B_0$ too far along $x$: 0.002 mm at 2 mT/m in 1.5 T, 2.7 mm at 100 µT/m in 46 µT (the
page leaves it out). View 1 shows the Earth's field with its gradients 20 times weaker than
in a scanner, µT/m for mT/m: the phase $2\pi\bar\gamma Gxt$ is the same with $G$ divided by 20
and $t$ multiplied by 20, so its pictures are the same, with frequencies in Hz and the record
20 times longer.
Approximations. The slice is a plane (no partial volume across its thickness); the
time between lines is left out, and the decay during a readout unless it is asked for; the
field's unevenness is a spread of offsets with no shape in space; noise is added to each k-space
sample, independent and Gaussian. The page skips the waiting between lines, which a scanner
spends recovering along $z$: a 64-line spin-echo picture with TR = 500 ms takes 32 s.
New in 2026 for BrainFlux. Source:
github.com/gallicchio/brainflux , MIT licence.