Education, tips and tricks to help you conduct better fMRI experiments.
Sure, you can try to fix it during data processing, but you're usually better off fixing the acquisition!

Saturday, February 3, 2024

Core corriculum: Mathematics I - Linear algebra

 

What is linear algebra? To get us going, I'm going to use the excellent lecture series by 3Blue1Brown and do my best to add some MRI-related questions after each video. Hopefully the connections won't be too cryptic. Don't worry if you can't answer my questions. It's more important that you understand the lectures. No doubt you'll find other material on YouTube and web pages to clarify things.

Let's start with a couple of definitions. While you'll find many examples online, for our purposes we can assume that a linear system is one where the size of the output or outputs scales in proportion to the input or inputs. The take-home pay of a worker paid an hourly rate is linear. They might receive their base amount, say 40 hours per week, plus some amount of overtime at twice their hourly rate. The total is still the linear combination of the base plus overtime amounts.

Non-linear systems don't have this simple proportionality. Gravity is the classic physics example. The strength of the interaction between two massive objects changes as the reciprocal of the squared distance (r^2) between them, that is, as 1/r^2. Finding yourself dangling ten meters in the air above the earth is very different from finding yourself ten more meters away from the earth at a height of 1000 km. In the first case you are about a second away from impacting the ground. In the second case you are in orbit and your more immediate health concerns are lack of oxygen and your temperature.

And what about the term algebra? It's just fancy speak for using symbols to represent the relationships between things that vary. We're going to be interested in changes at different positions in space - points in an image - and so we shall eventually use matrices to perform linear algebra. But we have to build up to a matrix from its skinnier cousin, the vector.


1. Vectors: Essence of linear algebra

 


Q: We will use both a physicist's and a computer scientist's view of vectors at different points in the fMRI process. Given what you know today, can you guess where these different viewpoints might come up? Hint: fMRI is based on MRI, which is a physical measurement technique, while fMRI is typically the analysis of a time series of a certain type of dynamic MRI scans.

 

Q: Changes of basis are quite common in MRI. Even the way we usually label image axes involves a change of basis. The magnet bore direction is labeled the z-axis, while left-to-right is the x-axis and up-down is the y-axis. We refer to this assignment as the lab (or magnet) frame of reference. Now consider an axial MR image of a person's brain. An axial slice lies in the x-y plane in the magnet basis (or lab frame if you prefer). Yet we don't generally label the image with (x,y) dimensions. Instead we use (L-R, A-P) where L-R is left-to-right and A-P means anterior-to-posterior. This is an anatomical basis. How might an anatomical basis be more useful than using a magnet basis in MRI?


3. Linear transformations and matrices:

 


Q: We usually label images using a basis (or reference frame) related to the subject's anatomy, i.e. with the (orthogonal) axes labeled head-to-foot (HF), left-to-right (LR) and anterior-posterior (AP). This means if a subject's head isn't perfectly straight in the magnet - let's say, the head is rotated 20 degrees to the left - the brain still appears straight in the 2D image. But here's the thing. The MRI hardware is controlled using the (x,y,z) "lab" reference frame. The anatomical and lab bases can be related to each other through a rotation matrix. Can you write down what a rotation matrix might look like that relates the subject's anatomical reference frame to the scanner's lab (x,y,z) reference frame?

________________



Thursday, January 25, 2024

Core curriculum: How to learn from videos

 

Make coffee, fire up YouTube, click, watch, go about your day. Not so fast! To actually learn the material you'll see, you will need a minimum of the lecture itself, some sort of reading around the lecture (which could be reviewing a transcript or supporting documents), and then answer some questions on that material. So, as this excellent didactic lecture from an anesthesiologist makes clear, questioning is key:

 

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

 

I don't have banks of questions ready to pepper you with at the end of each video, I'm afraid, although I will try to come up with a few questions as homework.

If you want to take it to the pro level, try to explain what you've just learned to a novice. Nothing makes you learn something like having to teach it:


  https://www.youtube.com/watch?v=_f-qkGJBPts

 

