[wiki:FreeSurferWiki top] | [wiki:Installation previous]
FreeSurfer Setup and Configuration
To configure FreeSurfer
1. Copy the license file into freesurfer/ and rename it to ".license" (no quotes) if necessary.
2. The file freesurfer/FreeSurferEnv.csh is a csh (c-shell) script that will configure your environment so that you can use FreeSurfer. It sets a few envrionment variables and performs some sanity checks. If you are comfortable writing shell scripts, you may wish to set up your system differently, but we recommend the following:
Create a file in your home directory called something like "SetUpFreeSurfer.csh" with the following contents:
# Additional configurations will go here.BR
The full path to your freesurfer directory should be something like:
/home/username/freesurfer
2. If you wish to designate a non-default subjects directory, add the following line in the 'additional configurations' section, before 'cd $FREESURFER_HOME' is called:
setenv SUBJECTS_DIR <full path to subject dir>
3. If you installed the MINC tools, then add the following lines to the additional configuration section:
setenv MINC_BIN_DIR /usr/pubsw/packages/mni/current/binBR setenv MINC_LIB_DIR /usr/pubsw/packages/mni/current/lib
If you did not install the MINC tools, then add the following line in the local setup section:
setenv NO_MINC
4. If you do NOT intend to use the functional tools, then add the following line to the additional configuration section:
setenv NO_FSFAST
If you do intend to use the functional tools, then add these lines to your ~/matlab/startup.m file:
fsfasthome = getenv('FSFAST_HOME'); BR fsfasttoolbox = sprintf('%s/toolbox',fsfasthome); BR path(path,fsfasttoolbox); BR
5. Save the file. You will need to source this file every time you want to use Freesurfer.
6. Make sure you are using csh or tcsh. You can check by typing 'ps' at the command line. If you do not see csh or tcsh as one of the processes in the right hand column of output, you must change your default shell to csh or tcsh or explicitly launch csh or tcsh first.
To explicitly launch csh or tcsh (tcsh is recommended), simply enter the following command:
tcsh
You may notice your prompt change. Note that some of your login files may not be run in the new shell environment. See the man pages for tcsh for details.
7. Source the script.
source SetUpFreeSurfer.csh
You should see output like this:
Setting up enviroment for FreeSurfer/FS-FASTBR FREESURFER_HOME /home/freesurferBR FSFAST_HOME /home/freesurfer/fsfastBR AFNI_DIR /home/freesurfer/afniBR FSL_DIR /home/freesurfer/fslBR SUBJECTS_DIR /home/freesurfer/subjectsBR
If you see any warnings, you can probably safely ignore them, but make sure they are not notifying you that it can't find something you think should exist.
If you see any error messages, make sure you have performed the installation process properly, and that your FREESURFER_HOME setting is correct.
From now on, you only need to source the SetUpFreeSurfer.csh script once in a shell session to be able to run FreeSurfer. You may want to do this in our shell's login scripts (i.e. .cshrc or .tcshrc).