• Blog
  • About
  • Publications
  • Videos
  • Workshops
  • CV
  • Contact Me
  • Hall of Fame
Menu

Andy's Brain Blog

Street Address
City, State, Zip
Phone Number
fMRI, Neuroimaging, and More

fmri, neuroimaging, and more

Andy's Brain Blog

  • Blog
  • About
  • Publications
  • Videos
  • Workshops
  • CV
  • Contact Me
  • Hall of Fame

Introduction to FreeSurfer, Part 1: Overview & Installation

December 7, 2018 Andrew Jahn
FS_aparc2009.png

Your Data Relationship

It’s normal to get bored. It’s normal to get frustrated. It’s normal to wake up one day next to your laptop, look at it, and not be able to imagine how you could spend another day analyzing fMRI data. It’s noisy, inconsiderate, and doesn’t care about your feelings. “Just give me a result!” you scream, pounding your fists against the screen. But it just sits there. Impassive.

So one day you stop caring, too. At first getting your buttons pushed was kind of hot. Now it’s annoying. Your mind begins to wander to other methods; something new, fresh, more exciting. You hear stories about how the other graduate students are getting along famously with their EEG data, with their fNIRS data. “Oh, my data and I are doing great,” they tell you over lunch. They just seem so perfect for each other. You start to develop a data-relationship crush on them, fantasizing what it would be like to mess around with another modality.

What if I told you that you could do just that, without any negative consequences? The answer is FreeSurfer. For those who are bored with their everyday, “functional” analyses, FreeSurfer can spice things up and inject some fun and unpredictability into your frigid relationship. Maybe it’s good to spend some time away from your fMRI data and play the neuroimaging field. When you come back to it you will be more mature, more experienced, and have a better understanding of what you want out of your data.

FreeSurfer is particularly attractive because, no matter what other kinds of data you collect during your scan, you will most likely acquire a T1-weighted anatomical image. And unlike a functional scan that involves an experiment with actual planning and hard work, collecting a T1 image is nearly impossible to screw up. And for a structural analysis, a T1 scan is usually all you need.

Figure 1: An illustration of the partial voluming effect. A voxel, outlined in red, contains signal from both region A (green) and region B (yellow). The partial voluming effect can also occur when the signal contains both grey matter and white matt…

Figure 1: An illustration of the partial voluming effect. A voxel, outlined in red, contains signal from both region A (green) and region B (yellow). The partial voluming effect can also occur when the signal contains both grey matter and white matter.

Here’s what’s different: Instead of analyzing the brain as a 3D volume, FreeSurfer transforms the cortex into a 2D surface. Why a 2D surface? Picture a voxel that straddles both edges of a sulcus. The voxel contains a mixture of signals from both regions, and it is not possible to determine which region contributed to the signal - a problem known as the partial voluming effect (Figure 1).

We run into a similar problem when we have a voxel that contains two or more different tissue types. Imagine we have a voxel that contains grey matter, white matter, and cerebrospinal fluid (CSF). In this case we cannot tell how much of each is contained by that voxel: It is a single number which represents each of the different tissue types within the voxel, but it is impossible to tell how much of each tissue type is within the voxel (Figure 2).

Figure 2: The partial voluming effect in a structural scan. The box highlighted in red represents a voxel that encompasses three different tissue types: White matter, grey matter, and CSF. If you imagine that the greyscale image is a real brain, and…

Figure 2: The partial voluming effect in a structural scan. The box highlighted in red represents a voxel that encompasses three different tissue types: White matter, grey matter, and CSF. If you imagine that the greyscale image is a real brain, and our red box is the smallest resolution element of our scan, the red box would be an average of the different tissue types contained within it.

FreeSurfer’s Solution

FreeSurfer gets around this problem by tracing the boundaries between the different tissues of the brain - grey and white matter, grey and pial matter, and so on - and then inflating those surfaces into spheres. Most of the leftover defects in the inflated surface are automatically corrected (although some do need to be fixed manually). These surfaces can then be rendered as partially inflated, fully inflated, or spherical brains.

