Tuesday, April 30, 2013

SPM Tutorial: Creating Contrast Images

Those of you who have ever entered a string of ones and negative-ones in SPM's contrast manager were creating contrast images (simultaneously converted into T-maps or F-maps), whether you knew it or not. It can be difficult to see exactly what is going on, but as part of creating a statistical map, SPM calls upon its mathematical tool, spm_imcalc_ui (or just spm_imcalc; but I find spm_imcalc_ui easier to understand and to use, and therefore I will focus on it).

While using the contrast manager is useful for creating relatively simple single-subject maps, you may want to then create images from those simpler images; for example, let's say you have created functional connectivity maps, but want to take the difference between two of those maps and feed the resulting contrast map into a second-level analysis. spm_imcalc_ui allows you to do this easily, and can be scripted, saving you precious time to do more important things, like take pictures of that cucumber salad sandwich or whatever you're eating and load it onto Twitter.

spm_imcalc_ui requires at least three inputs:

  1. A matrix of input filenames;
  2. An output file;
  3. A mathematical operation to perform on the input images.

As a simple example, let's say we use the contrast manager to create two contrast images, con_0001.img and con_0002.img. Let's then say that we want to take the difference of these image to use in a second-level analysis. First, it is usually easier to assign a variable name to each file:

P1 = 'con_0001.img'; P2 = 'con_0002.img'

And then input these into spm_imcalc_ui:

spm_imalc_ui([P1; P2], 'outputImage.img', 'i1-i2'

Note that the third argument, i1-i2, calls upon reserved SPM keywords, i.e., "i1" and "i2". i1 refers to the first input image, i2 refers to the second input image, and so on.

That's really all there is to it; and from this example you can simply add more images, and perform more complex operations if you like (e.g., make one an exponent of the other, i1.^i2). Furthermore, when you have several runs, using the contrast manager can quickly become unwieldy; you can use the contrast manager to first create an image for a single regressor by positively weighting only those betas in each run corresponding to your regressor, and then when these images are created, use spm_imcalc_ui to make your contrast images. As stated previously, this allows for more flexibility in scripting from the command line, potentially saving you thousands of man-hours in cucumber-sandwich-photo-taking endeavors.



Saturday, April 27, 2013

FSL Tutorial: Creating ROIs from Coordinates

Previously we covered how to create regions of interest (ROIs) using both functional contrasts and anatomical landmarks; however, FSL can also create spheres around voxel coordinates, similar to AFNI's 3dcalc or SPM's marsbar.

  1. Step one is to find the corresponding voxel coordinates for your MNI coordinates, which may be based on peak voxel activation from another study, for example; to do this, open up FSLview, type in your MNI coordinates, and write down the corresponding voxel coordinates (these are shown in the bottom-left corner of FSLview). 
  2. After you have written down your voxel coordinates, create a point at those coordinates using the fslmaths command. This command requires the template space that you warped to, as well as the actual x-, y-, and z-coordinates corresponding to the MNI coordinates. Give the output file a name, and make sure that the output data type ('odt') is set to float. (Example command: fslmaths avg152T1.nii.gz -mul 0 -add 1 -roi 45 1 74 1 51 1 0 1 ACCpoint -odt float)
  3. Using fslmaths again, input the file containing the point created in the previous step, and specify a sphere of radius N (in millimeters) to expand around that point. Use the -fmean command, for reasons that are to remain mysterious, and provide a label for your output data set. (Example command: fslmaths ACCpoint -kernel sphere 5 -fmean ACCsphere -odt float)
  4. Update on 5/18/2016: To make it a binary mask, execute one more command: fslmaths ACCsphere.nii.gz -bin ACCsphere_bin.nii.gz. The previous step creates a sphere, but with small intensities; this can be problematic if you do a featquery analysis that allows weighting of the image.

Once that is all done, use fslview to open up a template in your normalized space, and overlay your newly created sphere; double-check to make sure that it is in roughly the location where you think it should be. Now you can extract data such as parameter estimates from this ROI, using techniques similar to those covered in previous tutorials about ROIs.

Thanks to alert viewer danieldickstein, which, due to its juvenile reference to the male member, cannot possibly be his real name. Grow up, Daniel.


Friday, April 26, 2013

Abstraction and Integration in Lateral Prefrontal Cortex



Recently the journal Cerebral Cortex accepted one of our lab's papers for publication, which has made me ecstatically, deliriously happy. This represents one of the highwater marks of my publishing career, even greater than the erotically-tinged agitprop novel I published serially in my college's Pravda-inspired newspaper. Entitled A Long Caress: Twilight of the Capitalist Idols, the book followed the lives of two dreamy radicals pursued by the CIA, of which I provide an excerpt:

Boris laid aside his Chernyshevsky pamphlet and looked at Olga. Hearing his declaiming against the capitalist dogs had brought her to a fever heat; and now, as he watched her, he noticed the graceful curves of her neck, brought into relief by the delicate strands of jet-black hair gently brushing against her collarbone and the edges of her heaving bosom. She gazed at him adoringly, sloe-eyed, her cheeks flushed, the glistening sweat making her Party-issued uniform cling to her skin like fuzz on a peach. Around her waist he wrapped his strong, powerful arms, and she offered herself up like a prize.

A few miles away in an underground bunker, all of this was transmitted through a hidden wire to CIA agent John Davies. Pressing his headphones closer to his ears, Davies frowned. "Blimey," he said.

While our new paper does not come close to the rhapsodic heights of A Long Caress, it still goes a long way to resolving fundamental issues with studying different forms of abstraction. One form of abstraction, temporal abstraction, refers to maintaining information over time, with more remote events requiring correspondingly greater levels of temporal abstraction; while a related form of abstraction, relational abstraction, refers to processing higher-level information, such as complex features of stimuli. Unhappily, they are often confounded in the same experiment. This study attempted to tease apart both of these forms of abstraction, as well as independently assess the effects of integration, wherein several different pieces of information need to be collectively processed in order to make a correct response. Temporal abstraction was nonexistent, while relational abstraction effects were found in lateral premotor cortex and rostrolateral prefrontal cortex. Integration was associated with increased activation in superior frontal sulcus and frontopolar cortex, consistent with this region's handling more abstract representations between items.

A link to the paper can be found here. Documentary footage of Stalin ordering the deaths of his generals and field marshals can be found in the following video.


Thursday, April 25, 2013

The Noose Tightens: Scientific Standards Being Raised

For those of you hoping to fly under the radar of reviewers and get your questionable studies published, I suggest that you do so with a quickness. A new editorial in Nature Neuroscience outlines the journal's updated criteria for methods reporting, which removes the limit on the methods section of papers, mandates reporting the data used to create figures, and requires statements on randomization and blinding. In addition, the editorial board takes a swipe at the current level of statistical proficiency in biology, asserting that

Too many biologists [and neuroscientists] still do not receive adequate training in statistics and other quantitative aspects of their subject. Mentoring of young scientists on matters of rigor and transparency is inconsistent at best. In academia, the ever-increasing pressures to publish and obtain the next level of funding provide little incentive to pursue and publish studies that contradict or confirm previously published results. Those who would put effort into documenting the validity or irreproducibility of a published piece of work have little prospect of seeing their efforts valued by journals and funders; meanwhile, funding and efforts are wasted on false assumptions.

What the editors are trying to say, I think, is that a significant number of academics, and particularly graduate students, are most lazy, benighted, pernicious race of little odious vermin that nature ever suffered to crawl upon the surface of the earth; to which I might add: This is quite true, but although we may be shiftless, entitled, disgusting vermin, it is more accurate to say that we are shiftless, entitled, disgusting vermin who simply do not know where to start. While many of us learn the basics of statistics sometime during college, much is not retained, and remedial graduate courses do little to prepare one for understanding the details and nuances of experimental design that can influence the choice of statistics that one uses. One may argue that the onus is on the individual to teach himself what he needs to know in order to understand the papers that he reads, and to become informed enough to design and write up a study at the level of the journal for which he aims; however, this implies an unrealistic expectation of self-reliance and tenacity for today's average graduate student. Clearly, blame must be assigned: The statisticians have failed us.

Another disturbing trend in the literature is a recent rash of papers encouraging studies to include more subjects, to aid both statistical reliability and experimental reproducibility. Two articles in the last issue of Neuroimage - One by Michael Ingre, one by Lindquist et al - as well as a recent Nature Neuroscience article by Button et al, take Karl Friston's 2012 Ten Ironic Rules article out to the woodshed, claiming that small sample sizes are more susceptible to false positives, and that instead larger samples should be recruited and effect sizes reported. More to the point, the underpowered studies that are published tend to be biased to only finding effects that are inordinately large, as null effects simply go unreported.

All of this is quite unnerving to the small-sample researcher, and I advise him to crank out as many of his underpowered studies as he can before larger sample sizes become the new normal, and one of the checklist criteria for any high-impact journal. For any new experiments, of course, recruit large sample sizes, and when reviewing, punish those who use smaller sample sizes, using the reasons outlined above; for then you will have still published your earlier results, but manage to remain on the right side of history. To some, this may smack of Tartufferie; I merely advise you to act in your best interests.

Thursday, April 18, 2013

CNS 2013 Review

Last weekend marked my second attendance of the Cognitive Neuroscience Society conference, and I had a terrific time, each night full of drinking, wenching, gaming, brawling, dancing, freethinking, casuistry, and innumerable other vices. I dined on the best seafood that San Francisco had to offer, devouring breadbowls of clam chowder and pots of carmelized catfish and platters of sushi. I witnessed fights between sea lions, observed the Golden Gate bridge expand and contract in proportion to its temperature, and toured the Ghiradelli chocolate factory complex. Having access to a television for the first time in months, I watched the last half of S.W.A.T. and the first half of Face/Off, which, taken together, made for a satisfying, full-length action movie.

However, I also managed to find the time to go to some talks and posters detailing the latest findings in my field. A few trends I noticed:

1. Development and aging are hot right now, particularly since a large segment of the population is approaching old age and beginning to experience the effects of dementia, senescence, and increased irritability at perceived injustices, such as when your children fail to call you when they say that they will. I saw several posters looking at cognitive control effects over time, and how different interventions affected measures of executive function; and since the baby boomers are funding a large part of this research, so the importance of this field will continue to grow in proportion to their collective terror in the face of aging and its associated infirmities, creeping maladies seen from a distance yet unstoppable, as a man bound to a stake in the middle of a desert might feel as he is approached by irate wildlife.

2. Cognitive strategies such as mindfulness meditation and reappraisal are also hot right now; and although they might seem a bit faddish, the evidence of their efficacy is compelling. Expect to see more of these and their ilk increasingly applied across a wider variety of pathologies, such as depression, chronic pain, tinnitus, and addiction.


Lastly, while supping at the Ghiradelli chocolate factory with a postdoc, he mentioned that he was miffed by the lack of theory-driven experiments in several of the posters he saw. That is to say, several posters would lead in with a statement such as "Much research has been done on topic X. However, relatively little is known about Y...", with an experiment devoted to the effects of Y. In my colleague's opinion, this leads to a broadening of the field without refining or testing any of the existing theories. Indeed, if any think his fears to be unfounded, here I reprint an abstract seen at the conference which would appear to support his apprehensions about unfocused research endeavors:


Title: The neural correlates of pooping
Author: Will Brown, M.D., Ph.D.
Abstract: Pooping is an adaptive evolutionary behavior observed to occur across a wide range of species, including dogs, birds, armadillos, and humans, with evolutionary psychologists believing it to serve as a biomarker for fitness and reproductive success. Much research has been done on pooping, but to our knowledge this has not yet been systematically examined using FMRI. In our first study we scanned 28 participants while pooping. Robust activation was observed in bilateral pre-SMA, dorsal ACC, and bilateral insula, which we have dubbed the "pooping network". The second study scanned the same participants while they watched videos of other humans or robots either reading or pooping, creating a 2x2 factorial design. All poops were controlled for size, pungency, luminance, texture, and nuttiness, using the Jeff Goldblum Excrement Control Scale. The contrast of HumanPoops - RobotPoops was associated with activity in the superior temporal sulcus, consistent with this region's role in processing socially relevant actions. By contrast, a main effect of observing poops collapsed across humans and robots led to increased activation in the inferior frontal gyrus, premotor cortex, and parietal cortex, a finding similar to other studies investigating mirror neurons, suggesting that mirror neurons may be essential for helping organisms learn how to poop. These results better inform our understanding of pooping, and may lead to mindfulness meditation and cognitive reappraisal treatments for pooping-related disorders, such as constipation, irritable bowel syndrome, and explosive diarrhea.


Clearly, some restraint is necessary when deciding what experiments to carry out, as there are an infinite number of questions to study, but which must, from time to time, be bound together under cohesive theories.

Overall, I had a great time, and am looking forward to CNS 2014!

Friday, April 12, 2013

CNS 2013: San Francisco



Readers and fellow brain bloggers,

I will be presenting a poster at CNS this Monday from 8:00am-11:00am, session D, poster 57. Featuring electrical shocks, a spatial Stroop task, passion, love, and good and evil, these FMRI results are so hot they would defy the pen of a Sappho to eroticize them. Feel free to stop by and say hi!


As a teaser/foreplay, here is a picture of one of my results: