Showing posts with label MRI principles. Show all posts
Showing posts with label MRI principles. Show all posts

Saturday, August 23, 2014

Additional MRI Vocabulary

1. On 2D and 3D MR image
The earlier posts on MRI/fMRI are not exhaustive and now I would like to add some more points. Let's begin by refreshing our memory on how an image is reconstructed (a 2D image, I mean). We have RF excitation pulses and we assign a gradient to localize the position in 2D space. Once we get acquire the data on the whole k-space trajectory, we have to inverse them through Inverse Fourier Transform to obtain the actual image.

Fig-1: An illustration showing a T1-weighted image transformed from its k-space equivalent data. Adapted from [1].

Okay, more basic vocabulary in MRI image formation: a slice, field of view, image matrix, slice thickness, and in-plane image resolution. Refer to the following diagram showing an anatomical or structural T1 image. If we take just the 2D image of a particular slice, it is basically a matrix of 32 ´ 32 data points, each point is acquired consecutively for every row. With the in-plane resolution of 3 ´ 3 mm, the slice field of view 32 x 3 = 96 mm. In reality, the slice is captured with a certain thickness as well. The smallest entity of an MR image is called a voxel and its size represents the image resolution. To construct a three-dimensional image, we repeatedly acquire and combine 2D slices. Now, an acquired 3D image is also called a volume or simply an MR image. A voxel that has the same size on all three sides is called isotropic, e.g. 3 ´ 3 ´ 3 mm. One volume is acquired within one TR (repetition time).

Take note that although one volume is acquired within 1 TR, all slices are not captured at once. The way we acquire or record slices follows what we called slice order that is defined by the scanner operator. Essentially, the slice order can be ascending, descending, or interleaved. The ascending slice order means that the first slice will be captured first and the difference in time point between the first and the last would be almost 1 TR. The effect of this difference on subsequent statistical stages can be detrimental! I have mentioned the slice time correction as one of the preprocessing steps.

Fig-2: A slice is made up of rows of voxels. A volume is a collection of different slices acquired in one TR.

2. More On Functional Image
The structural image consists of only one 3D image or volume and it is a T1-based image. On the other hand, a functional MRI image is a T2*-weighted image in 4D, the fourth being the time information. What it means is that what we get in fMRI is a collection of volumes, each acquired one after the other at different time points. Note that a time point corresponds to one repetition time (TR), and thus, one volume per TR. To summarize: functional MRI gives us 3D space × time dataset. In practice, the first few points ~ 2 sec are removed because the hardware (magnet) isn't yet stable.

Refer to the following diagram. Suppose we select just a slice of every volume acquired in every 2 seconds (TR = 2 sec) for 5 minutes. There are 2 experimental conditions involved. And we select a region of interest or ROI as our apriori assumption to look for brain activation.

Fig-3: In functional MRI, volumes are recorded to obtain 4-dimensional data to represent the brain's dynamic. From [3].

3. What is Spatial Normalization?
As mentioned earlier, EPI is the most common fMRI method. Although the acquisition is quick, the resulting image quality with EPI is poor. Coregistration attempts to register these poor images to the T1-weighted structural image of the same subject or patient. Why? Because the structural image carries a much higher spatial resolution. To do this, we simply perform a rigid body transformation with 6 or 7 DOF, consisting of 3 translation and 3 rotation. The goal of this transformation is to maximize the intensity-based correlation between two images, that is, the target and the reference image. This is achieved through an iterative process by minimizing some cost function.

A detailed example of 2D coregistration is as follows. We have two images, together with the information on the intensity values of every voxel. We then plot that in the histogram and assign a bin number. After that, we create another plot based on the bin number of images 1 and 2. Suppose a voxel at location [x, y] has a bin number 23 for the first image and a bin number 8 for the second image. We plot this particular voxel at [23, 8]. Once finished, we can see how this plot resembles a correlation map. If two images are aligned, the plot will be more or less a straight line.

