Installation Instructions

FSL-MRS should be installed using the conda package manager (option 1) or via the main FSL installer (option 2). Building from source code is possible using the instructions in option 3. For installation on MS Windows machines please see the specific setup instructions below.

Option 1: Using Conda

The primary installation method is via conda. After installing conda and creating or activating a suitable environment you can install FSL-MRS from the FSL conda channel. See our page on setting up a conda enviroment for a step by step guide. Do not install _FSL-MRS_ into the base environment (this is the environment that starts activated).

conda install -c conda-forge \
              -c https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/ \
              fsl_mrs

To check the version installed run fsl_mrs --version. FSL-MRS can be updated by running conda update:

conda update -c conda-forge \
              -c https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/ \
              fsl_mrs

Example data with conda

Installation with conda is easy, but you won’t get the packaged example data and notebooks. This can be downloaded separately here: FSL-MRS example data.

Option 2: FSL install script

Follow the instructions on the main FSL wiki installation page.

Option 3: From GitLab

Download or clone from FSL-MRS GitLab. To get FSL-MRS with example data and example Jupyter notebooks, download the full package from gitlab. Git LFS must be installed to download package data.

git clone --recurse-submodules https://git.fmrib.ox.ac.uk/fsl/fsl_mrs.git
cd fsl_mrs
conda install -c conda-forge -c defaults \
        -c https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/ \
        --file requirements.txt
pip install --no-deps .

Windows Operating System

FSL-MRS has been tested thoroughly on Mac and Linux operating systems but is not currently tested on MS Windows. However there are three routes for using FSL-MRS on Windows.

Option B: Native windows FSL-MRS + FSL on WSL

Alternatively, as of V1.1.13 of FSL-MRS the python-only FSL-MRS package can be run in native Windows alongside a WSL FSL installation. This can be achieved as follows:

  1. Enable WSL and install FSL into WSL as described in the FSL install instructions.

  2. Add an FSLDIR enviroment variable on the host Windows machine. This should be set to \\wsl$\usr\local\fsl assuming the default install directory for FSL on the WSL guest. In Powershell this can be done with the command $env:FSLDIR = "\\wsl$\usr\local\fsl" to set it for a single session or [System.Environment]::SetEnvironmentVariable("FSLDIR", "\wsl$usrlocalfsl", [System.EnvironmentVariableTarget]::User) to set it permanently.

  3. Install FSL-MRS on the native Windows machine by following the conda installation guide in Option 1.

For FSL-MRS to access the FSL scripts installed on the WSL machine, it must be running.

Option C: Native windows FSL-MRS (partial function)

Install FSL-MRS on the native Windows machine by following the conda installation guide in Option 1. Certain features which rely on an FSL installation (e.g. the svs_segment scripts) won’t function.

Verifying the installation

Please run the packaged fsl_mrs_verify script to confirm that installation has successfully completed.