## Friday, April 27, 2018

### Frequency Encoding and Phase Encoding

Intermediate Physics for Medicine and Biology: Frequency Encoding and Phase Encoding
I’m always searching for ways to illustrate concepts using “simple” analytical examples (I’ll let you decide whether or not this example is simple). Today, I present analytical examples of frequency and phase encoding during magnetic resonance imaging. Russ Hobbie and I discuss MRI in Chapter 18 of Intermediate Physics for Medicine and Biology.

#### 1. Introduction

Our goal is to understand how the measured MRI signal changes when magnetic field gradients are present. These gradients are essential for “encoding” information about the spatial distribution of spins in the frequency and phase of the signal. To simplify our discussion, we make several assumptions:
• The radio-frequency π/2 and π pulses, used to rotate the spins into the x-y plane and then create an echo, are so brief that the spins rotate instantaneously compared to all other time scales. Similarly, any slice selection gradient Gz = dBz/dz exists only during the radio-frequency pulses. We won’t include Gz in our drawings of pulse sequences.
• We ignore relaxation, so the longitudinal and transverse time constants T1 and T2 are infinite.
• Despite ignoring relaxation, the spins do dephase leading to a free induction decay with time constant T2*. Dephasing is caused by a distribution of spin frequencies, corresponding to small-scale static heterogeneities of the magnetic field. We assume that the spin frequencies ω have the distribution
The peak frequency ωo is the Larmor frequency equal to γBo, where γ is the gyromagnetic ratio and Bo is the main magnetic field. The time constant τ indicates the width of the frequency distribution.

• The spins are distributed uniformly along the x axis from -Δx to +Δx.

#### 2. Spin-Echo

The spin-echo pulse sequence, with no gradients and no frequency or phase encoding, is similar to Fig. 18.24 in IPMB. Our pulse sequences consist of three functions of time. The radio-frequency (RF) pulses are shown on the first line; the time between the π/2 and π pulses is TE/2. The magnetic field gradient in the x direction, Gx = dBz/dx, is indicated in the second line; for this first example Gx is zero. The recorded signal, Mx, is in the third line.
Our goal is to calculate Mx(t). During the time between the two radio frequency pulses, we calculate the signal by integrating the precessing spins over x and ω

In this case the x integral is trivial: the integrand does not depend on x. We can solve the ω integral analytically using the u-substitution u=τ(ω-ωo), the cosine addition formula cos(A+B) = cosA cosB – sinA sinB, and the definite integral
The resulting free induction decay (FID) is

where τ corresponds to T2*. The exponential shape of the free induction decay arises from the particular form of our spin distribution. The wider the distribution of frequencies, the faster the decay.

The spins accumulate phase relative to those precessing at the Larmor frequency. Just before the π pulse the extra phase is (ω-ωo)TE/2. The π pulse changes the sign of this phase, or in other words adds an additional phase -(ω-ωo)TE. After the π pulse the signal is

The x integral is again trivial and the ω integral produces an echo

which peaks at t = TE and decays with time constant τ.

#### 3. Phase Encoding

Phase encoding adds a gradient field Gx of duration T between the radio-frequency π/2 and π pulses. It shifts the phase of the spins by different amounts at different x locations (thus, position information is encoded in the phase of the signal). This phase shift is then reversed by the π pulse.
The trickiest part of calculating Mx(t) is keeping track of the phase shifts: (ω-ωo)t is the phase shift up to time t because of the distribution of frequencies, -(ω-ωo)TE arises because the spins are flipped by the π pulse, γGxxT is caused by the phase-encoding gradient, and -2γGxxT is again from flipping by the π pulse. During the echo the signal simplifies to

We can solve both the x and ω integrals by repeatedly using the cosine addition formula (it is tedious but not difficult; I leave the details to you), and find

The amplitude of the echo depends on the factor sin(γGxΔxT)/ (γGxΔxT). For a Gx of zero this factor is one and the result is the same as for the spin-echo. If we repeat this pulse sequence with different values of Gx and measure the amplitude of each echo, we can trace out the function sin(γGxΔxT)/ (γGxΔxT), which is the Fourier transform of the spin distribution as a function of position.