If we then want to know the common activation happening across different subjects, we have to use a template or atlas. This is because individual brain differences can be huge. The most popular standard templates: the Talairach space and the MNI-152. I personally only use the MNI-152 template with a 2 mm resolution. Registering a structural scan of a person to the structural scan of a standard template is called normalization. Normalization is indeed crucial for group or higher-level analysis where different we want to combine different subjects. All these can be done with the currently available software. Klein et al. (NeuroImage, 2009) wrote a neat article on different methods of image registration available, e.g. SyN, ART, SPM, FNIRT, etc.

In general, spatial normalization essentially requires two steps.
  1. The first step is to align the subject image to the standard template using affine transformation with 12 DOF. This is a linear process of translation, rotation, scaling and skewing, each for the three axes. Because the resolution of the image isn't always the same with the reference image, we need to perform interpolation somehow. 
  2. The next step is to perform  non-linear transformation or geometric warping. This is a lengthy process that may require loads of iteration by minimizing some cost function (or maximizing certain 'similarity' measure). Ideally, this non-linear transformation makes use of a 'function' that is diffeomorphic. What it means is that the function maps a point in space U to exactly one and only one point in space V and the relationship is invertible. After normalization is done for all subjects, our position in space follows the standard coordinate.
  3. Note that the MNI template (by Collins et al at the MNI) has different revisions. FSL uses the MNI nonlinear template obtained from 152 healthy adults. You can choose to use the 1mm or 2mm resolution.  

Fig-4: An illustration on how we divide an anatomical slice into 6 bins of different intensity. We need to 'match' bin-1 of the source image to bin-1 of the target image, etc.


4. Orientation Convention in MRI
I find this website is useful. Note that neurological convention (RAS) is the opposite of the traditional radiological convention (LAS). The summary is shown below. In other words, the axial or transverse plane is R-L x A-P plane, coronal is R-L x S-I plane and sagittal is A-P x S-I plane.
Fig-5: Orientation conventions in brain imaging. MRI uses the LAS convention i.e. the left brain is on the right-hand side.

Wait! There is another rule. Suppose you have conducted your experiments and gotten the raw DICOM images from the machine. These images are acquired following a certain convention as well. The following is useful, especially when you work with both AFNI and FSL. This convention dictates us how a row is constructed to a slice, then a volume.
Let's say we have an AFNI image with "orientation" RAI.  This means that:
a) Voxels ordered from: Right to Left to store a row.
b) Rows ordered from: Anterior to Posterior to store a slice.
c) Slices stored from: Inferior to Superior to store a volume.
Importing a DICOM volume using to3d will create an AFNI file with RAI orientation by default. Importing a DICOM volume using dcm2nii will create an NIFTI file with RPI orientation by default.   [from: source]

5. What is AC-PC alignment?
We have just mentioned the orientation convention in the MRI. Having known the jargon, how then, should I place a patient's head in the scanner? By default, the axial or transverse plane has to cut through two important anatomical landmarks of the brain, the anterior commissure, and posterior commissure. They are usually called as AC-PC. Once the head positioning and orientation are determined prior to the acquisition, the slice orientation follows will follow the AC-PC alignment, acting as a reference or anchor. Take a look at Fig-2 above. If the head is tilted in such a way that the AC-PC is not horizontal, it is said that the head is oblique.

Why is this orientation important in the experiment? Imagine that an MRI scanner can only acquire anywhere within a certain "box". Ideally, we would want to cover the full brain as much as possible but the head size may vary. In order to fully cover important brain regions that we want, we may want to tilt the head slightly, e.g. -30 degree w.r.t. AC-PC.

Fig-6: The sagittal view of the head with the location of AC-PC.


6. What is Localizer? What is Auto-align?
Initially, when we put a subject into the bore, the scanner uses its geometric center of the bore (magnet) as its reference. This location may not be the same as the head center, which is calibrated as with the laser before we bring the subject in, Once the subject is inside, we acquire a low-resolution T1 image so that we roughly know the head position with respect to the magnet. This image, called a localizerallows the scanner software to ‘know’ where your head is. Throughout the whole session, the scanner will reference all subsequent images relative to that first reference image. This allows you to prescribe slices on each subsequent image however you like, and the scanner will track where you are in space.

