How to use FSL brain extraction

Taylor Hanayik
Selective Sapience
Published in
3 min readFeb 11, 2018

One of the most common tools in brain research is the MRI machine. An MRI enables researchers to collect images (usually in 3D) of our participant’s or patient’s brain. Once we have those images we then have to heavily process them to get usable data to answer our scientific questions.

One of the first processing steps in many brain imaging analysis workflows is to extract the brain tissue from inside the skull. This is necessary when we collect high resolution anatomical scans commonly referred to as “T1-weighted” images. These images do contain the brain, but also other tissues (bone, skin, fat, air) and anatomy (neck, upper spinal cord, eyes, mouth) that we don’t really need when studying the brain’s structure and function. Therefore it’s best to extract only the brain related tissue so that we can use it in all future analysis steps.

Below, you will see my original anatomical image (T1-weighted), along with my brain extracted image and the steps used to extract the brain.

Original image

Original high resolution T1w image (no processing done yet)

Brain extraction command explained

To perform brain extraction using FSL you can use either the graphical interface, or you can use the command line (Terminal app on MacOS or Ubuntu Linux). This how-to guide assumes you have FSL installed. If you don’t, then it’s best to stop reading here and go do that first. I’ll be using the command line to perform brain extraction in this guide.

Usage: bet <input_file_name> <output_file_name> [options]bet T1.nii T1_brain.nii -R -f 0.3 -o

The above command bet takes an image containing brain+other tissue (skull, neck, etc.), and outputs the brain extracted image. The -R option instructs the program to use its robust method, which iterates the entire process multiple times. The -f 0.3 option sets what the developers call fractional intensity threshold. Basically, the number can range from 0 to 1, and smaller numbers result in larger brain outlines. So setting this number to something small, like 0.1 will result in a very conservatively extracted brain image, which might still include some unwanted non-brain tissue. Setting the fractional intensity to a larger value (e.g. 0.9) will result in an extremely strict brain extraction, which risks chopping of edges of cortex that are actually brain tissue. Usually midrange values work best. Lastly, the -o option tells the program to output an overlay image, which is great for QA (quality assurance). This overlay image allows you to see how well your extraction worked, and check if the process has accidentally stripped off brain tissue that you might actually have wanted.

Below, you can see the brain extracted image and the QA overlay image.

Brain extracted image

Brain extracted image using settings -R -f 0.3 -o

QA overlay image

Original image with the brain outline overlayed in bright white

That’s it for for brain extraction with FSL! Generally, it’s a pretty straightforward process, and sets you up for success in later processing steps. Just keep in mind that it’s important to check the results, or the overlay file using the -o option since every brain is different. The same settings may not apply to every image you use the bet tool on.

Make sure to follow my writings and this publication for future how-to articles!

--

--

Taylor Hanayik
Selective Sapience

Software engineer at the University of Oxford. I design and develop software for neuroimaging research.