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!
Showing posts with label Gradients. Show all posts
Showing posts with label Gradients. Show all posts

Friday, March 2, 2018

Monitoring gradient cable temperature


While the gradient set is water-cooled, the gradient cables and gradient filters still rely upon air cooling in many scanner suites, such as mine. In the case of the gradient filters, the filter box on my Siemens Trio came with an opaque cover, which we replaced with clear plastic to allow easy inspection and temperature monitoring with an infrared (IR) thermometer:

The gradient filter box in the wall behind my Siemens Trio magnet. It's up at ceiling height, in the lowest possible stray magnetic field. The clear plastic cover is custom. The standard box is opaque white.


Siemens now has a smoke detector inside the gradient filter box, after at least one instance of the gradient filters disintegrating with excess heat. Still, a clear inspection panel is a handy thing to have.

The gradient cables between the filter box and the back of the magnet can also decay with use. If this happens, the load experienced by the gradient amplifier changes and this can affect gradient control fidelity. (More on this below.) The cables can be damaged by excess heat, and this damage leads to higher resistance which itself produces more heating. A classic feedback loop!


The Fluke 561 IR thermometer and a K type thermocouple, purchased separately.

Thursday, March 13, 2014

WARNING! Stimulation threshold exceeded!


When running fMRI experiments it's not uncommon for the scanner to prohibit what you'd like to do because of a gradient stimulation limit. You may even hit the limit "out of the blue," e.g. when attempting an oblique slice prescription for a scan protocol that has run just fine for you in the past. I'd covered the anisotropy of the gradient stimulation limit as a footnote in an old post on coronal and sagittal fMRI, but it's an issue that causes untold stress and confusion when it happens so I decided to make a dedicated post.

Some of the following is take from Siemens manuals but the principles apply for all scanners. There may be vendor-specific differences in the way the safety checking is computed, however. Check your scanner manuals for details on the particular implementation of stimulus monitoring on your scanner.

According to Siemens, then:



The scanner monitors the physiological effects of the gradients and prohibits initiating scans that exceed some predefined thresholds. On a Siemens scanner the limits are established according to two models, used simultaneously:



The scanner computes the expected stimulation that will arise from the gradient waveforms in the sequence you are attempting to run. If one or both models suggests that a limit will be exceeded, you get an error message. I'll note here that the scanner also monitors in real time the actual gradients being played out in case some sort of fault occurs with the gradient control.

Tuesday, July 3, 2012

Physics for understanding fMRI artifacts: Part Thirteen

A tour through a real EPI pulse sequence

In some posts I've got planned it will be important for you to know something about all of the different functional modules that are included in a real EPI pulse sequence. So far in this PFUFA series I've used schematics of the particular segment of the sequence that I was writing about, e.g. the echo train that covers 2D k-space for single-shot EPI. Except that there comes a time when you need to know about the sequence in its entirety, as it is implemented on a scanner. Why? Because there are various events that I've given short shrift - fat saturation and N/2 ghost correction, for instance - that have significant temporal overheads in the sequence, and these additional delays obviously affect how quickly one can scan a brain.

So, without further ado, here is a pulse sequence for fat-suppressed, single-shot gradient echo EPI, as used for fMRI:

(Click to enlarge.)

Okay, so it's not the entire pulse sequence. The readout gradient echo train in this diagram has been curtailed after just nine of 64 total gradient echoes that will be acquired, for EPI with a matrix of 64x64 pixels. The omitted 55 echoes are simply clones of the nine echoes that you can see. (Note that there are no additional gradient episodes at the end of this particular EPI sequence; all the crusher gradients occur at the start of the sequence and these are visible in the above figure. More on crusher gradients below.) I should also point out that this is the timing diagram for acquisition of a single 64x64 matrix EPI slice. The pulse sequence as shown would be repeated n times for n slices within each TR. (See Note 1.)


Interpreting what you see

Let's first determine what information is being displayed on the figure above. There are five axes, all handily labeled on the far right-hand side of the figure. The top axis is the RF transmit channel; we've got two RF pulses in this sequence. The second axis down is the receiver, or analog-to-digital converter (ADC) channel. The scanner is receiving signals only when there's a rectangle specified on the second axis. Finally, the bottom three axes represent the pulsed field gradients, in the order X, Y, Z.

Just for fun, let's quickly determine what the scanner is doing in the logical frame of reference, before we delve into the nitty-gritty. The slice selection gradient will occur in concert with an RF excitation pulse, and we have two RF pulses to choose from. Slice selection can't be the first RF pulse because that pulse occurs without any concomitant gradients. Thus, the slice excitation pulse must be the second one and we can deduce that slice selection is along the Z axis, which is the magnet bore axis. We're doing axial slices.

Monday, August 15, 2011

Physics for understanding fMRI artifacts: Part Eleven

Resolution and the field-of-view as seen in k-space

Understanding how distances in k-space manifest as distances in image space is quite straightforward. All you really need to remember is that the relationships are reciprocal. The discrete steps in k-space define the image field-of-view (FOV), whereas the maximum extents of k-space define the image resolution. In other words, small in k-space determines big in image space, and vice versa. In this post we will look first at the implications of the reciprocal relationship as it affects image appearance. Then we'll look at the simple mathematical relationships between lengths in k-space and their reciprocal lengths in image space.


Spatial frequencies in k-space: what lives where?

I mentioned in the previous post that there's no direct correspondence between any single point in k-space and any single point in real space. Instead, in k-space the spatial properties of the object are "turned inside out and sorted according to type" (kinda) in a symmetric and predictable fashion that leads to some intuitive relationships between particular regions of k-space and certain features of the image.

Here is what happens if you have just the inner (left column) or just the outer (right column) portions of k-space, compared to the full k-space matrix arising from 2D FT of a digital photograph (central column):

An illustration of the effect of nulling different regions of k-space from a full k-space matrix, applied to a digital picture of a Hawker Hurricane aircraft. The full k-space matrix and corresponding image are shown in the central column.

Inner k-space only:

The inner portion of k-space (top-left) possesses most of the signal but little detail, leading to a bright but blurry image (bottom-left). (See Note 1.) Most features remain readily apparent in the blurry image, however, because most contrast is preserved; image contrast is due primarily to signal intensity differences, not edges. If this weren't true we would always go for the highest signal-to-noise MRIs we could get, when in practice what we want is the highest contrast-to-noise images we can get! Imagine an MRI that had a million-to-one SNR but no contrast. How would you tell where the gray matter ends and the white matter begins? Without contrast no amount of signal or spatial resolution would help. So much for SNR alone!

Outer k-space only:

If we instead remove the central portion of k-space (top-right) then we remove most of the signal and the signal-based contrast to leave only the fine detail of the image (bottom-right). Strangely, though, it's still possible for us to make out the main image features because our brains are able to interpret entire objects from just edges. In actuality, however, there is very little contrast between the dark fuselage of the Hurricane, the dark shadow underneath it and the dark sky. Our brain infers contrast because we know what we should be seeing! If we were to try doing fMRI, say, on a series of edges-only images we would run into difficulties because we process the time series pixelwise. With a relatively low and homogeneous signal level you can bet good money the statistics would be grim.

Saturday, August 6, 2011

Physics for understanding fMRI artifacts: Part Ten

(For the answer to the homework k-space diagram given at the end of Part Nine, see Note 1.)

K-space in two dimensions

As anyone knows who has encountered MRI professionally, whether in research or medicine, there seems to be an endless array of pulse sequences to choose between. The variety can be overwhelming at first. Nor is the situation helped by different vendors using different acronyms - we always use acronyms in MRI! - for what are essentially the same sequence.

