Neuroimaging Software

Getting started with FSL: brain extraction and registration

FSL (the FMRIB Software Library) is one of the most widely used toolkits in neuroimaging research. It covers structural, functional and diffusion MRI, and its command-line tools chain together neatly in shell scripts. This article introduces the core ideas and a typical structural workflow.

Learning objectives

  • Name the main FSL tools for brain extraction, segmentation and registration.
  • Explain the difference between linear (FLIRT) and non-linear (FNIRT) registration.
  • Read and write a simple FSL command-line workflow.
  • Know the checks to run before trusting any result.
MNI152 2009c symmetric template rendering
Standard-space template used as a registration target. MNI152 2009c symmetric template rendering. Image: VladimirFonov, CC BY 3.0, via Wikimedia Commons (File:Mni_icbm152_sym_09c_small.jpg).

What FSL contains

ToolPurpose
BETBrain extraction (skull stripping)
FASTTissue segmentation into gray matter, white matter and CSF, with bias-field correction
FLIRTLinear (affine) registration
FNIRTNon-linear registration
FEATTask and resting-state functional MRI analysis
FDTDiffusion MRI processing and tractography
fslmaths / fslstatsImage arithmetic and measurements from the command line

A typical structural workflow

  • Convert DICOM to NIfTI and organise the data (see From DICOM to BIDS with HeuDiConv).
  • Extract the brain with BET.
  • Segment tissues with FAST.
  • Register to a standard space with FLIRT, then FNIRT if non-linear alignment is needed.
  • Quality check every output by viewing it.
# Illustrative commands. Check options for your FSL version.
bet sub-01_T1w.nii.gz sub-01_T1w_brain -R -f 0.4
fast -B -o sub-01_seg sub-01_T1w_brain
flirt -in sub-01_T1w_brain -ref $FSLDIR/data/standard/MNI152_T1_2mm_brain \
      -out sub-01_to_MNI_lin -omat sub-01_to_MNI.mat

The “-f” value in BET sets the fractional intensity threshold and often needs adjusting for different images, which is why visual checking matters.

Linear versus non-linear registration

Linear registration (FLIRT) finds a rotation, translation, scaling and shear that best aligns two images. It is fast and robust, and is the usual first step. Non-linear registration (FNIRT) allows local warping, which matches anatomy more closely but can over-fit if the images are poor. Choose according to how precise the alignment must be and always inspect the result.

Common pitfalls

  • Accepting default brain extraction without looking at it.
  • Mixing image orientations or forgetting to check left-right conventions.
  • Not recording software versions, which makes results harder to reproduce.
  • Running a script on a whole dataset before testing it on one subject.

Key takeaways

  • FSL gives you modular command-line tools for the main neuroimaging steps.
  • Linear registration first; non-linear when you need local accuracy.
  • Check every intermediate result by eye.
  • Record versions and commands for reproducibility.

SpinLab can generate a complete script for workflows like this from the steps you choose.

Frequently asked questions

Is FSL free?

FSL is free for academic non-commercial use under its licence. Check the current licence terms for other uses.

Do I need Linux?

FSL runs on Linux and macOS. Windows users commonly use the Windows Subsystem for Linux.

References and further reading

  • Jenkinson M, Beckmann CF, Behrens TEJ, Woolrich MW, Smith SM. FSL. NeuroImage. 2012;62:782-790.
  • Smith SM. Fast robust automated brain extraction. Hum Brain Mapp. 2002;17:143-155.
  • FSL documentation: fsl.fmrib.ox.ac.uk/fsl/docs

Related articles

Last reviewed: 4 November 2026. Educational overview. Commands are illustrative: options change between versions, so check the official documentation for the version you install. Do not process identifiable patient data outside approved systems.

MRISpin Team

MRISpin team combines decades of experience in MRI research, clinical practice, and science communication. Meet the people driving MRISpin’s mission.

Related Articles

Back to top button