FSL

## DOWNLOADING AND INSTALLING

### Downloading

FSL is available precompiled for the Linux and Mac OS X operating systems. Windows is supported via a Linux Virtual Machine. The sources are also available if you want to compile it yourself.

Download FSL

### Installation instructions

- Mac OS X
- Linux
- Windows
- You are compiling the source distribution instead of taking a binary distribution

### Running

Make sure the following is present somewhere in your shell setup file (.bashrc, .profile, .cshrc etc., depending on what shell you use), changing "/usr/local/fsl" to wherever you have installed FSL:

bash / sh / ksh`
FSLDIR=/usr/local/fsl
. ${FSLDIR}/etc/fslconf/fsl.sh
PATH=${FSLDIR}/bin:${PATH}
export FSLDIR PATH`

tcsh / csh`
setenv FSLDIR /usr/local/fsl
source ${FSLDIR}/etc/fslconf/fsl.csh
setenv PATH ${FSLDIR}/bin:${PATH}`

To run the FSL tools from the command line, you can find the tools in $FSLDIR/bin. In general command-line programs are lower case (e.g. 'bet'). In general the GUI version is capitalised (e.g. 'Bet'), except on Mac, where '_gui' is appended because those file systems can't tell the difference between upper and lower case (e.g. 'Bet_gui').

To bring up a simple GUI which is just a menu of the main individual FSL GUI tools, just type fsl.

### Customising (for different output datatypes, etc.)

There are several environment variables which FSL uses to determine certain user preferences, such as the output file format (NIFTI_GZ, NIFTI_PAIR, etc). The defaults for these are set when you source the setup file as shown above (i.e., ${FSLDIR}/etc/fslconf/fsl.sh or ${FSLDIR}/etc/fslconf/fsl.csh). If you wish to change these defaults then you need to:

    cd
    mkdir .fslconf
    cd .fslconf

and in this directory create a file called fsl.sh or fsl.csh, depending on the shell that you use, setting any or all of the variables that appear in the central ${FSLDIR}/etc/fslconf/fsl.sh or ${FSLDIR}/etc/fslconf/fsl.csh files.

DO NOT copy the central files into `~/.fslconf/` as it will cause a loop that will stop your login from working.

It is recommended that the files `~/.fslconf/fsl.sh` or `~/.fslconf/fsl.csh` only include a few variable definitions and nothing more. Note that whoever installs FSL can also edit the central files in `$FSLDIR/etc/fslconf` to change the preferences for all users.

### Setting up FSL to use a SunGridEngine (or similar) computing cluster

Several of the more compute-intensive tools can now take advantage of cluster computing, via SunGridEngine (SGE):

- FEAT will run multiple first-level analyses in parallel if they are setup all together in one GUI setup. At second level, if full FLAME (stages 1+2) is selected then all the slices are processed in parallel.
- MELODIC will run multiple single-session analyses (or single-session preprocessing if a multi-session/subject analysis is being done) in parallel if they are setup all together in one GUI setup.
- TBSS will run all registrations in parallel.
- BEDPOST (FDT) low-level diffusion processing will run all slices in parallel.
- FSL-VBM will run all registrations in parallel, both at the template-creation stage and at the final registrations stage.
- POSSUM will process all slices in parallel.

All the above tools interact with a compute cluster via a single central script fsl_sub; if no cluster is available then this script silently runs all the requested jobs in series. To customise FSL for your local compute cluster and clustering software, simply edit ${FSLDIR}/bin/fsl_sub - hopefully the comments in this file are sufficient to make this fairly painless, particularly for labs using SGE. For other clustering software than SGE, note that fsl_sub makes use of an SGE feature allowing the submission of a text file containing a list of commands (one per line) to be run in parallel.