Sunday, October 28, 2012

How to make a zombie brain

Hello kiddos. It's that time of year again for zombie neuroscience to rise from the ground and rear is viciously thoughtful head.

Last year's series of posts on the zombie brain that I did in collaboration with Brad Voytek over at Oscillatory Thoughts was a huge hit.  Since then we've managed to turn this thought experiment into a book deal with the amazingly supportive folks at Princeton University Press.  Brad and I have also worked with the TED Education group to do a two-part series of education shorts on teaching neuroscience using zombies.  You can watch both videos over at TED-Ed or just watch the first one here.



I have to say, the TED Ed group is absolutely amazing to work with.  If you get a chance to do a project with them, I highly recommend it.

Okay, back to the main post.  A key part of the talks that Brad and I give about the zombie brain is our 3D model of how it should look.  This is a simulated brain brain to show where lesions who have likely occurred and how they relate to various zombie "symptoms."

Check it out.  The zombie brain is the one on the right.



Now I often get asked how we actually made this model zombie brain.  I mean we can't really get a zombie and image it right?  Right???

Well until the zombie apocalypse gets us sufficient specimens to can, we had to do something else.  We had to take a human brain and morph it into what the zombie brain should look like.

So this post is for all you imaging geeks out there who want to know how to make your own model of the zombie brain.

For this you'll need 7 things.  All files can be downloaded from my website.
1. A template brain of a normal human: HERE 
2. A segmented image of said human brain: HERE 
3. A list of voxel IDs for the segmented map: HERE 
4. A list of regions you wish to "lesion": HERE 
5. A routine for extracting regions from the segmented map: HERE 
6. A routine for merging region files: HERE 
7. The core lesion loop script: HERE
To follow exactly my steps, you'll need Matlab and SPM8.  Although the logic is simple enough that if you're familiar with other imaging analysis programs/platforms you can replicate the process there.

Step 1: Get a good template MRI image.  I like using the Colin Brain, which is an average of several dozen structural brain scans of the same subject (Colin).  The Colin Brain is a standard template image in most analysis software packages or you can download the original here.  For this to work properly, you should use the skull stripped version (I used the ch2better.nii template that comes default with MRICron).  So if it's not skull stripped already, you should use a skull stripping program to do it (I've had good luck with BET2 in the past).  You can download the specific Colin Brain template that I used here.

This is what the Colin brain looks like normally.  Consider this our human template.



Step 2: Get a template segmentation map.  There are dozens of template segmentations these days.  I used the Automated Anatomical Labelling (AAL) template from the aal.nii file that comes standard with MRICron, but this is a pretty ubiquitous template these days.  Or if you don't want to go with a standard segmentation, you can use a program like Freesurfer to automatically segment the template brain you've chosen.  The important thing is that the template you use has a list of labels for each region ID number so you can choose them from a list (e.g., the aal.lut.txt file).  I've posted the AAL template and the region list I used on my website.

Here's a snapshot of the regions in the AAL template. Each color represents a different labeled brain area.



