Wednesday, June 30, 2004

Perl script for generating diffusion directions

I am putting into the public domain this Perl script for generating the directional cosines for an arbitrary number of diffusion directions, using a solid-angle tiling approach. The schemes generated with this code were used for the Poonawalla scheme N = 27 and N = 55 in [1] (that reference also compares the conditional number to other schemes such as icosahedral in Table 3).

Note that the code does not perform very well for N less than about 20. This is because the algorithm attempts to subdivide the sphere with circular tiles, which was a crude approximation. The intended use of this code is solely to provide a quick-n-dirty way to generate a usable diffusion scheme, with no claim that it's necessarily the best possible scheme available. But it's simplicity means that it can be adapted for real-time generation of a DTI protocol with much less computational overhead than an electrostatic repulsion model, and you can use any value of N you desire (unlike icosahedral schemes which are limited to specific N values). Please do contact me if you use this code or have suggestions for improvement (patches welcome).


[1] Poonawalla AH, Zhou XJ. Analytical error propagation in diffusion anisotropy calculations. J Magn Reson Imaging 2004;19(4):489-498.

Monday, June 28, 2004

Deus ex fMRI

It's often tempting for scientists to lapse into condescension towards the media portrayal of technology, an attitude which is counterproductive in general, because a partnership with the media is essential for fostering enthusiasm for Science (especially among the young).

Unfortunately, everything reported by the media goes through at least one Sensationalizing filter, which usually is a source of extreme frustration for scientists trying to ensure that their work is accurately described. There is no topic for which this is more true than fMRI research. Quoth Newsweek, in an article disconcertingly titled, "Mind Reading" - which tries to understand the thought process of students playing a variant of the Prisoner's Dilemma via the BOLD effect:

The fMRI machine shows how all this works inside the brain. A low offer stimulates activity in the brain's insular cortex, a relatively primitive region associated with negative emotions including anger and disgust. This appears to compete with the more highly evolved prefrontal cortex, the locus of the rational impulse to take the dollar and go buy a soda with it. The more activity in the insular cortex, the more likely subjects were to reject the offer. This is a big step toward being able to see on a screen what people actually want, rather than what they say in focus groups or interviews. Would brain-scan-assisted matchmaking or employee headhunting be more efficient than the way these have been carried out until now? Or would the fMRI merely ratify the judgments of intuition? Psychologists can hardly wait to find out.

And for their part, economists can hardly contain their glee at the research horizons this opens up. "Imagine if you could go on the floor of the stock exchange and see what was going on in traders' brains," says Camerer. "We kept hearing during the bubble that people were behaving as if they were in a delusional state. Well, were they or weren't they?" People don't save enough for their retirements because of a phenomenon known as forward discounting: they value money more in the here and now than 20 years down the road. If we could understand how this process works in the brain, says Paul Glimcher, a leading neuroscientist at New York University, we would have a head start on figuring out how to overcome it.

The emphasis on economists' (and later, marketers') glee is perhaps telling. To be fair, the article does briefly mention some of the physiological limitations of the fMRI signal, but that doesn't stop further downstream assertions such as:

The same tools that can answer deep questions about primate behavior can also be used to get people to sign up for more cell-phone minutes than there actually are in a month. A handful of researchers in the United States and Europe are already using fMRIs to test how product brands are represented in the brain.

Re-reading what I've written so far, I guess I haven't actually debunked the claims so much as repeat them with a sneer. The main rebuttal is that the physiological delay between the stimulus and the response - averaged over the millions of neurons in the large voxels of interest - is indeed correlated with the underlying thought processes, but it's exceedingly unlikely that any causal relationship can be inferred. You might as well try to understand the mechanics of an athlete's muscle fiber by monitoring their heart rate. But a more thorough discussion is probably better left to the comment section.

Thursday, June 24, 2004

MATLAB code for MRI pulse sequence design

There are some good resources for drawing MRI pulse sequence diagrams in MATLAB available online. One example is pulse.m by T.S. Mahesh, a PhD student in Bangalore. Dr. Mahesh's webpage has moved here, where I presume development of the pulse.m library will continue.

Another excellent resource is the MR Pulse Sequence Diagram Toolbox, originally written by Craig Jones of the University of British Columbia, but no longer available from the original site. I have currently mirrored the MRPSD toolbox here, (, 19.1 KB). Since MRPSD was released under the GNU Public License, it can be freely modified, and I intend to update the code with any changes I make at this location. A link to the most recent code is on the blog sidebar, and if any readers have patches to submit, please contact me.

Sunday, June 20, 2004

Magneto: the Patron Saint of MRI

Granted, technically magnetos are the exact opposite of an electromagnet, but the Marvel Comics character remains our field's patron saint by virtue of artistic license.

Powered by Blogger