It's little wonder, then, that most neophytes' eyes glaze over when it comes to comparing and contrasting any two pulse sequences if the taxonomy appears to be ad hoc. Where on earth to start? But it turns out that most pulse sequences can be categorized fairly easily, and their heritage traced, by separating the part(s) of the sequence that is responsible for spatial encoding, from the part(s) of the sequence that will provide the tissue or functional contrast. Occasionally there is overlap within the sequence of these two missions, but even then it's usually straightforward to understand the spatial encoding and interpret its genesis.

A useful pictorial representation of imaging pulse sequences

It turns out that there are only a handful of spatial encoding methods in common use these days, almost all with roots in the late 1970s or early 1980s. While new pulse sequences appear in the literature all the time, when you look at their k-space representations you'll be able to see how each new method has developed from a small number of key ideas from those early years. It's possible to categorize the encoding methods without k-space, but the k-space formalism makes comparisons trivial (in MR terms).

Spatial encoding methods can be separated into families derived from a central idea. For instance, following Lauterbur's original imaging paper in 1973 (which led to the family of projection reconstruction methods), in 1975 Richard Ernst's group came up with a sequence that utilized a 2D Fourier transform to yield the final image. (See Note 2.) It was a remarkable breakthrough and is the grandparent of nearly all medical/biological sequences still in common use today.

Still, even geniuses miss opportunities every now and then. And in 1980 a group at Aberdeen came up with a far more practical implementation of Fourier imaging, using amplitude-modulated gradients in a "constant time" pulse sequence, rather than the fixed amplitude, variable time scheme of Kumar, Welti and Ernst. It is this constant time scheme, which the Aberdeen group termed "spin warp" phase encoding, that provides the basis for most clinical (anatomical) scanning used today. It's also a good scheme to look at when first encountering 2D k-space, so we'll consider it in detail in this post.

The goal revisited

In the first part of the last post (see Part Nine) I used two examples of digital images to illustrate how the information content in a 2D plane of image pixels can be equivalently represented in reciprocal 2D space, or k-space. I mentioned that both the images and the k-space comprised 512x512 points, but later on when I started to draw (one-dimensional) k-space trajectories I did so on a k-space plane that was represented by just a set of axes, not discrete points. In case you think that image space and k-space in MRI are continuous, I'm going to spend a moment considering the digital k-space plane explicitly. (Like real space, k-space can also be continuous rather than digital, but that's not how MRI works.)

Here is a 16x16 plane of k-space points (see Note 3) overlaid on some actual signals to reinforce the point that we're digitizing a continuous process:

Courtesy: Karla Miller, FMRIB, University of Oxford.

The goal is to traverse the entire k-space plane, i.e. to use our gradients to follow a trajectory that crosses every single point (as defined by the white grid itself), acquiring data (with our receiver coil), one point for each grid coordinate, as we go. Once we have traversed the entire 2D plane (and assuming a suitable data acquisition scheme) we will have 16x16 k-space data points and will then be in a position to apply a 2D FT and get a 16x16 image out. (See Note 4.)

Friday, July 29, 2011

Physics for understanding fMRI artifacts: Part Nine

Conjugate variables redefined

In this post I'm going to provide the first part of a recipe for generating 2D images. It's going to be somewhat algorithmic. I may occasionally mention what a particular step implies, but for the most part I'm going to step through a sequence of events, produce a final recipe for you to follow, then go back and explain what some of the parts mean physically. This isn't the traditional approach to learning about k-space; most text books assume that you need to understand what it all means before you get to learn "the rules of the game." As is my wont, I'm coming at it backwards. My hope is that you will then be able to go back to your text books - I'll tell you where to look for subsequent explanations - and cement a decent understanding of the "why" of k-space, not just the "how."


Conjugate variables revisited

In Part Five of this series I introduced the Fourier transform and conjugate variables. The post focused on the most common pair of conjugate variables: frequency and time. If we have the time domain representation and we want to transform it into its frequency domain equivalent, we apply a (one-dimensional) FT, and vice versa.