To help you better understand what FreeSurfer does, picture this: You’ve just removed someone’s brain and placed it on the table. The brain is like a flaccid balloon, with the wrinkles representing the gyri and sulci of the cortex. Now, you put your mouth on the severed brainstem (after washing it with soap and hot water, of course) and blow as hard as you can, inflating the brain to its maximum extent. The wrinkles disappear and the brain becomes a fully inflated balloon, like a sphere. This is a different way to view your data - instead of using voxels as the building blocks of our image, we use vertices and edges. Think of this as like a chain link fence wrapped around the surface of the cortex: The intersections of the links are the vertices and the links are the edges (Figure 3). The vertex is now our smallest resolution element, and at each vertex we can calculate structural measurements such as thickness, volume, and surface area.

Figure 3: Sample illustration of the FreeSurfer reconstruction (recon) process. (A) The T1-weighted anatomical scan is created by the scanner, usually with a resolution of about 1mm cubed. (B) The 3D anatomical image is converted by FreeSurfer’s rec…

Figure 3: Sample illustration of the FreeSurfer reconstruction (recon) process. (A) The T1-weighted anatomical scan is created by the scanner, usually with a resolution of about 1mm cubed. (B) The 3D anatomical image is converted by FreeSurfer’s recon-all into a 2D mesh. The pial surface is displayed here. (C) A closeup of the mesh surface, showing its composition of Vertices (intersections of the triangles making up the mesh) and Edges (connections between vertices).

Figure 4: Brain activity mapped onto the surface. The inflated pial surface is displayed here. Green: Gyri; Red: Sulci. The thresholded activation map is displayed in blue. Note that this type of rendering gives the viewer a better idea of where act…

Figure 4: Brain activity mapped onto the surface. The inflated pial surface is displayed here. Green: Gyri; Red: Sulci. The thresholded activation map is displayed in blue. Note that this type of rendering gives the viewer a better idea of where activity lies within the sulci, is otherwise hidden in a volumetric, 3D view.

Once you’ve reconstructed the surface you can resample your statistical maps and view them on an inflated surface (Figure 4), or deflate the surface and see where the activation lies on the original, wrinkled cortex. This gives you a better picture of how the statistical maps lie along the ridges and valleys of the brain.

FreeSurfer uses the reconstructed surface, along with prior knowledge about the topology of a typical human brain, to label the cortical and subcortical structures. The labeling of the cortex is called Parcellation, and the labeling of the subcortical structures is called Segmentation. These labelings are based on the two atlases that come with FreeSurfer: The Desikan-Killiany atlas and the Destrieux atlas, with the Destrieux atlas containing finer-grained parcellations. Structural measurements are then averaged within each parcellation. These measures can then be compared across groups, or correlated with some individual difference measure, such as age, IQ, and satisfaction with your current data relationship.

Watch the video below for a summary of what FreeSurfer is and the definition of common FreeSurfer terms:

How to Get FreeSurfer

Getting FreeSurfer is easy. First you set up a dating profile on Tinder, put “smooth surfaces” in your interests section, swipe right a lot, and…

No, wait! I was thinking of something else. The real way to get FreeSurfer is to go to the FreeSurfer download page and select the version compatible with your operating system. The instructions for installing FreeSurfer are detailed and easy to follow; assuming that you’re using a Macintosh operating system, you download and install the package the same way you would any other disk image. To prevent FreeSurfer from being used by terrorists, you are required to apply for a license (make sure to check the box that says “I am not a terrorist”; do NOT check the box that says “Yes, I am a terrorist”), and then copy the license into your $FREESURFERHOME directory. (And if $FREESURFER_HOME doesn’t mean anything to you - or if you’re completely new to using a Terminal - watch this playlist for an overview of Unix.)

This should be straightforward enough; but if you need help, follow along with this screencast:

Once you have FreeSurfer working, we will move on to the next step: Reconstructing the cortical surface using the command recon-all. You will also learn how to reduce the time it takes to run recon-all by using something called “parallel.” All that, and more, when we see each other next Friday.

Tags FreeSurfer, cortical surface, recon-all, introduction, fMRI, neuroimaging, structural, T1
← Introducing Andy's Brain BookROI Analysis Presentation →
Archive
  • September 2024
  • June 2024
  • March 2024
  • January 2024
  • June 2023
  • May 2023
  • April 2023
  • February 2022
  • January 2022
  • January 2021
  • December 2020
  • April 2020
  • December 2018
  • April 2018
  • January 2018
  • December 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • January 2017
  • November 2016
  • August 2016
  • July 2016
  • February 2016
  • January 2016
  • September 2015
  • August 2015
  • July 2015
  • May 2015
  • April 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • April 2012
  • March 2012

What's on Andy's Brain this month?

Connect with Andy!

Powered by Squarespace