Step 3: Isolate the segmentation map.  This is a painful step.  You need to write a routine to extract each region from the segmented template.  I wrote a quick Matlab program to do it and you can download the segmentation routine here (NOTE: no promises it will work for you, I'm not gonna support any of this code... just sharing).  If you load the text file of the region list and voxel ID numbers, this will run through and make separate images for each region.

Step 4: Reslice the regions to the template space (NOTE: you can skip this step if you ran a segmentation routine on the template brain yourself).  In my case the template (human) brain is a 3D matrix with xyz dimensions of 301x370x316.  However, the AAL template file I used has the dimensions of 181x217x181.  So we just need to reshape the matrix size of each region of interest we extracted from the AAL file to match the size of the template brain.  I used spm_reslice.m for this.

Step 5: Get a list of regions you want to "lesion".  Now from the full list of extracted regions, you'll want to choose which parts of the brain you want to wipe out.  Here's the list I used for our zombie brain.

Step 6: The virtual lesion loop.  The principles of this loop are pretty easy.  For each region you want to loop through the list, load the file of that region, find the voxel coordinates of that region, save them in a map.  Then you'll want to make two maps.

The first map, isolates the areas to be lesioned and removes the gray matter  (i.e., voxels in these regions with an intensity less than some threshold will be set to zero).  It will look like this.



The second map is a map of everything else to be spared.  It looks like this.



Once you've got your two maps, you'll want to put them back together again.  The resulting map looks like this.



It's not perfect but it's close.  The final step of the process is to smooth out the rough edges.  I used the spm_smooth.m function for this with a smoothing kernel of 3mm FWHM.  The end result is what you saw above.


Voila. You've just turned Colin into Zombie Colin!  Here's the overlay of the original Colin brain and the zombie brain (orange) cause it's so cool!



Now with this routine you can pick and choose which areas you want to lesion.  This is how I came up with the fast versus slow zombie brains.


There's a lot of room to use this as you please for teaching and demonstrations.  It makes for easy visualisation of lesion/atrophy for educational purposes.  But remember, it's faked data, so ALWAYS use that disclaimer.

So that's it.  You've made Colin into Zombie Colin and now you can show him off to all your friends.

Until next year, Happy Halloween everyone!

Thursday, October 18, 2012

SFN 2012 Recap

This past week I was at the largest annual neuroscientific gathering in the world, where 28,000 people converged in one place to talk about brains.  The Society for Neuroscience meeting was held in New Orleans and man was it a fun trip this year.  Okay it did help that a) New Orleans is an absolutely amazing city that I will never get tired of going back to, b) we got to enjoy a little schadenfreude as the internet wrought revenge on a famous scientist who let his sexism show, c) Voytek and I had a very successful guerilla science campaign, and d) I got to do my first press conference which has since been picked up and mis-reported by CNN's blog.

Oh, and Ned the Neuron was a nice, warm and fuzzy presence at the conference and also at the late night bars.

But beyond that, the science was exceptionally good this year.  Here are some of the highlights that I caught.

-- Larry Abbott, perhaps one of the best theoretical neuroscientists alive, gave a fantastic lecture on how (counter-intuitively) unstructured networks lead to the best decoding. Basically it turns out that if you take a set of connections, in his case the olfactory system of the fly, then having a completely random wiring pattern actually makes it easier to decode the input stimulus.  Now I haven't read the paper, so I'm not 100% sure I can say why this works, but it does provide some interesting food for thought.  He also went on to present Mark Churchland's work on the subject which I'm saving for a later post (I have always been a big fan of Mark's work and I think he's onto something really amazing with his latest set of studies).

-- Contrary to some pretty vocal (and sometimes warranted) criticism, the Human Connectome Project gave a preview of some of its preliminary data and I gotta say... it looks incredible!  Their diffusion imaging data is hands down the best I've seen so far and they're already letting people download it to use in their research.  Have already registered and feel like a kid in the candy store.

-- Although I missed this talk at a pre-conference workshop, I hear that Philip Sabe's lab (my first post-doc adviser) has basically done the first step towards building The Matrix!  His graduate student, Maria Dadarlat, had some fantastic work where she continually pair patterns of stimulation in the monkey brain with real visual stimuli during a motor control task.  The monkey is trained to use this complex pattern of moving dot fields on a computer display to figure out how to navigate his arm around a workspace. After training, Maria can turn off the real visual stimulus (i.e., what the monkey sees) and the monkey uses the brain stimulation signals to guide his arm with as much accuracy as if he was actually seeing the visual stimulus.  Expect to hear big things when this comes out in press.

-- The optogenetics footprint was the largest I've seen this year. Some really cool work by several labs showing extensions into the non-human primates (wonder how long until it's used in humans for something) and significantly improved bandwidth.  This technology still boggles my mind, although I'm starting to appreciate some of the criticisms from the traditional physiology side of the table.

-- I also learned a lot about the in's-and-out's of NSF funding priorities for the near future thanks to some really helpful program officers and a great presentation on how to navigate the NSF grant process.  I literally couldn't write my notes fast enough.  All I can say is, emphasize novel and unique data sharing ideas as much as you can in your next set of applications...

Okay, I have many many more notes from visiting posters that I wont blather on about, but they will serve as fodder for future posts.  Just wanted to put these up there for anyone interested before I'm reduced to a coma from exhaustion.