But there is another pair of conjugate variables that is more useful and intuitive for imaging applications. (In this case your intuition for one of the variables may not develop until the end of this post, or later! Bear with me.) Whether it's maps, MRIs or architectural plans, the axes of an image are best described in terms of length. If we choose the centimeter as our unit of length, then FTing an axis in cm will yield an axis in 1/cm. You happen to have an intuitive notion of time, frequency and space from everyday life. Don't worry about what the reciprocal of real space means, just accept for now that it exists. We call this reciprocal space k-space because another term for 1/cm is the wavenumber, and the wavenumber is given the symbol k.



Representing pictures in reciprocal space

Let's take a random picture, in this case it's a digital photograph of a Hawker Hurricane plane. It's clearly a 2D picture. We have a digital version of it so we can do mathematical operations on it with a computer. If we do a 2D (digital) FT of the picture we get its representation in 2D k-space:


Saturday, July 16, 2011

Physics for understanding fMRI artifacts: Part Eight

I had initially planned to go into 2D imaging next, but after some consideration I've decided instead to tidy up a few loose ends that follow more naturally from the last post: gradient-recalled echoes and slice selection. Then, in Part Nine I promise to introduce the second in-plane dimension. This route should better allow me to bring everything together at the end of the next handful of posts and permit you to see, and understand, the EPI pulse sequence at a glance. That's the plan. Let's see if we can make it work! (See Note 1.)

Gradient-recalled echoes

