AI in Medical Imaging for Beginners: II. MRI Basics

JC Climent Pardo
6 min readAug 16, 2024

--

TL; DR: MRI modalities, sequences and scans types. How do I choose the correct sequence for my analysis?

Introduction

In the previous blog post we covered the basics of medical imaging and here we will cover the basics of Magnetic Resonance Imaging (MRI) and what needs to be understood about this tech before we can start applying fancy AI models to the images. When starting in the imaging world, it can be a little frustrating to get the hang of it, as there are different types of sequences, each of which provides different information. So lets get started!

MRI is considered the standard procedure when tissue-related information needs to be gathered. Source: [1]

How does a MRI work?

MRI is widely applied and mainly known for being a non-invasive medical imaging technique that leverages strong magnetic fields and radio waves to create detailed images of the body’s internal structures. The basic principles involve the interaction of atomic nuclei with external magnetic fields and radiofrequency (RF) pulses. The scanners use powerful magnets to generate a strong, uniform magnetic field typically ranging from 0.5 to 7 Tesla (unit for the magnetic field). The magnetic field aligns the protons (hydrogen nuclei) in the body, causing them to precess around the field’s axis at a specific frequency called the Larmor frequency. RF pulses are applied at the Larmor frequency, causing the protons to absorb energy and flip their magnetic moments away from the magnetic field. After the RF pulse is turned off, the protons return to their equilibrium state through two relaxation processes: T1 (spin-lattice) and T2 (spin-spin) relaxation. The first one describes the recovery of longitudinal magnetization (Mz) and is characterized by the time constant T1, which varies for different tissues. The T2 relaxation describes the decay of transverse magnetization (Mxy) and is characterized by the time constant T2, which also varies for different tissues. The protons relax over time and emit RF signals called free induction decay (FID), which are detected by receiver coils in the scanner. The signal intensity (SI) depends on various factors, including proton density (PD), T1, T2, and the sequence parameters (e.g., repetition time (TR) and echo time (TE)).

Setup of a MRI scanner and its different components. Source: [2]

In order to create an image, the MRI scanner uses gradient coils to spatially encode the signal by slightly altering the magnetic field in three orthogonal directions (x, y, z). The selection of the image slices is achieved by applying a gradient during the RF pulse, while frequency and phase encoding are used to locate signals within each slice. The raw data collected by the scanner and the final MR image is obtained by applying a 2D or
3D Fourier transform to the data, converting it from the frequency domain to the spatial domain.

MRI offers excellent soft tissue contrast and can be manipulated by adjusting sequence parameters (e.g., TR, TE, flip angle) to highlight different tissue characteristics. This flexibility allows for the creation of various image contrasts, such as T1-weighted, T2-weighted, and proton density-weighted images, each providing unique diagnostic information.

The four conventional MRI sequences that you will mostly encounter are T1-weighted imaging (T1W), T1-weighted imaging with contrast
(T1W+C) with gadolinium-contrast to enhance and see fluids better, T2-weighted imaging (T2W), and fluid-attenuated inversion recovery (FLAIR), which is a inverted T2 sequence. These sequences provide complementary information about tumor morphology, location, and extent, as well as the presence of associated edema, hemorrhage, or necrosis.

Exemplary sequences for a brain tumor. Source: [3]

But how do I choose the sequence I want ?

It is true that depending on what you want to examine on the body a different sequence type might be relevant. But how do I choose the sequence I need? This was also one of my first struggle until I understood for what each type of sequence is used and how I can learn to differentiate without being a trained clinician.

Differentiating the sequence can be challenging if you are not a clinician, but hopefully this scheme I created aids you in it! Source: [4]

T1-weighted imaging (T1WI): T1WI is characterized by short repetition time (TR) and echo time (TE) values, which result in high signal intensity for fat-containing tissues and low signal intensity for fluid-containing structures. In the context of tumors, T1WI is useful for delineating tumor margins, as the tumor often appears hypointense compared to the surrounding normal brain parenchyma. However, some tumors may appear isointense on T1WI, making them difficult to distinguish from normal brain tissue.

T1-weighted contrast-enhanced imaging (T1WI+C): Intravenous administration of gadolinium-based contrast agents enhances the visibility of tumors on T1WI. Disrupted blood-brain barriers allow the contrast agent to leak into the extravascular space, resulting in a hyperintense signal on T1WI+C.

T2-weighted imaging (T2WI): T2WI is characterized by long TR and TE values, which result in high signal intensity for fluid-containing structures and low signal intensity for fat-containing tissues. In tumor imaging, T2WI is the most sensitive sequence for detecting and characterizing the tumor. Tumors generally appear hyperintense on T2WI due to their increased water content, which is a result of the tumor’s high cellularity, extracellular matrix, and vasogenic edema.

Fluid-attenuated inversion recovery (FLAIR): FLAIR is a T2-weighted sequence with an additional inversion recovery pulse that suppresses the signal from cerebrospinal fluid (CSF). This suppression enhances the visibility of periventricular and superficial lesions that may be obscured by the high signal of CSF on standard T2WI. In tumor imaging, FLAIR is particularly useful for detecting infiltrative tumor extension into the white matter, as the tumor signal remains hyperintense while the CSF signal is nulled.

What OTHER types of MRIs exist ?

Now that we have covered the basic MRI type, which are usually called structural MRIs or sMRI and their sequences, we may wonder, what are more advanced methods. These are usually functional MRI or fMRI and diffusion-based imaging techniques called Diffusion Weighted Imaging and Diffusion Tensor Imaging.

Structural MRI (sMRI)

sMRI provides detailed anatomical images of the brain, visualizing the brain morphology and identifying structural abnormalities by its four main sequence types (T1, T1c, T2, FLAIR).

Functional MRI (fMRI)

fMRI measures the brain activity by detecting changes in blood flow, providing insights into brain function rather than the structure.

Diffusion Weighted/ Tensor Imaging (DWI/ DTI)

DWI/DTIs are types of MRIs that maps the diffusion of water molecules in the brain, providing insights into the brain’s white matter structure.

It is true that there are even more types of MRI-based approaches, such as Magnetic Resonance Spectroscopy (MRS), but for the sake of simplicity, they are avoided in this blog-post.

Visualization of sMRI (A), fMRI (B), and DTI (C). Source: [5]

Conclusion

And now you are an expert on the MRI imaging, how the technology works and what sequences you can expect in the images! In the next blog-post we will cover some exemplary code on how to implement the preprocessing techniques on an image so that we can slowly start to apply AI!

Hope you are liking the series and learning!

If you want to continue reading about MRIs, checkout this guide.

References

[1] https://www.medicalnewstoday.com/articles/146309

[2] S. D. Serai. “Basics of magnetic resonance imaging and quantitative parameters T1, T2, T2*, T1rho and diffusion-weighted imaging”. en. In: Pediatr. Radiol. 52.2 (Feb. 2022), pp. 217–227.

[3] W. Tian, D. Li, M. Lv, and P. Huang. “Axial attention convolutional neural network for brain tumor segmentation with multi-modality MRI scans”. en. In: Brain Sci. 13.1 (Dec. 2022), p. 12.

[4] https://www.simplypsychology.org/what-is-grey-matter-in-the-brain.html.[Accessed 13–06–2024].

[5] https://www.researchgate.net/figure/Differences-among-the-imaging-techniques-MRI-fMRI-and-DTI-A-A-structural-MRI_fig1_331548557

--

--