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 spin frequency distribution in an example of frequency encoding and phase encoding for magnetic resonance imaging.
    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.

    A plot of the spin frequency distribution in an example of frequency encoding and phase encoding for magnetic resonance imaging.
  • The spins are distributed uniformly along the x axis from -Δx to +Δx.
    A plot of the spin distribution in an example of frequency encoding and phase encoding for magnetic resonance imaging.

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.
MRI Spin-echo pulse sequence
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 ω

An integral giving the free induction decay during magnetic resonance imaging.

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
A definite integral of cos(my)/(1+y^2)
The resulting free induction decay (FID) is

A mathematical expression for the free induction decay duing magnetic resonance imaging.
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.
MRI phase encoding pulse sequence
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

An integral giving the echo during phase encoding in magnetic resonance imaging.

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

A mathematical expression for the echo during phase encoding in magnetic resonance imaging.

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).
MRI frequency encoding pulse sequence

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

An integral giving the echo during frequency encoding during magnetic resonance imaging.

The echo during the readout gradient is (you really must fill in the missing steps yourself to benefit from this post)
The echo during frequency encoding during magnetic resonance imaging.
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
A screenshot of the Listmania! for Intermediate Physics for Medicine and Biology.

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

 

 


Bradley J. Roth
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)
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]
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)
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
Introduction to Radiological Physics and Radiation Dosimetry
Classic in the Medical Physics field.
The Essential Exponential! (For the Future of Our Planet)
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)
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)
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)
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
Random Walks in Biology
The best book about the role of diffusion in biology that I know of.
Foundations of Medical Imaging
Foundations of Medical Imaging
Fine book to study imaging algorithms.
Introduction to Membrane Noise
Introduction to Membrane Noise
Great book on a little-known topic.
Air and Water
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
Quantum Physics of Atoms, Molecules, Solids, Nuclei, and Particles
My favorite modern physics textbook.
The Feynman Lectures on Physics (3 Volume Set) (Set v)
The Feynman Lectures on Physics (3 Volume Set) (Set v)
What physics list could be complete without Feynman?
From Clocks to Chaos
From Clocks to Chaos
Excellent book to learn the biological and medical applications of chaos.
The Machinery of Life
The Machinery of Life
Wonderful picture book.  Great way to visualize the relative sizes of biological objects.
Bioelectricity and Biomagnetism
Bioelectricity and Biomagnetism
Good, thick tome on bioelectricity.
Textbook of Medical Physiology
Textbook of Medical Physiology
The classic physiology textbook.
Radiobiology for the Radiologist
Radiobiology for the Radiologist
Great place to learn about the biological effects of radiation.
Medical Imaging Physics
Medical Imaging Physics
Standard textbook in medical physics. Hendee is a pioneer in the field.
Ion Channels of Excitable Membranes, Third Edition
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
Machines in Our Hearts: The Cardiac Pacemaker, the Implantable Defibrillator, and American Health Care
Learn about the history of pacemakers and defibrillators.
The Physics of Radiation Therapy
The Physics of Radiation Therapy
The place to go to learn about radiation therapy.
Bioelectromagnetism: Principles and Applications of Bioelectric and Biomagnetic Fields
Bioelectromagnetism: Principles and Applications of Bioelectric and Biomagnetic Fields
Fine textbook on bioelectricity.
Powers of Ten (Revised) (Scientific American Library Paperback)
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
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
Bioelectricity: A Quantitative Approach
Standard textbook for a class in bioelectricity.
Numerical Recipes 3rd Edition: The Art of Scientific Computing
Numerical Recipes 3rd edition: The Art of Scientific Computing
My go-to book on numerical methods.
Electricity and Magnetism (Berkeley Physics Course, Vol. 2)
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
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)
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?
Scaling: Why is Animal Size so Important?
Great book on biological scaling.
How Animals Work
How Animals Work
Great physiology book. Quirky, but fun.
Nonlinear Dynamics And Chaos: With Applications To Physics, Biology, Chemistry, And Engineering (Studies in Nonlinearity)
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)
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
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)
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)
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
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
Cardiac Electrophysiology: From Cell to Bedside, 4e
Comprehensive reference on cardiac electrophysiology.

Friday, April 13, 2018

Blog to IPMB Mapping

Intermediate Physics for Medicine and Biology: Blog to IPMB Mapping One reason I write this blog is to help instructors who are teaching from Intermediate Physics for Medicine and Biology. The blog, however, is over ten years old, and there are more than 500 posts. Teachers may not be able to find what they need.

Help is here! I have prepared a mapping of the sections in IPMB to the weekly blog posts (see an excerpt below). You can find it here, or through the book website, or download the pdf (but the links might not work). Now an instructor teaching, say, Section 1.1 (Distances and Sizes) can find eight related posts. I will keep the file up-to-date as new posts appear.

A screenshot of part of the blog to IPMB mapping, for Intermediate Physics for Medicine and Biology.

Some posts, including many of my favorites, are not associated with a particular section; I did not include those. A few posts fit with two or three sections, and appear several times. The majority relate to a single section.

What do I write about most? Four sections in IPMB have ten or more related posts.
  • Section 9.10, Possible Effects of Weak External Electric and Magnetic Fields, 11 posts. Many of these posts debunk myths about the dangers of weak low-frequency fields.
  • Section 17.7, Radiopharmaceuticals and Tracers, 11 posts. Several posts discuss potential shortages of technetium.
  • Section 16.2, The Risk of Radiation, 19 posts. These posts are about radiation accidents, the “risk” of very low doses of radiation, and the linear-no-threshold model.
  • Section 7.10, Electrical Stimulation, 20 posts. This section reflects my research interests, with multiple posts describing pacemakers, defibrillators, and neural stimulation.
Which chapters have the most posts? In first place are Chapters 8 (Biomagnetism) and 16 (Medical Uses of X-Rays), each with 39. Tied for last are Chapters 3 (Systems of Many Particles) and 5 (Transport Through Neutral Membranes), each with only 11. I guess I don’t like to post about thermodynamics.

I hope this mapping from IPMB to the blog helps instructors use the textbook. Enjoy!