------------------------------------------------
 Csurf -- cortical surface program manager
------------------------------------------------
The database consists of two main directories:

(1) the subjects tree (e.g., /usr/subjects)
    setenv SUBJECTS_DIR <whatever>

  Permanent home of structural MRI data, filtered
  MRI data, and folded, unfolded, and flattened
  surfaces for subjects.  The startup value of
  this must be set with:

    setenv SUBJECTS_DIR <whatever>

  The directory (database) name for each subject
  is typically a first name plus last initial
  (e.g., martys).  The root of the subjects tree
  can be interactively changed with csurf.

(2) functional sessions tree (e.g., /usr/fspace)
    setenv FUNCTIONALS_DIR <whatever>

  Directory containing individual functional
  sessions.  The startup value of this must be
  set with:

    setenv FUNCTIONALS_DIR <whatever>

  A session is defined as a set of scans taken
  with one subject, in one position, in one RF
  coil.  Individual sessions can be saved
  anywhere.  The name for a session is a date,
  then initials.  The date is in year/month/day
  order so 'ls' will sort a bunch of them
  chronologically (e.g., 000624MS).  The root of
  the sessions tree can be interactively changed
  with csurf.

Each functional session directory (e.g.,
000624MS) is associated with a single subject
directory (e.g., martys).  However, several
different sessions may point to the same
subject.

Csurf generally runs programs from the "scripts"
subdirectory inside the currently selected
session or subject.  A flat file of current
configurations--csurf.dat--is stored there.  It
is read by csurf on entering that session or
subject and written when you press SAVE on one of
the csurf configuration panels.  This is also the
directory in which ASCII notes are conventially
made.  There are menu items under File to
automatically open the current subject or
session's NOTES file in a text editor to
encourage this practice.

There are two main sets of menu items,
SubjectTools and SessionTools for manipulating
the two main directory trees.  The menu items
within each one are arranged in the order in
which they are normally run.

The general procedure is to first reconstruct a
surface.  Once a surface has been reconstructed,
individual functional sessions can be associated
with it, and statistics can be calculated in 3D
or on the surface, and then rendered.

Log View

As csurf runs command line programs in the
background, it pipes their outputs into a log.
These outputs can be viewed at any time with
Preferences -> View Logs (Alt-l).  There are
three logs--one for medit, one for surfer, and
one for command line programs.  When you quit
csurf, the entire contents of the log is saved
into a file in scripts dir:  csurf.log

User Setup

Individual users need at minimum, 4 lines that
look like this in their .cshrc files:

 setenv CSURF_DIR        /usr/local/FreeSurfer0.8
 setenv SUBJECTS_DIR     ~/subjects
 setenv FUNCTIONALS_DIR  ~/fspace
 source $CSURF_DIR/FreeSurferDefs.csh

Other useful aliases:

 # cd to subj/session scripts dir w/just name
 alias cds 'cd $SUBJECTS_DIR/\!*/scripts; ls'
 alias cdf 'cd $FUNCTIONALS_DIR/\!*/*/scripts; ls'
 alias surfdoc \
  'acroread $CSURF_DIR/docs/FreeSurferManual.pdf'

