Differences between revisions 2 and 12 (spanning 10 versions)
Revision 2 as of 2005-08-12 12:51:49
Size: 3688
Comment:
Revision 12 as of 2005-09-25 14:07:57
Size: 5609
Comment: added MNI tool fixup, as it needs to run after sourcing SetUpFreeSurfer.csh
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
[wiki:Self:FreeSurferWiki top] | [wiki:Self:Installation previous] [wiki:Self:DownloadAndInstall top] | [wiki:Self:Installation previous] | [wiki:Self:TestingFreeSurfer next]
Line 5: Line 5:
== To configure FreeSurfer == == Basic setup ==
Line 7: Line 7:
1. Copy the license file into freesurfer/ and rename it to ".license" (no quotes) if necessary. Usage of C shell (csh) or enhanced C shell (tcsh) is recommended, although bash/sh scripts are also provided for the setup scripts. The shell type on your system can be checked by typing '''ps''' at the command line in a terminal window. To explicitly launch csh or tcsh (tcsh is recommended), simply enter the following command in a terminal window:
{{{
tcsh
}}}
The prompt may change, and some login files may not be run in the new shell environment. See the man pages for tcsh for details.
Line 9: Line 13:
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: If you do not have a preference for a particular shell, the default shell can be permanently switched to tcsh by typing the following:
{{{
chsh -s /bin/tcsh
}}}
Line 11: Line 18:
Create a file in your home directory called something like "SetUpFreeSurfer.csh" with the following contents: The file <freesurfer_installation_directory>/!SetUpFreeSurfer.csh is a csh (C-shell) script that will configure the environment so that FreeSurfer can be used. It sets a few environment variables, sources other csh scripts to set up support libraries, and performs some checks that need to be passed before FreeSurfer can start. This file needs to be 'sourced' before running any FreeSurfer binaries.
Line 13: Line 20:
     `# Local setup.` [[BR]]
     `setenv FREESURFER_HOME <full path to freesurfer/>`[[BR]]
[[BR]]
     `# Additional configurations will go here.`[[BR]]
[[BR]]
     `# Call configuration script.`[[BR]]
     `cd $FREESURFER_HOME`[[BR]]
     `source Free``Surfer``Env.csh`[[BR]]
To setup the tools to run, from a tcsh or csh, type:
{{{
setenv FREESURFER_HOME <freesurfer_installation_directory>/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.csh
}}}
Where <freesurfer_installation_directory> is replaced with the path of whereever you installed the distribution.
Line 22: Line 27:
The full path to your freesurfer directory should be something like:
     
     `/home/username/freesurfer`
If using bash or sh, type:
{{{
setenv FREESURFER_HOME <freesurfer_installation_directory>/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.sh
}}}
Line 26: Line 33:
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: Alternately, the resource file for the shell can be configured to source the file automatically each time the shell is started. In the home directory of the user who will be running FreeSurfer binaries, edit the file '''.cshrc''' if C-shell will be used, the '''.tcshrc''' for enhanced C-shell, the '''.bashrc''' file for Bash, and '''.profile''' for sh, to include the previous two lines (which setenv FREESURFER_HOME, and then source the !SetUpFreeSurfer.csh(or sh) script).

Upon 'sourcing' the !SetUpFreeSurfer.csh(sh) script, you should see output like this (assuming an installation path of /usr/local):
{{{
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME /usr/local/freesurfer
FSFAST_HOME /usr/local/freesurfer/fsfast
SUBJECTS_DIR /usr/local/freesurfer/subjects
FUNCTIONALS_DIR /usr/local/freesurfer/sessions
MINC_BIN_DIR /usr/local/freesurfer/lib/mni/bin
MINC_LIB_DIR /usr/local/freesurfer/lib/mni/lib
PERL5LIB /usr/local/freesurfer/lib/mni/lib/perl5/5.8.0
GSL_DIR /usr/local/freesurfer/lib/gsl
QTDIR /usr/local/freesurfer/lib/qt
TCLLIBPATH /usr/local/freesurfer/lib/tcltktixblt/lib
}}}

If any warnings appear, it's usually safe to ignore them, but make sure that they are not stating that a file or directory that should exist cannot be found.

If any error messages appear, check that the installation process was successfully completed.

== MINC toolkit perl path fix-up ==

'''Important!'''

Some of the MNI tools contain hard-coded paths to perl. To fix this situation, type:
{{{
fixup_mni_perl_path
}}}

Now the MNI tools will find the perl binary on your platform. You can confirm this by typing 'nu_correct', which should return version information (v1.10).

== License ==

If you haven't done so already, [wiki:Self:Registration obtain a license], and copy the .license file to your $FREESURFER_HOME.

== Optional configuration settings ==

The defaults declared in the !SetUpFreeSurfer.csh script should work for most installations. However, users should free to edit this file to customize certain environment variables:

1. Your declaration of the FREESURFER_HOME variable could be moved within the !SetUpFreeSurfer.csh script.