Nobody to discuss it with or teach it to? Try preparing a one or two slide summary as if you are about to give a presentation on it. Practice presenting the summary just like you would any other presentation. Dry runs are almost as good as the real thing.

A major benefit of using videos on YouTube is that you can stop and rewind as much as you like! (If you didn't know, your back and forward arrow keys take you back or forward 5 seconds on YouTube videos. Saves from the imprecision of the progress bar.) You can watch the video then listen to the words, then watch again, as you like.

Also consider taking notes as you go. No need to worry about missing something. Just pause and/or rewind as needed. One of my better high school teachers used to berate us if we claimed to be studying without a pen in hand. He claimed reading alone was almost useless. We had to read and write to learn. Perhaps you have some tips to share in the comments. Maybe even a link to a good video on how to learn from videos:

 

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

 

Whatever you do, set up a system for yourself and don't just be a passive viewer.

________________


HOMEWORK: Some people are of the opinion that taking notes during a lecture is a bad idea. I reviewed at least one video telling me as much. And yet 99% of my undergraduate classes were exactly that: someone droned on at the front, writing on a chalk board (no dry erase back in them days!), while we scribbled as fast as we could. For a technical subject like neuroimaging (or chemistry), what is a major benefit of writing notes during a lecture? What is a potential cost of writing notes instead of just listening and perhaps trying to summarize afterwards in a debrief?


Wednesday, January 24, 2024

Core curriculum: An introduction

After much delay, I am finally going to start developing the core curriculum I suggested in December 2021. At that time, I imagined recruiting a group of 10-15 domain experts to provide the bulk of material under each separate discipline. That might have worked. Indeed, it could still work if an appropriate group such as the OHBM education committee decides to have a go. But I'm going to try something different. To borrow a phrase from blockchain folks, I want to be permissionless. I'm going to try to collate publicly available material myself, with occasional assistance from others if and when I get proper stuck. Trying to do it all myself should provide me with an interesting set of learning experiences, I hope, and it should also help guarantee that anyone, anywhere with access to YouTube can participate.

So, how's this gonna go? Not sure, it's an experiment. I have the following main disciplines listed and as of now I plan on tackling them in this order (although I may well start on some of the later ones before finishing the earlier ones). I'm just gonna start and see what happens. I will aim for one post a week, equivalent to 1-2 hours of learning. As I go, I will do my best to organize the collection - for example, all will have Core curriculum somewhere in the title, plus appropriate labels - and once there are enough of them I'll create a main page with links; a virtual contents table.

Likely major themes, in likely order:

  • How to learn from videos
  • Mathematics
  • Physics
  • Engineering
  • Biology
  • Biophysics
  • Image processing & analysis
  • Statistics
  • Psychology
  • Experimental design
  • Practical issues

Why this order? The logic is to try to build concepts on concepts. It's hard to understand most important engineering concepts without a decent understanding of some physics, which itself requires some decent understanding of certain mathematics, and so on. And, as noted in my Dec 2021 post, the goal here is to cover material that is non-volatile over decades. It's about the fundamental concepts, not the state-of-the-art. 

Right, enough preamble. Time to get going! 

----

 

 

Infrequently asked questions:

Q: Where's your Twitter?  A: Gawn, all gawn. Got X'd out.

Q: Can we comment or make suggestions?  A: Yup. I'll do my best to answer comments to the posts, and my email still works.

Q: What do you mean by "non-volatile over decades?"  A: I'm taking my inspiration from the established sciences. Consider chemistry. Any chemist trained in a university anywhere in the world understands the Periodic Table and why the first row transition elements are different from the noble gases. They also understand carbon valence, pH, catalysis and hopefully some thermodynamics. These subjects are all fundamental to the field of chemistry and are unchanged whether they are learned in England, Sri Lanka or Venezuela. They also haven't changed fundamentally since I learned about them in the 1980s. 

Q: Why Blogger and not Substack or some newer platform?  A: Inertia. There's a dozen years of history on this site and a lot of it still applies. Indeed, I hope some of it will be getting re-used in the core curriculum! 

Q: Are you going to go back to more topical tips?  A: I don't have plans to, but if there's something important to cover then I may. However, I won't be going back to writing the series on fMRI artifacts or physiological confounds, at least not at this time. I'm focused on the fundamentals right now. Seeing way too many un(der)prepared folk still coming into neuroimaging.


Monday, December 13, 2021

A core curriculum for fMRI?

Blimey. Judging by the reaction to my earlier Tweet, there's something to be done here. And it makes sense because fMRI has been around for thirty years yet seems to be as ad hoc today as it was at its genesis. We're half the age of modern electronic computing, twice as old as Facebook and Twitter. FMRI predates the NCSA Mosaic web browser, for goodness sake. Let that sink in for a minute.

This is something I've been pondering for a long time. In 2010 I thought I might write a textbook to capture what I saw as the fundamental knowledge that every fMRIer would need to know to set up and run an experiment. I started writing this blog as a way to draft chapters for the textbook. The textbook idea got, uh, shelved as early as 2011, once I realized that a blog is better-suited to delivering content on a subject that is inherently dynamic. Try embedding a movie in a textbook! But then the blog, in its original guise, sorta ran out of steam a few years ago, too. And the main reason why I ran out of steam is directly relevant to this post. I was getting into areas about which I know little to nothing, in an attempt to be able to write blog posts relevant to fMRI research. Take the post series on "fMRI data modulators," my rather clunky term for "that which causes your fMRI time series to vary in ways you probably don't want." I was having to try to teach myself respiratory and vascular physiology from scratch. The last time I sat in a formal biology class I was 13. Recently, I've encountered machine learning, glucose metabolism, vascular anatomy and a slew of other areas about which I know almost nothing. Where does one start????

On the assumption that I'm not alone, it would seem there's a trade to be made. If I can teach k-space to a psychologist, surely a statistician can teach an anatomist about normal distributions, a biochemist can teach an electrical engineer about the TCA cycle, and so on. With very few exceptions, all of us could really use better foundational knowledge somewhere. We are all impostors!

No doubt your first reaction is "Sounds lovely, but nobody has the time!" I respectfully disagree. You are likely already spending the time. My suggestion is to determine whether there might be a more efficient way for you to spend your time, by joining a pool of like-minded "teachers" who will cover the things you can't or won't cover. So, here is a throwaway list of things to consider before you pass judgment:

  • We are all trying to do/learn/teach the same things! There ought to be a more efficient way to do it.
  • The core concepts needed to understand and run fMRI experiments change relatively slowly. The shelf life of the fundamentals should last a decade or more. Updates can be infrequent.
  • Most of us have limited teaching resources. Few, if any institutions can cover all the core areas well.
  • My students become your postdocs. Wouldn’t you want them to arrive with a solid base?
  • Today’s students are tomorrow’s professors. If we are to improve teaching overall, we have to start at the bottom, not at the top.
  • A lot of topical problems (including poor replication, double-dipping, motion sensitivity, physiologic nuisance fluctuations) could be reduced at source by people setting up and executing better experiments through deeper knowledge. Crap in, crap out.
  • We are all super busy, yet the effort to contribute to a distributed syllabus could be a wash, perhaps even a net reduction, because you won't have to BS your way through stuff you don't really understand yourself.
  • I want to learn, too! It’s hard to determine an efficient path through new areas! I need a guide.

 

That just leaves the final step: doing it. Until he regrets his offer, Pradeep Raamana has generously offered use of his Quality Conversations forum to commence organizing efforts. I envision a first meeting at which we attempt to define all the main areas that comprise a "core syllabus" for fMRI. This would include, at the very least, NMR physics, MRI physics, various flavors of physiology, some biochemistry, neuroanatomy, basic statistics, machine learning, experimental design and models, scanner design, etc. If we can identify 6-8 umbrella areas then I'd look to create teams for each who would actually determine what they consider to be core, or fundamental, to their domain. Most likely, it's the stuff with a very long shelf life. We're not trying to be topical, the goal is to give everyone practicing fMRI a basic common framework. We want to define the equivalents of the Periodic Table in chemistry, Newtonian mechanics in physics, eukaryotic cell structure in biology, etc.

Doable? Drop your thoughts below.


Tuesday, February 16, 2021

Restraining the 32-channel coil

There has been a move towards custom head restraint in recent years. These devices are tailored to fit the subject in such a way that any movement of the head can be transmitted to the coil. It is therefore imperative to make sure that the RF coil is also well restrained.

On Siemens Trio and Prisma scanners, the 32-channel head coil is a special case. It was designed independent of the standard head coils. Restraint on the bed is thus a bit of an afterthought. Sticky pads on the base of the coil are designed to prevent movement through friction, but there are gaps on all four sides and no specific mechanism - slots, grooves, etc. - to lock the coil into a particular position. On my Trio, I was in the habit of putting the 32-channel coil all the way back to the frame of the bed, assuming that the most likely direction of motion from a subject would be backwards. Problem solved, right? No. By putting the coil all the way back, when using custom head restraint I actually put stress on the front two coil cables and this led to intermittent receive RF artifacts. A more refined fix was necessary.

My engineer built a simple frame (see photos below) that fits snugly into the rear portion of the bed frame and forces the coil onto protrusions that hold the standard (12-channel) coils properly. It also shims out the left and right gaps so there is no chance of side to side motion, either. With this device in place, the coil can only go one way: up. 

There has been some debate in the literature about the utility of custom head restraint for motion mitigation, with one group finding benefits while another found it made things worse. I note that both groups were using 32-channel coils on a Prisma, so proper head coil restraint may be a reason for different outcomes. I am now working on a fix for Prisma scanners and will do a separate post on the solution once it's been tested. (ETA April-May.) Until then, if you use a 32-channel coil on any Siemens scanner, my advice is to use additional restraint and make sure your coil is in a reliable, stable position. 

 

The coil restraint shim is put into position before the 32-channel coil.


Coil restraint shim in position.






Monday, February 25, 2019

Using multiband-EPI for diffusion imaging on low-dimensional array coils


This is a continuation of the previous post looking at MB-EPI on a receive coil with limited spatial information provided by its geometry, such as the 12-channel TIM coil or the 4-channel neck coil on a Siemens Trio.

Simultaneous multi-slice (SMS), aka multi-band (MB), offers considerable time savings for diffusion-weighted imaging (DWI). Unlike in fMRI, where MB factors of 4 or more are quite common, in DWI few studies use MB factors greater than 3. While it may be feasible in principle to push the acquisition time even lower without generating artifacts using a large array coil like the Siemens 32-channel coil, we run into another consideration: heating. Heating isn't usually a concern for gradient echo MB-EPI used in conventional fMRI experiments. In fMRI, the excitation flip angles are generally 78° or less. But with DWI we have a double whammy. Not only do we want a large excitation flip angle to create plenty of signal, we also require a refocusing pulse that is, by convention, set at twice the flip angle of the excitation pulse. (The standard nomenclature is 90° for excitation and 180° for refocusing, but the actual angles may be lower than this in practice, for a variety of reasons I won't go into here.) Now the real kicker. The heat deposition, which we usually measure through the specific absorption rate (SAR), scales quadratically with flip angle. Thus, a single 180° refocusing pulse deposits as much heat as four 90° pulses! (See Note 1.) But wait! It gets worse! In using simultaneous multi-slice - the clue's in the name - we're not doing the equivalent of one excitation or refocusing at a time, but a factor MB of them. Some quick arithmetic to give you a feel for the issue. A diffusion scan run with 90° and 180° pulses, each using MB=3, will deposit fifteen times as much heat as a conventional EPI scan run at the same TR but with a single 90° pulse. On a 3 T scanner, it means we are quickly flirting with SAR limits when the MB factor goes beyond three. The only remedy is to extend TR, thereby undermining the entire basis for deploying SMS in the first place.