#### 4. Frequency Encoding

To do frequency encoding, we add a readout gradient Gx that is on during the echo and lasts a time T, like in Fig. 18.26 of IPMB. In addition, we include a prepulse of opposite polarity and half duration just before the readout, to cancel any extra phase shift accumulated during the echo. (Russ and I discuss this extra lobe of the Gx pulse when analyzing Fig. 18.29c, but we get its sign wrong).

The free induction decay and the phase reversal caused by the π-pulse are the same as in the spin-echo example. Once Gx begins the result differs. The frequency again depends on x. The phase shifts are: (ω-ωo)t because of the distribution of frequencies, -(ω-ωo)TE from the π pulse, -γGxxT/2 caused by the prepulse, and γGxx(t-(TE -T/2)) during readout. The recorded signal simplifies to

The echo during the readout gradient is (you really must fill in the missing steps yourself to benefit from this post)
The envelope of the echo is the product of two terms, which are both functions of time: An exponential e-|t-TE|/τ that has the shape of the echo with no gradient, and a factor sin(γGxΔx(t-TE))/ (γGxΔx(t-TE)). The amplitude of the echo at t=TE is the same as if Gx were zero, but the shape of the echo has changed because of the time-dependent factor containing the gradient. The function containing the sine is the Fourier transform of the spin distribution. Therefore, the extra time-dependent modulation of the echo by Gx contains information about the spatial distribution of spins.

#### 5. Conclusion

What do we learn from this example? A phase-encoding gradient changes the amplitude of the echo but not its shape. A frequency-encoding gradient, on the other hand, changes the shape but not the amplitude. Both can be written as a modulated Larmor-frequency signal. In the pulse sequences shown above, the Larmor frequency is drawn too low in order to make the figure clearer. In fact, the Larmor frequencies in MRI are many megahertz, and thousands of oscillations occur during the free induction decay and echo.

I analyzed both phase encoding and frequency encoding in the x direction and considered each individually, because I wanted to compare and contrast their behavior. In practice, frequency encoding is performed using a Gx gradient in the x direction and phase encoding with a Gy gradient in the y direction, mapping out the two-dimensional Fourier transform of the spin distribution (see IPMB for more).

Until I did this calculation I never completely understood what the shape of the echo looks like during readout. I hope it helps you as much as it helped me. Enjoy!

## Friday, April 20, 2018

### Listmania! IPMB

Intermediate Physics for Medicine and Biology: Listmania! IPMB

Amazon used to have a feature called Listmania! You could make a list of up to 40 books that was visible at Amazon's website. Ten years ago I created a Listmania! list related to Intermediate Physics for Medicine and Biology, reproduced below. Because the list is old, it does not include recent books (such as The Optics of Life) or books that I have discovered recently (such as The First Steps in Seeing). To learn about newer books, search this blog for posts labeled “book review.” Amazon has discontinued Listmania!, but you can still find the lists if you look hard. I miss it.

If you are interested in what I read for pleasure, look here.

Enjoy!

**********************************************************

# Intermediate Physics for Medicine and Biology

