Whilst ultrasound relies on how sound waves bounce off tissues of different densities, and Xrays form images based on the absorption of high-energy radiofrequency waves; MRI relies on the quantum properties of the hydrogen atom, specifically its spin.
The orientation of a proton's magnetic north is described probabilistically. Under normal circumstances, this probability is evenly distributed. This means that the combined magnetic field of many hydrogen atoms cancel out. When protons are inserted in a large external magnetic field, the distribution of the magnets changes, aligning them with the external field. Now, the spins want to align themselves back to their original position, but they don’t fall back immediately, and decay in a spiraling motion. This decay causes a changing magnetic field, and by placing a coil of wire nearby, the current can be measured.
Higher magnetic fields require higher electric currents, but this would melt ordinary wires. For this reason, superconducting coils are used.
The resistance of a superconducting coil is zero at zero Kelvin. This means that an electric current travels in a loop of superconducting material indefinitely, never needing a power source. The main consumption of energy in an MRI isn't therefore for due to the electric current, but due to keeping the coil cooled down. The current will travel endlessly, leaving the MRI magnet permanently on. To achieve the necessary cold temperature, liquid helium is placed in vacuum-sealed chambers to prevent evaporation.
To find the physical location of the hydrogen atoms, one looks at the decay of the Hydrogen protons. The spiral decay pattern of hydrogen has a unique rotational frequency (omega), that depends on the magnetic field strength. Atoms in a stronger magnetic field will rotate faster and vice versa.
To image individual slices, one can apply a gradient to the magnetic field strength and selectively nudge atoms along the gradient by applying the corresponding frequency. This gradient is applied by using a separate set of regular electromagnets, named gradient coils. To image a slice near the weaker end of the tube, the machine sends a pulse centered at lower rotational frequencies. Whilst for slices near the stronger end, higher rotational frequencies are applied (the difference lies around 1 MHz).
How quickly atoms re-align themselves with the magnetic field is called T1 relaxation. We can emphasize these signals by sending pulses rapidly and observing the signal immediately, as in this short time span, the dephasing effects of T2 do not take place.
As hydrogen atoms interact with each other and with their surroundings, the small interactions cause the spins to fall out of uniformity. This failing out of order creates the T2 decaying signals. If pulses are sent at a slower frequency compared to T1, and a longer period is waited between the intervals, dephasing occurs and one can measure the T2 signal.
In 1822, Joseph Fourier developed a mathematical framework (Fourier transformation) to decompose complex waves into simpler ones.
Any image can be deconstructed into a weighted average of simpler black and white stripes. This is what MRIs use to create images. Instead of focusing on individual pixels, different striped patterns are sampled.
If one imagines a slice as a grid of rotating hydrogens:
the phase of the atoms is colored in a grey scale
when rotating in unison the grid would be all white
Atoms rotating 180 degrees are colored black.
MRIs exploit this to physically create the striped patterns needed for the Fourier analysis. Using another set of gradient coils, MRIs precisely change the phase of rotating hydrogens to create striped patterns.
By turning on gradients in the Y and X direction, MRI can create patterns in all directions and frequencies. The machine imprints patterns with different frequencies and orientations, measures their relative strengths, and constructs an image. This is what forms the image for each 2D slice and is done for every slice of the body.
For the detailed physics I have added a document as there were too many formulas for a web page. The content is very detailed and often complicated for beginners, I suggest to look at the videos in the reference to have a more clear overview.
Table of Contents of document
MRI physics – details
MRI components
The detected signal equation
Spin dynamics (T1, T2, TE, TR)
Polarization
Boltzmann Magnetization
NMR Experiment Transmission (Tx) and Reception (Rx)
Dephasing
Spin Echo experiment
Total scan time
Pulse and Magnetic gradient
Gradient Echo (GRE) – Detailed explanation
Gradient Echo (GRE) vs Spin Echo