I don't know how I missed this, but last month a major version of FSL was released: 5.0. This means that:
Everything I had previously written about FSL is now obsolete, and you were a fool to read it; and
There have also been changes to processing anatomical datasets, field maps, and independent component analysis, which look interesting. Interesting, as in, I don't completely understand all the changes they made, but they look impressive.
I haven't had much time to sink my paws into it, but it looks similar to FSL 4.x. More details to come.
I arose just before six, the wind outside a mere whisper and the lake below black as jet and the wretched sun yet to raise its head above the horizon. I ate; I drank; I slapped my muscles until I felt a pleasant numbness and then I sat at the edge of the bed and breathed deeply, taking in great lungfuls of that charged air until it radiated to my fingertips. Then did I stand at the window and witness the slow birth of a new day, the sun crowning just above the east and scattering upon the face of the water an afterbirth of pale yellows and pinks.
The mercury registered at just above freezing. I threw on layers of wool and synthetics; drew my gloves tight until that slight pull at the ends of the fingers; threaded the aglets through the timing chip with meticulous care; delicately placed a bandage on each of the girls. Double, triple-check to make sure the bib number is still pinned to your singlet, and then it's out the door and to the starting line.
The details of the race are here omitted; all I can say is that I was greedy. Greedy for a personal best, greedy for prize money, greedy for the win. As the starting gun went off I saw that I might have a chance at taking it - race, player, life, all - and the cisterns of my bloodlust quivered with excitement and my fury slipped its leash. Like a fool did I run, swaying to the shouts and the yells and the whims and the vicissitudes of the mob, which would later come crashing down upon my head. The turning point came just after mile twenty, when I had to briefly stop and I was filled with the violent urge to vomit; thereafter was my mouth a foul mixture of acid and adrenaline, from which I never recovered.
Months I had spent dreaming of that last steep descent into Veterans Park, the glittering whitecaps of Lake Michigan in the distance and the sanguinary roar of the crowd as I hurtled the broken bodies of my dying enemies and rushed toward glorious victory. Instead, it was a death march. My overweening pride, transformed into abject humiliation; my obsession with glory, turned into a singleminded focus on controlling my bowels; and each step down that lonely road cracked the tarsals of my feet and tore at the ligaments of my knees. In my mind the encouraging shouts of the crowd had turned into jeers, and I expected mire and excrement to be thrown upon my face. A sorry sight was I, staggering across the finish line, exhausted, limping to the side of that great body of water and searching for the glorious, glittering whitecaps of my dreams; but the sky was as a great grey blanket thrown over the roof of the world and I stood there in terrible silence as the heat of life evaporated and the chill wind cut to the bone.
Your ideas are terrifying and your hearts are faint. Your acts of pity and cruelty are absurd, committed with no calm, as if they were irresistible. Finally, you fear blood more and more. Blood and time.
It came to me in a series of dreams: The race; a great battle upon the vastation; the infuriate sun gazing upon the carnage.
I sat immobile as upon a throne enshrouded in darkness. And the gates before me opened up as the maw of some great beast and my eyes burned with the terrible vision and my heart was drunk with horror.
And I beheld a horde of men innumerable: wild-eyed, mouths besprent with froth, faces twisted into masks of agony. Blind, stupid animals. They swarm forward, mindless as ants; they sing hymns of blood and death.
It is whittled down to the few. One stumbles and falls; he crawls upon the ground like a dog, begging for mercy. A loud crack, and double fistfuls of gore vomit from his temple. Bad luck. Another simply stops; he stands there, blinking stupidly. A pair of hands emerge and one hand holds a razor wrapped in silk and his throat is cut like a sheep, carmine fountains of life erupting from his veins. And yet one more halts of his own volition and stands his ground with great shouts of defiance and the figures swarm forward and he is mobbed and he is sodomized and he is slain to the sound of laughter as loud as screams.
The gates closed and again was I engulfed in darkness. And as I traveled through universes of pain and suffering, I beheld a great void: And there I sat, as immobile as the three-faced beast in the lake of ice, and my limbs were paralyzed in fear; and the demon by my side knelt down and whispered atrocities unto my ear, the vision of which is recorded herewith.
Underneath the westering sun was there a great slaughter and the funeral pyres burned with unslakeable thirst and did choke the sky with their foul discharge, and the wolves and the buzzards and the feeders of carrion went half-crazed from the stench of decay. And the reivers roamed the vastation, wretched trains of concubines and catamites in their wake, their alien forms oversized with coagulate gore, gimlet-eyed, irresistible as death as their magnetic pull guides them to the last few broken hovels upon the wasteland and the air is filled with the whine of flies and the cacophony of screams. And all was beheld and burned to ashes underneath the pandemonium of the dying sun.
The fortress of FMRI is constantly beseiged by enemies. Noisy data lead to difficulties in sifting the gold of signal from the flotsam of noise; ridiculous assumptions are made about blood flow patterns and how they relate to underlying neural activity; and signal is corrupted by motions of the head, whether due to agitation, the sudden and violent ejection of wind, or the attempt to free oneself from such a hideous, noisy, and unnatural environment.
This last besetting weakness is the root of much pain and suffering for neuroimagers. Consider that images are acquired on the order of seconds and strung together as a series of snapshots over a period of minutes. Consider also that we deal with puny, squirmy, weak-willed humans, unable to remain still as death for any duration. Finally, consider that head motion may occur at any time during the acquisition of our images - as though we were using a slow shutter speed to take a picture of a moving target.
Coregistration - the spatial alignment of images - attempts to correct these problems. (Note that the term coregistration encompasses both registration across modalities, such as T2-weighted images to a T1-weighted anatomical, and registration within a single modality. The latter is often referred to as motion correction.) For example, given a time series of T2-weighted images, coregistration will attempt to align all of those images to a reference image. This reference image can be any one of the individual functional images in the time series, although using the functional image acquired closest in time to the anatomical image can lead to better initial alignment. Once a reference image has been chosen, spatial deviations are then calculated between the reference image and all other functional images in the timeseries, each image shifted by the inverse of these calculated distances from the reference image.
II. Rigid-body transformations
It what ways can images deviate from each other? Often we assume that images taken from the same subject can be realigned using rigid-body transformations. This means that the size and shape of the registered images are the same, and only differ in translations along the x, y, and z axes, and in three rotation angles (roll, pitch, and yaw). Each of these can be shown by a simple example. First, locate your head and prepare to move it. Ready?
Fix your vacant stare upon an attractive person in front of you. This can be someone in either a classroom or a workplace setting. While you stare, keep your body still and only move your head to the left and right. This is moving along the x-axis.
While the rest of your body remains immobile, again move your head - this time, directly forward and directly backward. This is moving along the y-axis.
Keep staring. Now extend your neck directly upward, and compress it as you come downward. This is moving along the z-axis.
Are you feeling that telluric connection with her yet? Perhaps these next few moves will get her to notice you. Nod your head vigorously back and forth in a "Yes" motion. This is called the pitch rotation, and will entice her to approach you.
Now, send mixed signals by shaking your head "No". This is called the yaw rotation, and will both confuse her and heighten the sexual tension.
Finally, do something completely different and roll your head to the side as though touching your ears to your shoulders. This is called the roll rotation, and will make her think you either have a rare movement disorder or are batshit insane. Now you are irresistible.
The correct execution of these moves can be found in the following video.
III. 3dvolreg
3dvolreg, the AFNI command to perform motion correction, will estimate spatial deviations between the reference functional image and other functional images using each of the above movement parameters. The deviation for each image is calculated and output into a movement file which can then be used to censor (i.e., remove from the model) timepoints that contain too much motion.
A typical 3dvolreg command requires the following arguments:
base (sub-brik): Use this sub-brik of the functional dataset as the reference volume.
zpad (n): Pad each volume with n voxels with a value of zero prior to motion correction, then remove them afterward.
(Interpolation method): Can be cubic, linear, or heptic; in general, higher-order interpolations are slower but produce better results.
(prefix): Label for output dataset.
-1Dfile (label): Label for text file containing motion estimates for each volume.
-1Dmatrix_save (label): Label for text file containing matrix transformations from each volume to reference volume. Can be used later with 3dAllineate to warp each functional volume to a standard space.
(input): Functional volume to be motion-corrected.
Assume that we have already slice-time corrected a dataset, named r01.tshift+orig. Example command for motion correction:
After you have run motion correction, view the results in the AFNI GUI. (It is helpful to open up two windows, one with the motion-corrected data and one with the non-corrected data.) By selecting the same voxel in each window, note that the values are different. As the motion-corrected data is now slightly shifted and not in the location that was originally sampled, your chosen spatial interpolation method will estimate the intensity at each new voxel by sampling nearby voxels. Lower-order interpolation methods are usually a weighted average over the intensity of immediately neighboring voxels, while higher-order interpolations will use information from a wider range of nearby voxels. Assuming you have a relatively new machine running AFNI, 3dvolreg is wicked fast, so heptic or fourier interpolation is recommended.
Last, AFNI's 1dplot can graph the movement parameters dumped into the .1D files. A special option passed to 1dplot, the -volreg option, will label each column in the .1D file with the appropriate movement label.
Example command:
1dplot -volreg -sepscl r01_motion.1D
IV. Potential Issues
Most realignment programs, including 3dvolreg, use an iterative process: small translations and rotations along the x-, y-, and z-axes are made until a minimum in the cost function is found. However, there is always the danger that this is a local minimum, not a global minimum. In other words, 3dvolreg may think it has done a good job in overlaying one image on top of the other, but a larger movement may have led to an even better fit. As always, look at your data both before and after registration to assess the goodness of fit.
Also note that motions that occur on the scale of less than a TR (e.g., less than 2-3 seconds) cannot be corrected by 3dvolreg, as it assumes that any rigid-body motion occurs across volumes. There are more sophisticated techniques which try to address this, with varying levels of success. For now, accept that your motion correction will never be perfect.
Mention the name of Prokofiev to any musician, and instantly a mental curtain goes up: They hear music of caprice, vigor, and daring; original almost to the point of eccentricity; Russian in the fullest sense of the word.
"I abhor imitation," Prokofiev once wrote, "and I abhor the familiar." Certainly, Prokofiev is a difficult man to pin down; some categorize his music as neo-classical, others as sui generis. By pushing the limits of public taste, he invited both admiration and scathing criticism; however, nearly sixty years after his death, his seat among the pantheon of musical gods remains secure.
The following two selections provide a glimpse into Prokofiev's world. Doubtless, they represent only an incomplete part of him. Both his etudes, op. 2, and his piano concerto no. 1, op. 10, were composed at the beginning of his career; they are worlds removed from the dark, sarcastic, acidic hatred of his final piano sonatas or his colossal, finger-breaking Sinfonia Concertante. (Truly, both Shostakovich and Prokofiev, their souls hardened and warped within the crucible of Stalinist Russia, are two of the greatest gifts to be produced by that unhappy era.)
However, these pieces are a good point of entry into Prokofiev's beautiful imagination. The etudes and piano concerto are energetic, bombastic, unabashedly virtuosic pieces Prokofiev used as vehicles to coruscate onto the musical scene as a singular composer-pianist. And while Prokofiev used the piano to incredible effect, mind that it represents only a fraction of his music output - an oeurve which comprised operas, symphonies, ballets, and a superb cello sonata. The inquisitive listener will be drawn to seek out these gems.
For now, enjoy the dark sonorities and virtuosic daring of his etude in D minor, a picture of the brashness and audacity of a young man beginning to realize his powers; enjoy the roller-coaster ride of the piano concerto finale, a movement traversing an astonishing range of gorgeous, transcendental, sometimes bizarre emotions, climaxing with endless cascades of octaves over the glorious swells of the orchestra.
As I am covering bootstrapping and resampling in one of my lab sections right now, I felt I should share a delicious little applet that we have been using. (Doesn't that word just sound delicious? As though you could take a juicy bite into it. Try it!)
I admit that, before teaching this, I had little idea of what bootstrapping was. It seemed a recondite term only used by statistical nerds and computational modelers; and whenever it was mentioned in my presence, I merely nodded and hoped nobody else noticed my burning shame - while in my most private moments I would curse the name of bootstrapping, and shed tears of blood.
However, while I find that the concept of bootstrapping still surpasses all understanding, I now have a faint idea of what it does. And as it has rescued me from the abyss of ignorance and impotent fury, so shall this applet show you the way.
Bootstrapping is a resampling technique that can be used when there are few or no parametric assumptions - such as a normal distribution of the population - or when the sample size is relatively small. (The size of your sample is to be neither a source of pride nor shame. If you have been endowed with a large sample, do not go waving it in the faces of others; likewise, should your sample be small and puny, do not hide it under a bushel.) Say that we have a sample of eight subjects, and we wish to generalize these results to a larger population. Resampling allows us to use any of those subjects in a new sample by randomly sampling with replacement; in other words we can sample one of our subjects more than once. If we assume that each original subject was randomly sampled from the population, then each subject can be used as a surrogate for another subject in the population - as if we had randomly sampled again.
After doing this resampling with replacement thousands or tens of thousands of times, we can then calculate the mean across all of those samples, plot them, and see whether 95% of the resampled means contains or excludes zero - in other words, whether our observed mean is statistically significant or not. (Here I realize that, as we are not calculating a critical value, the usual meaning of a p-value or 95% confidence interval is not entirely accurate; however, for the moment just try to sweep this minor annoyance under the rug. There, all better.)
The applet can be downloaded here. I have also made a brief tutorial about how to use the applet; if you ever happen to teach this in your own class, just tell the students that if the blue thing is in the gray thing, then your result fails to reach significance; likewise, if the blue thing is outside of the gray thing, then your result is significant, and should be celebrated with a continuous bacchanalia.
This subject was brought to my attention by a colleague who wanted to know whether parametric modulation or duration modulation was a better way to account for RT effects. While it can depend on the question you are trying to answer, often duration modulation (referred to here as a "variable epoch model") works best. The following highlights the different approaches for modeling trials which involve a period of decision-making or an interval between presentation of a stimulus and the resulting response.
Over the past few years there has been a renewed interest in modeling duration in fMRI data. In particular, a methods paper by Grinband and colleagues (2008) compared the effects of modeling the duration of a trial - as measured by its reaction time (RT) - against models which used RT as a parametric modulator and against models which did not use RT at all. The argument against using RT-modulated regressors was that, at short time intervals (i.e., less than four seconds), using an impulse function was a good approximation to the resulting BOLD signal (cf. Henson, 2003).
Figure depicting relationship between stimulus onset, BOLD response, and underlying neural activity. Red lines: activity associated with punctate responses (e.g., light flashed at the subject). Blue lines: Activity associated with trials of unequal duration (e.g., decision-making).
However, for a few investigators, such assumptions were not good enough. To see whether different models of RT led to noticeable differences in BOLD signal, Grinband et al (2008) examined four types of modeling:
Convolving the onset of a condition or response with the canonical HRF (constant impulse model);
Separately modeling both the main effect of the condition as well as a mean-centered parametric modulator - in this case RT (variable impulse model);
Binning each condition onset into a constant amount of time (e.g., 2 seconds) and convolving with the canonical HRF (constant epoch model); and
Modeling each event as a boxcar function equal to the length of the subject's RT (variable epoch model).
Graphical summary of models from Grinband et al (2008). Top: Duration of cognitive process as indexed by reaction time. Constant Impulse: Onset of each event treated as a punctate response. Constant Epoch: Onset of each event convolved with boxcar function of constant duration. Variable Impulse: Punctate response functions modulated by mean-centered parameter (here, RT). Variable Epoch: Each event modeled by boxcar of duration equal to that event's RT.
Each of these models was then compared using data from a decision-making task in which subjects determined whether a line was long or short. If this sounds uninteresting to you, you have obviously never done a psychology experiment before.
The authors found that the variable epoch model - in other words, convolving each event with a boxcar equal to the length of the subject's RT for that trial - captured more of the variability in the BOLD response, in addition to reducing false positives as compared to the other models. The variable epoch model also dramatically increased sexual drive and led to an unslakeable thirst for mindless violence. Therefore, these simulations suggest that for tasks requiring time - such as decision-making tasks - convolution with boxcar regressors is a more faithful representation of the underlying neuronal dynamics (cf. the drift-diffusion model of Ratcliff & McKoon, 2008). The following figures highlight the differences between the impulse and epoch models:
Comparison
of impulse models and epoch models as depicted in Grinband et al
(2008). A) For impulse models, the shape remains constant while the
amplitude varies; for epoch models, increasing the duration of a trial
leads to changes in both shape and amplitude. B) Under the impulse model, increasing the duration of a stimulus or cognitive process (as measured by RT) leads to a reduction in explained variance.
Figure from Grinband et al (2008) showing differential effects of stimulus intensity and stimulus duration. Left: Increasing stimulus intensity has no effect on the time to peak of the BOLD response. Right: Increasing stimulus duration (or the duration of the cognitive process) leads to a linear increase in the time for the BOLD response to peak.
One caveat: note well that both parametric modulation and convolution with boxcar functions will account for RT-related effects in your data; and although the Grinband simulations establish the supremacy of boxcar functions, there may be occasions that warrant parametric modulation. For example, one may be interested in the differences of RT modulation for certain trial types as compared to others; and the regressors generated by parametric modulation will allow the researcher to test them against each other directly.