Part 2: The Math Behind MRI Machines

The physics of MRI machines comes down to particle spin, something measured in half increments. Almost every element has an isotope with a non-zero spin; however, an MRI machine can only detect spins of large enough magnitude. The magnetic field mostly affects hydrogen and in turn water (oxygen and 2 hydrogens.) When the MRI machines implement a magnetic field gradient, the various molecules and particles resonate with the field with a matching frequency, proportional to each part of the field gradient. This MR basically “flips“ lower spin particles, something that can be measured as it changes and releases energy.

At T1, the higher energy spins give off measurable energy over some time. At T2 is the measured time for the transverse magnetization to return to equilibrium. This is said to be shorter or equal to T1.

A software then measured the intensity and frequency in relation to each part of the gradient and determines how dense each area of the scan is. Each measured magnetic field and spin value at specific times is put into a “relaxation matrix” T1 is used for the z-axis of imagine and T2 is used for the x-y plane.

The way that the machines measures density is through a Fourier transformation. An FT “decomposes“ a function that is dependent on space and time (frequency) to one dependent on spatial frequency. The raw data included values of the induced voltage of multiple frequencies and amplitudes from the varying locations and densities in the MRI machine. This can be imagined as a sinusoidal graph. Each sinusoidal graph has drastically different amplitudes and frequencies, so just to add them together over a field gradient would produce a complicated function that limits analysis.

Instead, each varying “function“ is broken into its parameters for frequency and amplitude. This value is then represented as a varying color, from black to white. See below:

Higher amplitudes are a darker color and lower amplitudes don’t have color. This is especially useful for extremely complex frequencies. This new representation of the graph grades a 2-d image of gradients between colors. After this is done for each function, it has a series of 2d images is can paste together into a 3d model.

Some of the other math is a little confusing still for me, and as I continue to learn and understand how some of the calculus and transformations work, I will update this post as well. For now, this was a basic covering of how it goes from particle spin to energy level to frequencies to a visual image.

References:

https://sullyfchen.medium.com/mathematical-medicine-magnetic-resonance-imaging-mri-e085d9bf944c#:~:text=By%20measuring%20the%20intensity%20AND,coming%20from%20which%20spatial%20area.

https://www.youtube.com/watch?v=VAxP6a1c13c

https://www.wjgnet.com/2220-6132/full/v3/i1/17.htm

Previous
Previous

Donut Video

Next
Next

Part 1: The Science Behind TMS and MRI Machines