Auto-align is an algorithm (Siemens scanner?) that allows you to prescribe slices on each image throughout the scan, even with different sessions. It basically does some kind of geometric transformations, taking the localizer as the reference. In the Siemens machine, this feature is called AAHScout. AAHScout plays a major role when we are scanning with multiple sessions of the same subject or patient, or when we bring the subject in/out of the bore.

7. Some more jargons to remember
Lastly, it is good to talk about the same vocabulary when discussing the design of fMRI experiments. Some useful jargons may include:
(a)   A session: all MRI/fMRI scans collected for a subject or patient in one day.
(b)   A run or scan: a continuous fMRI scanning, may last up to 7-10 minutes.
(c)   A condition: a task, a type of stimulus presented to the subject or patient.
(d)   An experiment: a set of conditions designed to answer a scientific question.
(e)   A paradigm: a set of manipulation comprising different experimental conditions.
(f)   A pulse sequence: a set of parameters, e.g. TR/TE, flip angle, slice thickness, in-plane resolution. A more recent technology called the multiband sequence becomes widely used.

A session usually consists of one or more experiments. Each experiment consists of several runs. In one run, the subject may be presented with an orderly set of two or more conditions, that is, types of behavioral manipulation or stimulus presentation. More volumes and/or runs are commonly needed when signal-to-noise (SNR) is low or the effect size is small. Thus each session consists of numerous runs, e.g. 5-10 runs, that may last to hours.

8. What is parallel imaging?
More recently, parallel imaging becomes popular to shorten acquisition time and improve SNR, while at the same time obtaining more data points. Broadly speaking, parallel imaging is a generic name denoting multiple acquisitions of images at the same time, thus parallel. In different MRI machines, the algorithm naming can be different but essentially this feature falls into 2 categories:
     (a)  Image space (encoding) following reconstruction, e.g. SENSE.
     (b)  k-Space or frequency domain, e.g. GRAPPA.

I mentioned k-space earlier. This k-space often refers to a temporary image space in matrix format, in which data from digitized MR signals are stored during acquisition. The final image is produced by some mathematical operations when the storage is full, a process sometimes known as image reconstruction. 

Parallel imaging induces more noise and the SNR is reduced by g.√R where g is the noise amplification or g-factor, and R is the acceleration factor. For example, if R = 2 then it reduces imaging time by half, but decreases the original SNR by 1/√2 ≈ 0.71.

Now, which method of parallel imaging should we choose? Well, it really depends on various factors: total time taken, SNR, coverage, etc. Parallel imaging promotes the birth of multiband acquisition in the Human Connectome Project by NIH.


References
[1]  Jezzard, P., Mathhews, P. M., and Smith, S. M. (2001). Functional MRI: An Introduction to Methods. Oxford University Press.
[2]  Lindquist M. (2008). The statistical analysis of fMRI data. Statistical Science 23: 439–464.
[3]  Lecture01 in - culhamlab.ssc.uwo.ca/fmri4newbies/Tutorials.html
[4]  FAQs from http://bic.berkeley.edu/scanning.
[5]  http://mriquestions.com/two-types-of-pi.html

Nice neuroimaging data processing, that covers some basics of the 3 most popular software packages: SPM, FSL, and AFNI.

Thursday, June 12, 2014

Introduction to MRI Physics

The Magnetic Resonance Effect
Around 70% of our bodily tissues, including the brain, contain water molecules composed of hydrogen atoms. A single hydrogen atom has a nucleus with a single proton that freely rotates around its axis. In general, their axes point randomly but when placed inside a magnetic field B, they become aligned with it. What happens next? There are protons pointing with and against the direction of B the antiparallel spins. The net polarity under such equilibrium is measured as M, the net magnetization. The direction of M is always along B. 

While in equilibrium, the protons are also behaving like a spinning top with a particular angular frequency. This phenomenon is called precession. The frequency is called Larmor frequency, the value of which is proportional to B. Ideally, B is always constant and homogeneous, so it is called the static magnetic field. By convention, the direction of B is in the longitudinal axis. Its strength, measured in Tesla (T), defines the MRI scanner specification, for example 1.5 T and 3.0 T.

Suppose there is this second magnetic field B1 applied to these realigned protons, two things will happen. First, they get more energy and begin to wobble. As a result, the precession axes start to point further away from the longitudinal axis B. Look at the diagram below. Second, the protons then become in-phase and this yields to a growing net magnetization in the transverse plane, 
Mxy perpendicular to the original M. The longer we apply this field, the higher the precession angle so much so that the new M' is now fully flipped 90º to the transverse plane.

Fig-1: An excitation pulse changes the net magnetization that yields to detectable RF signals used in MRI. (a) In the body, each hydrogen atom or proton has a random orientation. (b) If the body is under the influence of static magnetic field B, the protons will try to align themselves with B, producing a net M. (c) The application of external excitation field will destabilize the alignment, the resulting new M will be perpendicular to the original M. (d) Once this external field is switched off, we can measure the relaxation process through an RF detector. 


The field B1 is also called the excitation pulse and is switched on only for a certain period. What happens when we switch it off suddenly? The protons try to align back with the static magnetic field, the process of which is called relaxation. At the same time, they emit RF signals with Larmor frequency matched with B1. If we put an RF detector or receiver coil nearby, we are able to capture this signal. Hence, the word ‘resonance’ makes sense because what we measure is the resonance effect.  Following Faraday’s Law, the change in RF pulses induces an electric current that we can measure externally.  This is the basic principle of Magnetic Resonance Imaging (MRI) as discovered independently by Bloch and Purcell in 1946. This technology was originally called NMR or Nuclear Magnetic Resonance.

Gradient Field for Spatial Localization
Before being able to image an object, we need to have a coordinate system for spatial localization. Why? We want to know the “composition” of protons at a different location in the brain in order to produce the 3D brain structure. Without this feature, our RF detector is not able to know where in the brain produces what signal. The very first idea of spatial localization came from the 1D imaging experiment by P. Lauterbur in 1973. 

Spatial localization is achieved by using a gradient field. This means that instead of giving a constant external magnetic field, we vary the intensity slightly according to the distance in a certain direction. Because Larmor frequency depends on the magnetic field strength, there will be varying frequency components at different positions captured by the RF detector. The number of protons is reflected as the signal intensity. Because this gradient field yields to different frequencies at a different location, this particular external pulse is also called frequency encoding. It is usually denoted as Gx. 

To create a full volumetric or 3D brain image, we require the second and third gradient fields. By convention, the Z-axis is parallel to the direction of the static magnetic field and is called the longitudinal axis. The scanner bore is along the longitudinal axis. The X and Y axes form a perpendicular plane called the transverse plane w.r.t the longitudinal axis. Obviously, the remaining gradient fields are set along the X and Y-axis. Because a gradient field in one axis will modulate the spin precision frequency on that particular axis, the three cannot be switched on at the same time.

Fig-2: Creating a full 3D brain image requires 3 different gradient pulses on top of the external RF pulse B1 (from [4]).

The slice selection field Gz  along the Z-axis is switched on simultaneously with the excitation pulses. ‘Slice’ here literally refers to brain slice. We now acquire MRI signals for that particular slice and then resolve them based on the X and Y position on the transverse plane using 2 additional gradient fields. The X- gradient field can resolve position based on frequency components as mentioned earlier on, i.e. frequency encoding. The Y-gradient Gy allows us to resolve position based on the phase difference, that is, the phase encoding. By convention, the frequency encoding is also known as the readout gradient.

Refer to the diagram above. The excitation pulses and the three gradient pulses during MRI acquisition are collectively called the pulse sequence.

