Neuroimaging Software

Install FSL, FreeSurfer and Other Neuroimaging Tools on Windows with WSL 2

Most neuroimaging software (FSL, FreeSurfer, ANTs, MRtrix3, AFNI) is built for Linux and macOS. On Windows you do not need a second computer or a dual-boot: WSL 2 (Windows Subsystem for Linux) runs a real Ubuntu system alongside Windows. The SpinLab Install on Windows guide walks through the whole setup in 13 steps, with each command ready to copy and a tracker showing your progress.

Install neuroimaging tools on Windows with WSL 2
Step 1 of 13: enable WSL 2 and install Ubuntu, with the commands to copy and a progress tracker. From spinlab.mrispin.com.

Before you start

  • Windows 10 (version 2004 or later) or Windows 11.
  • Virtualisation turned on in the BIOS or UEFI settings.
  • Plenty of free disk space. A full set of tools in the SpinLab guide needs about 30.7 GB.
  • Administrator rights for the first step.

Step 1: install WSL 2 and Ubuntu

Open PowerShell as administrator and run:

wsl --install

This turns on the required Windows features and installs Ubuntu. Restart when asked, then open Ubuntu from the Start menu and create a Linux user name and password. Check that you are on version 2:

wsl -l -v

Step 2: update Ubuntu

sudo apt update && sudo apt upgrade -y

Steps 3 onwards: the tools

The guide then installs each package with the commands its developers recommend. Choose only what you need; each step shows its approximate size.

ToolUsed for
FSLPreprocessing, registration, FEAT, diffusion (FDT), BET
FreeSurferCortical reconstruction and segmentation (needs a free licence file)
ANTsHigh-quality registration and normalisation
MRtrix3Diffusion MRI and tractography
dcm2niix and HeuDiConvDICOM to NIfTI and BIDS conversion
Python toolsNiBabel, Nilearn and friends for scripting

Graphical programs (FSLeyes, freeview)

Windows 11 includes WSLg, which shows Linux windows directly. On Windows 10 you need an X server such as VcXsrv. Start it, then tell Ubuntu where to send windows:

export DISPLAY=$(grep nameserver /etc/resolv.conf | awk '{print $2}'):0
fsleyes &

Add the export line to ~/.bashrc so it is set every time.

Working with your files

  • Your Windows drives appear under /mnt/c, /mnt/d and so on.
  • For speed, keep data you process inside the Linux file system (for example ~/data). Reading many small files across /mnt/c is much slower.
  • From Windows Explorer you can open the Linux files at \\wsl$.

Next: convert your first dataset to BIDS or fix installation errors with the Error Doctor.

Last reviewed: 7 November 2026. SpinLab and SpinCalc are free tools developed by MRISpin. Screenshots show the tools as they were on this date and may change as the tools are updated. Generated scripts should be checked before use on real data.

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