-------------------------------------------
 The SubjectTools -> Make Final Surfaces (hi-
 res) menu item a starts a background process to
 create the final left and right hemisphere
 cortical surfaces and calculate cortical
 thickness.
-------------------------------------------
This can either use the MGH facilities
(mris_make_surfaces) or a tcl script that
controls tksurfer (see Preferences -> Expert
Preferences -> Final tab) ($CSURF_DIR/lib/tcl/
pialwhitethk.tcl).

(1a) Make Final Right Hemisphere Surfaces
(1b) Make Final Left Hemisphere Surfaces

The input files required are:

 volume: $SUBJECTS_DIR/$name/mri/brain[.mgz]
 volume: $SUBJECTS_DIR/$name/mri/wm[.mgz]
 volume: $SUBJECTS_DIR/$name/mri/filled[.mgz]
 surface: $SUBJECTS_DIR/$name/surf/rh.orig
 surface: $SUBJECTS_DIR/$name/surf/lh.orig

The tksurfer tcl script may also use a T2* scan:

 volume: $SUBJECTS_DIR/$name/mri/T2s[.mgz]

The output files written by this procedure are:

 surface: $SUBJECTS_DIR/$name/surf/rh.white
 surface: $SUBJECTS_DIR/$name/surf/rh.graymid
 surface: $SUBJECTS_DIR/$name/surf/rh.pial
 vtxdata: $SUBJECTS_DIR/$name/surf/rh.thickness

 surface: $SUBJECTS_DIR/$name/surf/lh.white
 surface: $SUBJECTS_DIR/$name/surf/lh.graymid
 surface: $SUBJECTS_DIR/$name/surf/lh.pial
 vtxdata: $SUBJECTS_DIR/$name/surf/lh.thickness

Cortical thickness algorithm (mris_thickness)

 (1) foreach vertex -> search opposite surface

   (a) pick pial surface vertex
   (b) find distance to same-numbered
          vertex in white matter surface
   (c) find neighbors of same-numbered
          white matter vertex
   (d) check distance from pial surface
          vertex to neighbors, too
   (e) find minumum distance of all these pairs

 (2) foreach vertex -> same search inverted

   (a) pick same-number white matter surface vertex
   ... search neighbors on pial as above

   Since surfs same topo, needn't re-find neighbors

 (3) average results of two above

Note that this doesn't refer to the normal,
which is only used to calculate a dot product
to determine if it is pointing in or out.