But let's not get ahead of ourselves. With a low-dimensional array such as the Siemens 12-channel TIM coil we would be delighted to get MB to work at all for diffusion imaging. The chances of flirting with the SAR limits are a distant dream.


Phantom tests for diffusion imaging

The initial tests were on the FBIRN gel phantom. I compared MB=3 and MB=2 for the 32-channel, 12-channel and neck coils using approximately the same slice coverage throughout. The TR was allowed to increase as needed in going from MB=3 to MB=2. Following CMRR's recommendations, I used the SENSE1 coil combine option throughout. I also used the Grad. rev. fat suppr. option to maximize scalp fat suppression, something that we have found is important for reducing ghosts in larger subjects (especially on the 32-channel coil, which has a pronounced receive bias around the periphery). For the diffusion weighting itself, I opted to use the scheme developed for the UK Biobank project, producing two shells at b=1000 s/mm² and b=2000 s/mm², fifty directions apiece. Four b=0 images are also included, one per twenty diffusion images. (For routine use we now actually use ten b=0 images, one every ten DW images, for a total of 111 directions.) The nominal spatial resolution is (2 mm)³. The TE is 94.8 ms, which is the minimum value attainable at the highest b value used.

There are over a hundred images we could inspect, and you would want to check all of them before you committed to a specific protocol in a real experiment because there might be some strange interaction between the eddy currents from the diffusion-weighting gradients and the MB scheme. For brevity, however, I will restrict the comparisons here to examples of the b=0, 1000 and 2000 scans. I decided to make a 2x2 comparison of a single band reference image (SBRef), a b=0 image (the b=0 scan obtained after the first twenty DW scans), and the first b=1000 and b=2000 images in the series. While only a small fraction of the entire data set, these views are sufficient to identify the residual aliasing artifacts that tell us where the acceleration limit sits.