Relaxation Time and Image Contrast
As mentioned earlier, a brief excitation pulse B1 will cause the protons to spin along the transverse plane; sometimes called the 90º excitation. Spinning protons return back to the longitudinal baseline position in the direction of the static magnetic field B once the pulse B1 is switched off. This process is called relaxation. Bear in mind that different tissues have a different composition, and thus, different relaxation times. In the early 1970s, R. Damadian attempted the first full-body NMR image using different relaxation times.
Fig-3: Different relaxation time constants observed once the external pulse is switched off. Taken from [4].

There are two types of relaxation. The first relaxation is caused by spin-spin interaction that results in the gradual dephasing effect in the transverse plane. T2 represents the rate of relaxation in the transverse plane Mxy and T2-value decay over time. A variant of T2, called T2*, accounts for local field inhomogeneity due to tissue properties. In addition, the magnetization Mz along the longitudinal axis is restored over time and the recovery time is represented by T1. The process is also called spin-lattice relaxation because there is a transfer of energy to the surrounding tissue, causing less antiparallel and more parallel spins.

In MRI, tissues with different relaxation times yield different image contrast. So a contrast can be created by exploiting T1, T2 , or T2*. As such, there are two important time parameters in MRI: 
  1. Repetition time (TR), i.e. the time interval between two consecutive excitation pulses. 
  2. Echo time (TE), i.e. the interval between the start of an excitation pulse and data acquisition during the peak of the signal. This is akin to a reply of an echo that is captured by the receiver.
The T1-weighted image makes use of the T1 relaxation effect on different tissues. This effect is clearly seen by providing a short repetition time TR. T2-weighted images, on the other hand, can be clearly seen with long TE, allowing more time for the spins to dephase completely. Another important parameter is the "How" which determines the sequence to produce this echo, e.g. gradient echo and spin echo. What does it mean by echo here?

k-space and Fourier Transform
The introduction of k-space is useful to elucidate the process of image reconstruction from mere nuclear magnetic equations. The k-value is an integral operation of the gradient curve across time, i.e. the area under the gradient curve. If the gradient point is below the axis, its value is negative and its integration over time t yields to a negative value too. Changes in k-values over time are represented by the k-space trajectory. In our example below, the frequency and phase-encoding gradient are shown as orange and brown color respectively. The k-space trajectory is shown in green on the right-hand side panel.
  

Fig-4: A simplified version of how to generate 2D k-space trajectory using two gradient pulses, Gx and Gy.

Suppose we are acquiring one brain slice. The k-space contains kx and ky coordinates. Before we are able to reconstruct the slice image, we have to fill up the entire coordinate with relevant data. Which data? The data acquired or sampled by the RF detector, each for each plane. How do we create the trajectory to plot the data at different kx and ky coordinates? By varying the frequency and phase encoding gradient fields across time. When there is no gradient field, the coordinate remains the same over time as no trajectory is formed.

Data points are measured in a discrete manner. The number of k-space measurements we make per slice determines how good the spatial resolution of the slice is. After the whole k-space contains relevant data, Inverse Fourier Transform operation can subsequently be done to produce an image.

Echo Planar Imaging
If we turn the excitation pulse longer, it is possible to flip M all the way to 180º in the opposite direction. This result is interesting as at this position, there is no resonance effect captured by the detector. We can also do something different. First, we apply 90º excitation pulse so that the precision is on the transverse plane, then we switch it off. Transverse magnetization Mxy experiences gradual dephasing on the transverse plane. Now half-way through we apply a strong pulse called the 180º refocusing pulse. It turns out that we are able to flip the direction of rotation (or phase) around the X-axis. The effect is interesting. The Mxy will increase again once more like an 'echo' before gradually dying off. This sequence is called the spin echo. As shown in Fig-5, the period from the 90º excitation pulse up to the appearance of the maximum detectable signal is called the echo time (TE), i.e. the whole panel (a) to (d). 

Almost similar to the spin echo is a sequence called the gradient echo that makes use of gradient fields to introduce 180º flip instead of using refocusing pulses. There are several techniques to produce MRI echos and to allow a very rapid acquisition, but the topic is out of scope at the moment. A type of pulses called gradient recalled echo (GRE) forms the basis of most angiographic MRI.