In the last post I used a frequency encoding gradient, also called a readout gradient (because it's on while the signal is being recorded, or read out), to produce one-dimensional images - profiles - of water-filled objects. This isn't the typical way that the signal is acquired, however. Instead, it is typical to acquire a refocused, or echoed, signal that has a certain symmetry in time in order to obtain some experimental benefits. I'll mention these benefits later. First, let's see how the gradient echo works.

Here is a simple gradient echo pulse sequence that is adapted from the simple readout gradient-only sequence that was considered in Part Seven:


The first thing to note is that the period of data acquisition (analog-to-digital conversion) has been delayed and now occurs in concert with a readout gradient having a negative sign, rather than being coincident with the positive gradient period labeled 1 in the figure. Also, the duration of data acquisition has been doubled. So instead of acquiring a free induction decay (FID) almost immediately after the 90 degree excitation pulse, we are now acquiring an echo signal at a later time. How and why does this echo form?

Monday, July 11, 2011

Physics for understanding fMRI artifacts: Part Seven

Magnetic field gradients and one-dimensional MRI

Now that you have a basic understanding of the Fourier transform and some of the practical matters that arise from digital signals, it's time to look at a basic imaging pulse sequence and even make some simple images. We're going to use frequency encoding only for the time being, and for now we're going to make one-dimensional images (also called profiles) so that we can introduce an alternative form of timing diagram to represent a pulse sequence.


A magnetic field gradient alters the local resonance frequency

When a sample is placed into the magnet, all the protons (1-H nuclei) resonate at a near-identical frequency. At 3 T that resonance frequency is approximately 123 MHz, as given by the Larmor equation. If we then impose a magnetic field gradient across the sample - your subject's head, say - instead of having the same resonance frequency uniformly across the brain, there will now be a linear dependence in space (see Note 1):


In a real image we might consider 64 different positions along x. These would define the voxels in one (in-plane) dimension of the image. But for the time being we'll consider just three points in the x direction: the central point, and one point either side.

At the center of the magnet the gradient has no net effect, so the resonance frequency at that point is still 123 MHz. We call this point the null crossing, because all three linear gradients, X, Y and Z, are engineered to have no effect here. (See Note 2.) And to keep things symmetric, the gradient null crossing is placed in the geometric center of the magnet - the isocenter - because that's where the main magnetic field has been engineered to be most homogeneous, and we want to do all our imaging in that location to get the best scanner performance.

Thursday, April 21, 2011

Tactical approaches to (re)shimming

In an earlier post I looked at the effects of heating on the temporal stability of EPI data. Particular attention was given to the translations in the phase encoding dimension that arise whenever the scanner drifts off resonance during imaging, through the heating and subsequent cooling of the gradient coil (rapid time constants) as well as of the passive iron shims between the gradient coil and the magnet cryostat (slow time constants). These frequency shifts are most apparent between blocks of EPI as discontinuities, or steps, in a concatenated time series, because of the on-resonance adjustment that precedes the start of each EPI block.

Fortunately, for a typical modern scanner there is little detrimental effect on the temporal SNR (and statistical power) of the total time series once it has been corrected for motion using a standard rigid-body realignment algorithm. But the outstanding question is this: must we rely so heavily on the realignment algorithm to fix what is really a hardware limitation? Surely, fixing it in software is a hack? (Save the jokes, I've almost certainly heard them! See Note 1, below.) And, as pointed out by El-Sharkawy et al., if the magnetic field is being perturbed sufficiently by heating to cause components with a Z spatial dependence to change, what about all the other spatial dependencies? If the shim is being compromised, why not do something about it?

The standard fMRI protocol

Let's start by reviewing what happens in a standard protocol. On Siemens scanners, at least, the usual approach to an fMRI experiment is to shim at the start of the session and then not re-shim unless there is a substantial change in the prescribed imaging volume (the stack of EPI slices). Shimming is initiated by the first scan that's not a localizer. (See Note 2.) So, if a 3D anatomical, such as an MP-RAGE, is acquired after the localizer and before the first EPI, say, there will be no further shimming during the session (unless requested by the operator).

Assessing the problem

Now, we could continue to investigate shimming as a means to mitigate the effects of heating using experiments on phantoms. That would be a full study in and of itself. To keep this post shorter and more relevant to you, I'm going to jump straight to brain data. That's because when we are talking about shimming (or re-shimming), we are going to mix the effects of scanner heating with our old chum, subject movement. We're going to lump everything together and look at the resultant. Put another way, there's no point in coming up with a putative solution to the heating issue if it could exacerbate the movement issue.

Experimental verification

Very briefly, as part of a vision experiment, shimming was performed (or not) between blocks of 150 volumes of EPI, TR=2 seconds. (Siemens users: See Note 3.) During the first session, shimming was performed between blocks for the first five blocks, then shimming was omitted between blocks for the next five. The time gaps between blocks weren't controlled rigorously; it was whatever was required to set up a new stimulus script plus, when appropriate, the 30-odd seconds to re-shim. A typical inter-block gap was between one and two minutes. In a second session on the same subject the ordering was reversed: shimming was omitted for the first five blocks, then performed between blocks for the final five blocks.

Saturday, April 9, 2011

Shim and gradient heating effects in fMRI experiments

Another week, another tangent. At least this one is directly related to the artifacts that I promise to get back to soon!

In this post I will review the nature and typical magnitudes of heating effects in a scanner being used for fMRI. Ever wondered why you sometimes observe discontinuities, or 'steps,' in a time series comprising the concatenation of multiple blocks of EPI data? What causes these discontinuities? Are they a problem for fMRI? And are there ways to reduce or eliminate these discontinuities at the acquisition stage? To begin with, some background.

Electrical energy in, thermal and vibrational energy out

When you run the gradients to generate images, a lot of heat is produced through vibrations (friction) of the gradient coils - the Lorentz forces that result from putting electrical current through copper wires immersed in a magnetic field - as well as through direct (resistive) electrical mechanisms. Much of that heat is removed via water cooling inside the gradient set. Water typically enters at about 20 C and may exit the scanner as high as 30 C. Modern gradient designs are pretty efficient at removing heat from the gradient coil. (I've done throwaway tests on my Siemens Trio that suggest the steady state temperature of the return cooling water is achieved after about 15 minutes of continuous scanner operation.) But - and this is the crux of this post - the heat imparted to the scanner isn't removed at precisely the same rate that it is being produced. In other words, the scanner is unlikely to be in a truly steady thermal state while you're using it.