2. The default SUBJECTS_DIR, which is $FREESURFER_HOME/subjects, is most likely the first variable that you will want to customize, as you may keep different groups of subjects in different directories. You may include the following either directly in the !SetUpFreeSurfer.csh script, or prior to calling it:
Line 30: Line 79:
3. If you installed the MINC tools, then add the following lines to the additional configuration section: 3. If you installed a different set of MINC tools (a set is included in $FREESURFER_HOME/lib/mni), then add the following lines to the additional configuration section (for example):
Line 35: Line 84:
If you did not install the MINC tools, then add the following line in the local setup section: If you did not install the MINC tools (noting that it '''is''' required by Freesurfer's 'recon-all' script!), then add the following line in the local setup section:
Line 49: Line 98:
5. Save the file. You will need to source this file every time you want to use Freesurfer. 5. You may also wish to declare a path to an FSL installation you might have:
Line 51: Line 100:
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.      `setenv FSL_DIR /usr/local/fsl`
Line 53: Line 102:
To explicitly launch csh or tcsh (tcsh is recommended), simply enter the following command: 6. Save the file. You will need to source this file (!SetUpFreeSurfer.csh) every time you want to use Freesurfer.
Line 55: Line 104:
     `tcsh` == Testing FreeSurfer ==
Line 57: Line 106:
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 Set``Up``Free``Surfer.csh`

You should see output like this:

     `Setting up enviroment for Free``Surfer/FS-FAST`[[BR]]
     `FREESURFER_HOME /home/freesurfer`[[BR]]
     `FSFAST_HOME /home/freesurfer/fsfast`[[BR]]
     `AFNI_DIR /home/freesurfer/afni`[[BR]]
     `FSL_DIR /home/freesurfer/fsl`[[BR]]
     `SUBJECTS_DIR /home/freesurfer/subjects`[[BR]]

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 Set``Up``Free``Surfer.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).

'''Next:''' [wiki:Self:TestingFreeSurfer testing your FreeSurfer installation].

[wiki:DownloadAndInstall top] | [wiki:Installation previous] | [wiki:TestingFreeSurfer next]

FreeSurfer Setup and Configuration

Basic setup

Usage of C shell (csh) or enhanced C shell (tcsh) is recommended, although bash/sh scripts are also provided for the setup scripts. The shell type on your system can be checked by typing ps at the command line in a terminal window. To explicitly launch csh or tcsh (tcsh is recommended), simply enter the following command in a terminal window:

tcsh 

The prompt may change, and some login files may not be run in the new shell environment. See the man pages for tcsh for details.

If you do not have a preference for a particular shell, the default shell can be permanently switched to tcsh by typing the following:

chsh -s /bin/tcsh

The file <freesurfer_installation_directory>/!SetUpFreeSurfer.csh is a csh (C-shell) script that will configure the environment so that FreeSurfer can be used. It sets a few environment variables, sources other csh scripts to set up support libraries, and performs some checks that need to be passed before FreeSurfer can start. This file needs to be 'sourced' before running any FreeSurfer binaries.

To setup the tools to run, from a tcsh or csh, type:

setenv FREESURFER_HOME <freesurfer_installation_directory>/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.csh

Where <freesurfer_installation_directory> is replaced with the path of whereever you installed the distribution.

If using bash or sh, type:

setenv FREESURFER_HOME <freesurfer_installation_directory>/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.sh

Alternately, the resource file for the shell can be configured to source the file automatically each time the shell is started. In the home directory of the user who will be running FreeSurfer binaries, edit the file .cshrc if C-shell will be used, the .tcshrc for enhanced C-shell, the .bashrc file for Bash, and .profile for sh, to include the previous two lines (which setenv FREESURFER_HOME, and then source the SetUpFreeSurfer.csh(or sh) script).

Upon 'sourcing' the SetUpFreeSurfer.csh(sh) script, you should see output like this (assuming an installation path of /usr/local):

Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME /usr/local/freesurfer
FSFAST_HOME     /usr/local/freesurfer/fsfast
SUBJECTS_DIR    /usr/local/freesurfer/subjects
FUNCTIONALS_DIR /usr/local/freesurfer/sessions
MINC_BIN_DIR    /usr/local/freesurfer/lib/mni/bin
MINC_LIB_DIR    /usr/local/freesurfer/lib/mni/lib
PERL5LIB        /usr/local/freesurfer/lib/mni/lib/perl5/5.8.0
GSL_DIR         /usr/local/freesurfer/lib/gsl
QTDIR           /usr/local/freesurfer/lib/qt
TCLLIBPATH      /usr/local/freesurfer/lib/tcltktixblt/lib

If any warnings appear, it's usually safe to ignore them, but make sure that they are not stating that a file or directory that should exist cannot be found.

If any error messages appear, check that the installation process was successfully completed.

MINC toolkit perl path fix-up

Important!

Some of the MNI tools contain hard-coded paths to perl. To fix this situation, type:

fixup_mni_perl_path

Now the MNI tools will find the perl binary on your platform. You can confirm this by typing 'nu_correct', which should return version information (v1.10).

License

If you haven't done so already, [wiki:Registration obtain a license], and copy the .license file to your $FREESURFER_HOME.

Optional configuration settings

The defaults declared in the SetUpFreeSurfer.csh script should work for most installations. However, users should free to edit this file to customize certain environment variables:

1. Your declaration of the FREESURFER_HOME variable could be moved within the SetUpFreeSurfer.csh script.

2. The default SUBJECTS_DIR, which is $FREESURFER_HOME/subjects, is most likely the first variable that you will want to customize, as you may keep different groups of subjects in different directories. You may include the following either directly in the SetUpFreeSurfer.csh script, or prior to calling it:

  • setenv SUBJECTS_DIR <full path to subject dir>

3. If you installed a different set of MINC tools (a set is included in $FREESURFER_HOME/lib/mni), then add the following lines to the additional configuration section (for example):

  • 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 (noting that it is required by Freesurfer's 'recon-all' script!), 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. You may also wish to declare a path to an FSL installation you might have:

  • setenv FSL_DIR /usr/local/fsl

6. Save the file. You will need to source this file (SetUpFreeSurfer.csh) every time you want to use Freesurfer.

Testing FreeSurfer

Next: [wiki:TestingFreeSurfer testing your FreeSurfer installation].

SetupConfiguration_Linux (last edited 2015-08-24 15:23:06 by ZekeKaufman)