Fig-5: In the first instance (a), the magnetization has been flipped onto the XY plane. Afterward, a spin-echo can be produced by introducing a refocusing RF pulse in (b) that flips the net magnetization vector along the X-axis. See panel (c) that depicts the moment just after the 180-deg flip. After the flip in (d) the vector position shown becomes similar to that in (a) when the 90-deg excitation pulse was just briefly introduced. At this point, the resonance signal is at its maximum, and it is the best time to acquire or "Read". Adapted from [1].



Further development of gradient echo is the Echo Planar Imaging (EPI). An EPI sequence forms the basis for functional MRI and diffusion-weighted imaging. In the EPI sequence, multiple refocusing pulses are applied in the phase encoding Gy continuously. Rather than returning to (0,0) EPI sequence allows a transition to the next level simply by continuing the trajectory controlled by positive and negative frequency encoding gradient Gx. This allows for the continuous streaming of readout. What happens in k-space? We are able to cover k-space as quickly as possible by filling up one axis within a single shot of spin-echo, resulting in much faster image acquisition. Refer to Fig-6 below and see the arrow upward at either side denoting the image reconstruction process (compared it with Fig-4). The drawback of the EPI sequence is its poor resolution and contrast, e.g. 3 mm is very common. The EPI method was proposed by Peter Mansfield. More on EPI can be found here.
Fig-6: The pulse diagram for EPI sequence mainly used in functional MRI (fMRI). Taken from [1]. Although EPI sequence is attractive, it invites some issues with respect to local distortion, image ghosting, and high requirement in data sampling rate. For these and other tradeoffs, EPI yields to a poorer resolution.


Epilogue
There are three main imaging modalities popular for brain imaging I would say. The first two, CT scan and PET scan, have been popular since the early '90s. CT scanning stands for computerized tomography and it makes use of X-ray principles to produce high-resolution brain images. CT images are static. PET or positron emission tomography makes use of radioactive tracer injected into the body to produce functional brain images. PET is able to detect biochemical processes in the brain and thus dynamic. The third imaging tool, MRI, makes use of the nuclear magnetic resonance effect of the spinning protons. MRI is attractive because it provides better spatial resolution and hydrogen atoms are already abundant in the body.

The basic physics of NMR has previously been explained. In brief, MRI technology makes use of the magnetic properties of hydrogen atoms or protons. When placed under the influence of changing magnetic fields, different tissues in the brain have different properties of spinning protons. These differences can be observed in terms of relaxation time (T1 or T2). To produce a full 3D image we utilize three different gradient fields. Lastly, different imaging quality and quantity are influenced by different pulse sequence parameters. In practice, MRI physicists often use a dummy model called phantom to test the performance of a new pulse sequence.

In the subsequent post, functional MRI or fMRI will be discussed. This type of functional imaging is derived from MRI technology that is able to capture changes related to neuronal function in successive images. Unlike MRI, fMRI is not static. And unlike PET, there is no need to administer any radioactive tracer to produce image contrast. Rather, we can make use of our blood as the natural contrast agent. The method is called blood-oxygen level-dependent fMRI or BOLD-fMRI and this invention was discovered by Seiji Ogawa in 1990 using a gradient-echo imaging sequence. 


Most recently, the introduction of the multiband (MB) or simultaneous multi-slice (SMS) EPI technique effectively shortens acquisition time without decreasing TE and maintaining the same SNR by simultaneous acquisition of multiple slices at one go. For a review, refer to Feinberg and Setsompop (2013).


References
[1]  Jezzard, P., Mathhews, P. M., and Smith, S. M. (2001). Functional MRI: An Introduction to Methods. Oxford University Press.    
[2]  Missimo, Filippi. (2009). fMRI Techniques and Protocols, 1st ed.. Humana Press - Springer. 
[3]  Basic MRI principles (Youtube)
[4]  Box 19-3 of Chapter 19 (pp.370-374). In Kandel E.R. et. al. (2000). Principles of Neural Science 4e, McGraw-Hill.