Contents
Configuring your shell
If you have used the FSL installer your shell will have already been setup for running the FSL tools. However, there are situations where you may need to carry out this configuration by hand, for example when installing FSL on a multi-user computer. How you do this will depend on what shell you are using (see what shell am I using?).
BASH/sh/ksh
User shell setup is stored in a file called .bash_profile (BASH) or .profile (SH, KSH and sometimes BASH) in your home folder (eg ~/.bash_profile), you need to edit (or create) this file to add the following lines:
FSLDIR=/usr/local/fsl
. ${FSLDIR}/etc/fslconf/fsl.sh
PATH=${FSLDIR}/bin:${PATH}
export FSLDIR PATH
changing /usr/local/fsl to the directory path you installed FSL to.
csh/tcsh
User shell setup is stored in a file called .cshrc (csh and tcsh) or .tcsh (tcsh only) in your home folder (eg ~/.cshrc), you need to edit (or create) this file to add the following lines:
setenv FSLDIR /usr/local/fsl
source ${FSLDIR}/etc/fslconf/fsl.csh
setenv PATH ${FSLDIR}/bin:${PATH}
changing /usr/local/fsl to the directory path you installed FSL to.
Mac OS X 10.4 and X11 setup
By default Mac OS X 10.4's Terminal application cannot run X11 applications. To fix this, add the following to your .bash_profile or .cshrc files:
.bash_profile
if [ -z "$DISPLAY" -a "X$TERM_PROGRAM" = "XApple_Terminal" ]; then X11_FOLDER=/tmp/.X11-unix currentUser=`id -u` userX11folder=`find $X11_FOLDER -name 'X*' -user $currentUser -print 2>&1 | tail -n 1` if [ -n "$userX11folder" ]; then displaynumber=`basename ${userX11folder} | grep -o '[[:digit:]]\+'` if [ -n "$displaynumber" ]; then DISPLAY=localhost:${displaynumber} export DISPLAY else echo "Warning: DISPLAY not configured as X11 is not running" fi else echo "Warning: DISPLAY not configured as X11 is not running" fi fi
changing /usr/local/fsl to the directory path you installed FSL to.
.cshrc
if ( $?TERM_PROGRAM ) then if ( "X$TERM_PROGRAM" == "XApple_Terminal" ) then; if ( ! $?DISPLAY ) then set X11_FOLDER=/tmp/.X11-unix; set currentUser=`id -u`; set userX11folder=`find $X11_FOLDER -name 'X*' -user $currentUser -print | tail -n 1` if ( "X$userX11folder" != "X" ) then set displaynumber=`basename ${userX11folder} | grep -o '[[:digit:]]\+'` if ( "X$displaynumber" != "X" ) then setenv DISPLAY localhost:${displaynumber} else; echo "Warning: DISPLAY not configured as X11 is not running" endif else echo "Warning: DISPLAY not configured as X11 is not running" endif endif endif
changing /usr/local/fsl to the directory path you installed FSL to.
System-wide setup
You have several options for automatically setting up FSL for all users on the computer, all beyond the scope of this document, but here are some suggestions on how you might go about this.
Change the template used for new user accounts (look in /etc/skel on Linux or /System/Library/User Template/English.lproj/ on Mac OS X). New users will then get a suitably modified settings file.
- Store the settings in an NFS shared folder. You could ensure that the default settings file looks for and sources a settings file on an NFS server. This is useful for a compute cluster as you only have to edit one file to have it change everywhere.
Modify the system-wide .profile or .cscrc file. On Mac OS X the files /etc/profile and /etc/csh.cshrc control this for all users, on Linux you can create files fsl.sh and fsl.csh in /etc/profile.d containing the settings. If you are using the fsl_installer.sh script then you can carry out this configuration by running the script with the -E option (Linux only).
Take Care
Be careful what you put in these files as you could stop people logging in!
Localisation problems
FSL programs generally require a period to be used as the decimal separator ( e.g. 10.4 0.235 etc ). If your environment is configured to use a different character such as a comma then this may cause problems. Two potential fixes are to change the LC_NUMERIC variable value by: (i) typing the following lines into a terminal locally each time you want to run FSL, or (ii) globally modifying all terminals by adding the following lines to the .bash_profile ( or equivalent ):
LC_NUMERIC=en_GB.UTF-8 export LC_NUMERIC
Take Care
Modifying your locale globally (e.g. in .bash_profile) may result in issues with other scripts on your system - change with care!