The list author says: “Books that are cited by the 4th edition of Intermediate Physics for Medicine and Biology. These are some of the best biological and medical physics books I know of, and are books that have been useful to me during my career.”
 Intermediate Physics for Medicine and Biology, 4th edition (Biological and Medical Physics, Biomedical Engineering) All the books listed below are cited in the 4th Edition of Intermediate Physics for Medicine and Biology, written by Russ Hobbie and me.
 Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables [Applied Mathematics Series 55] A math handbook that has everything you'll ever need to know.
 The 2nd Law: Energy, Chaos, and Form (Scientific American Library Paperback) I love this coffee table book about the second law of thermodynamics.  A painless way to introduce yourself to the subject.
 Introduction to Radiological Physics and Radiation Dosimetry Classic in the Medical Physics field.
 The Essential Exponential! (For the Future of Our Planet) This book explains why we devoted an entire chapter of Intermediate Physics for Medicine and Biology to the exponential function.
 Physics With Illustrative Examples From Medicine and Biology: Mechanics (Biological and Medical Physics, Biomedical Engineering) A classic textbook.
 Physics With Illustrative Examples From Medicine and Biology: Electricity and Magnetism (Biological and Medical Physics, Biomedical Engineering) The second edition of the book has much the same content as the first, but the quality of the printing and illustrations is vastly improved.
 Physics With Illustrative Examples From Medicine and Biology: Statistical Physics (Biological and Medical Physics, Biomedical Engineering) Benedek and Villars were pioneers in biological and medical physics textbooks.
 Random Walks in Biology The best book about the role of diffusion in biology that I know of.
 Foundations of Medical Imaging Fine book to study imaging algorithms.
 Introduction to Membrane Noise Great book on a little-known topic.
 Air and Water One of my favorites. Written by a physiologist with an interest in physics (as opposed to Hobbie and I, who are physicists interested in physiology).
 Quantum Physics of Atoms, Molecules, Solids, Nuclei, and Particles My favorite modern physics textbook.
 The Feynman Lectures on Physics (3 Volume Set) (Set v) What physics list could be complete without Feynman?
 From Clocks to Chaos Excellent book to learn the biological and medical applications of chaos.
 The Machinery of Life Wonderful picture book.  Great way to visualize the relative sizes of biological objects.
 Bioelectricity and Biomagnetism Good, thick tome on bioelectricity.
 Textbook of Medical Physiology The classic physiology textbook.
 Medical Imaging Physics Standard textbook in medical physics. Hendee is a pioneer in the field.
 Ion Channels of Excitable Membranes, Third edition The bible for information about ion channels.
 Machines in Our Hearts: The Cardiac Pacemaker, the Implantable Defibrillator, and American Health Care Learn about the history of pacemakers and defibrillators.
 Bioelectromagnetism: Principles and Applications of Bioelectric and Biomagnetic Fields Fine textbook on bioelectricity.
 Powers of Ten (Revised) (Scientific American Library Paperback) Classic work describing how the world looks at different length scales. Required reading by anyone interested in science.
 Electric Fields of the Brain: The Neurophysics of EEG, 2nd edition Great way to learn about the physics of the electroencephalogram.
 Bioelectricity: A Quantitative Approach Standard textbook for a class in bioelectricity.
 Numerical Recipes 3rd edition: The Art of Scientific Computing My go-to book on numerical methods.
 Electricity and Magnetism (Berkeley Physics Course, Vol. 2) Best introduction to electricity and magnetism I know. Part of the great Berkeley Physics Course.
 Statistical Physics: Berkeley Physics Course, Vol. 5 Great intuitive introduction to statistical mechanics.  Part of the Berkeley Physics Course.
 Div, Grad, Curl, and All That: An Informal Text on Vector Calculus (Fourth edition) Need a little review of vector calculus? This is the place to find it.
 Scaling: Why is Animal Size so Important? Great book on biological scaling.
 How Animals Work Great physiology book. Quirky, but fun.
 Nonlinear Dynamics And Chaos: With Applications To Physics, Biology, Chemistry, And Engineering (Studies in Nonlinearity) Best book for a first course in nonlinear dynamics.
 Life in Moving Fluids: The Physical Biology of Flow (Princeton Paperbacks) Best book I know of on biological fluid dynamics. Not too mathematical, but full of insight. I recommend all of Vogel's books.
 Vital Circuits: On Pumps, Pipes, and the Workings of Circulatory Systems Great for understanding the fluid dynamics of the circulatory system.
 Lady Luck: The Theory of Probability (Dover Books on Mathematics) I often find probability theory boring, but not this book. An oldie but goodie.
 The Geometry of Biological Time (Interdisciplinary Applied Mathematics) Classic by Art Winfree, who was a leading mathematical biologists.  Be sure to get the 2nd edition.
 When Time Breaks Down: The Three-Dimensional Dynamics of Electrochemical Waves and Cardiac Arrhythmias Winfree's classic on the nonlinear dynamics of the heart.
 Cardiac Electrophysiology: From Cell to Bedside, 4e Comprehensive reference on cardiac electrophysiology.