First up, the results from the 32-channel coil, which is our performance benchmark. No artifacts are visible by eye for any of the b=0, b=1000 or b=2000 scans at either MB=2 or MB=3:

32-channel coil, MB=3. TL: Single band reference image. TR: first b=0 image (21st acquisition in the series). BL: first b=1000 image. BR: First b=2000 image

Saturday, February 16, 2019

Using multi-band (aka SMS) EPI on on low-dimensional array coils


The CMRR's release notes for their MB-EPI sequence recommend using the 32-channel head coil for multiband EPI, and they caution against using the 12-channel head coil:

"The 32-channel Head coil is highly recommended for 3T. The 12-channel Head Matrix is not recommended, but it can be used for acceptable image quality at low acceleration factors."

But what does "low acceleration" mean in practice? And what if your only choice is a 12-channel coil? Following a couple of inquiries from colleagues, I decided to find out where the limits might be.

Let's start by looking at the RF coil layout, and review why the 12-channel coil is considered an inferior choice. Is it simply fewer independent channels, or something else? The figure below shows the layout of the 12-ch and 32-ch coils offered by Siemens:

From Kaza, Klose & Lotze (2011).

In most cases, the EPI slice direction will be transverse or transverse oblique (e.g. along AC-PC), meaning that we are slicing along the long axis of the magnet (magnet Z axis) and along the front-to-back dimension of the head coil. Along the long axis of the 12-ch coil there is almost no variation in the X-Y plane. At the very back of the coil the loops start to curve towards a point of convergence, but still there is no distinction in any direction in the X-Y plane. Compare that situation to the 32-ch coil. It has five distinct planes of coils along the Z axis. With the 32-ch coil, then, we can expect the hardware - the layout of the loops - to provide a good basis for separating simultaneously acquired axial slices, whereas there is no such distinct spatial information available from the coil elements in the 12-channel coil. In the 12-channel coil, every loop detects a significant and nearly equal fraction of any given slice along Z.