#############################################################################
Installation notes for FreeSurfer0.9 FIRST INSTALL (alpha) - September, 1999
#############################################################################
FreeSurfer is copyright (c) CorTechs, 1999. All rights reserved.

FreeSurfer is being distributed with executables for both Linux/Intel and
SGI/IRIX. This is an alpha release and has not been extensively tested.

These are instructions for a full installation of FreeSurfer, including
binaries for both Linux and IRIX, average data, and demo data sets.

1) Choose directory for install.  A standard install directory is /usr/local
   (you have to be root to install there), but FreeSurfer can be installed
   anywhere.  The install procedure makes a single subdirectory inside your
   chosen install directory that will be named FreeSurfer0.9.  It *only* puts
   stuff inside the FreeSurfer0.9 subdirectory.  The examples below show
   how to install things in /usr/local, but you could replace "/usr/local"
   in the examples below with any other directory (e.g., the user's home
   directory).

2) Get the distribution (CDROM or ftp file) and unpack it in the install
   directory:

   Install from CDROM (example assumes CDROM mounted at /CDROM):

      [mount CDROM]
      cd /usr/local
      gnutar xvfz /CDROM/FreeSurfer0.9.tgz
      [or: gunzip -c /CDROM/FreeSurfer0.9.tgz | tar xvf - ]

   Install from FTP (example assumes file ftp'd to /tmp):

      ftp://zakros.ucsd.edu/pub/flat/FreeSurfer0.9.tgz  (97M compressed)
      cd /usr/local
      gnutar xvfz /tmp/FreeSurfer0.9.tgz
      [or: gunzip -c /tmp/FreeSurfer0.9.tgz | tar xvf - ]

   The uncompressed size of this installation is about 360 Meg (98 Meg
   of code and 261 Meg of average and demo data).

3) Obtain free license file from Cortechs by registering at
   http://www.cortechs.net.  A license file and instructions for where
   it should be placed will be emailed to you.  Save license email and
   copy the 3 necessary lines from it into a file in the installed
   FreeSurfer directory that is named ".license":

      edit /usr/local/FreeSurfer0.9/.license

   The three lines in the .license file should look something like this:

      user@somemachine.edu
      031-2345-126
      *FsWxW.aeSaxA

4) If you were root, exit so that you are a regular user, and then add
   these two lines to the end of your .cshrc file (must come *after* the
   variable $path has been set).  Each new user will have to add at least
   these 2 lines, in this order, to their .cshrc:

      setenv CSURF_DIR /usr/local/FreeSurfer0.9
      source $CSURF_DIR/FreeSurferDefs.csh

   The FreeSurferDefs script sets environment variables and adds to the
   user's path.  The environment variables SUBJECTS_DIR and FUNCTIONALS_DIR
   are set by default to the demo Subjects and demo Sessions directories,
   which initially sit inside the distribution.  You can change subjects
   or sessions directories in the interface.  Or you can make the interface
   start up with different defaults by setting these variables explicitly
   in your .cshrc file like this:

      setenv CSURF_DIR         /usr/local/FreeSurfer0.9
      setenv SUBJECTS_DIR      /somewhere/else/MySubjects
      setenv FUNCTIONALS_DIR   /somewhere/else/MySessions
      source $CSURF_DIR/FreeSurferDefs.csh

5) Make sure you are running csh or tcsh, and then source your new .cshrc
   file to make the new definitions take effect.  (Note: this will be done
   automatically next time you login):

      source ~/.cshrc

   The only other time you should ever have to source your .cshrc manually
   is if you change the value of CSURF_DIR after having logged in.

6) Start up the main interface (from any directory):

      csurf &

   The csurf interface should appear at the upper left after a few seconds.
   For help with diagnosing problems (e.g., missing/faulty license file),
   you can set 'View Log Files' in the Preferences menu.

#############################################################################
Installation notes for FreeSurfer0.9 CODE-ONLY (update or first install)
#############################################################################
To install/update FreeSurfer code-only:

1) Choose directory for install, mount CDROM (or ftp file), change to
   installdir, and unpack distribution.  Procedure makes a new directory,
   FreeSurfer0.9, in chosen install directory, and puts all files inside
   FreeSurfer0.9. To save download time, the distributions are
   architecture-specific.  Example is for IRIX (for Linux/Intel version,
   replace "IRIX" with "Linux").  The examples below show how to install
   things in /usr/local, but you could replace "/usr/local" in the examples
   below with any other directory (e.g., the user's home directory).

   Install from CDROM (example assumes CDROM mounted at /CDROM):

      [mount CDROM]
      cd /usr/local
      gnutar xvfz /CDROM/FreeSurfer0.9.nodata.IRIX.tgz

   Install from FTP (example assumes file ftp'd to /tmp):

      ftp://zakros.ucsd.edu/pub/flat/FreeSurfer0.9.nodata.IRIX.tgz (20Meg)
      cd /usr/local
      gnutar xvfz /tmp/FreeSurfer0.9.nodata.IRIX.tgz

   The uncompressed size of single architecture code-only installation is
   about 70 Meg. 

2) If you were root, exit so that you are a regular user and update
   definition of CSURF_DIR in .cshrc:

      setenv CSURF_DIR /usr/local/FreeSurfer0.9
                                            ^^^
   Source your updated .cshrc (first time only)

      source ~/.cshrc

3) If this is an update: move, copy, or link the demo and average data dirs
   (same for both Linux and IRIX) not included in this distribution to new
   CSURF_DIR (N.B.: these occupy 260M uncompressed).  Replace <old_CSURF_DIR>
   with the full path name of the old installation:

      [mv]/[cp -r]/[ln -s]  <old_CSURF_DIR>/average  $CSURF_DIR/average
      [mv]/[cp -r]/[ln -s]  <old_CSURF_DIR>/Subjects $CSURF_DIR/Subjects
      [mv]/[cp -r]/[ln -s]  <old_CSURF_DIR>/Sessions $CSURF_DIR/Sessions

   If this is a initial installation, you need to separately download
   and install the average data set (for 3D and surface-based morphing),
   and optionally, the demo data sets.

#############################################################################
Installation notes for FreeSurfer0.9 AVERAGE DATA and DEMO DATA
#############################################################################

1) Change to CSURF_DIR directory, mount CDROM (or ftp file), and unpack
   distribution. This makes three new directories in CSURF_DIR: "Subjects",
   "Sessions", and "average" (if not already there) and writes into them.
   If directories exist, files in them with same name as files in this
   distribution will be overwritten/updated.

   This assumes you have already installed FreeSurfer code (with or without
   data), and that environment variable CSURF_DIR is set to the FreeSurfer
   directory.

   Install from CDROM (example assumes CDROM mounted at /CDROM):

      [mount CDROM]
      cd $CSURF_DIR
      gnutar xvfz /CDROM/average.tgz
      gnutar xvfz /CDROM/DemoSessSubj.tgz 

   Install from FTP (example assumes file ftp'd to /tmp):

      ftp://zakros.ucsd.edu/pub/flat/average.tgz       (21M compressed)
      ftp://zakros.ucsd.edu/pub/flat/DemoSessSubj.tgz  (37M compressed)
      cd $CSURF_DIR
      gnutar xvfz /tmp/average.tgz
      gnutar xvfz /tmp/DemoSessSubj.tgz

   The total uncompressed size of this installation is about 260 Meg.

