-------------------------------------------
 The SubjectTools -> Strip Skull (hi-res) starts
 a two-part background process to generate a T1
 image of just the brain (incl cerebellum and
 brainstem).
-------------------------------------------
An elliptical surface (4th or 5th geodesic
subtessellation of an icosahedron) is inflated
from the inside of the brain looking for the
first dark surface it finds -- typically the CSF
and/or the inner table of bone of the skull.

The set of voxels that intersect faces of the
resulting surface is then flood filled from the
outside.  The data set to be stripped (typically
T1-weighted) is read in the flood-filled voxels
are used to set the corresponding voxels in that
dataset to zero.

The preferred input is the "PD" data set but
"orig" is tried if it is not found:

 input3D: $SUBJECTS_DIR/$name/mri/PD[.mgz]
    or, if above not found:
 input3D: $SUBJECTS_DIR/$name/mri/orig[.mgz]

 output3D: $SUBJECTS_DIR/$name/mri/brain[.mgz]

Four Adjustable Parameters

"fzero" sets the point at which the outward force
the surface goes to zero.  Decreasing this
decreases the amount of erosion.

Increasing "fmax" decreases the the amount of
erosion.

"dfrac" sets the starting surface diameter as a
fraction of the brain (defineds as voxels
brighter than 50).  This should be entirely
within the brain to avoid getting the surface
"hung up" on the skin.

"istilt" sets an inside stilt height (where the
data set is sampled relative to the surface,
measured along the inward surface normal at each
vertex).

Multi-stage user-editable tcl script

If "use tkstrip tcl script instead" is chosen, a
more complex, user-editable multi-stage procedure
is used:

  $CSURF_DIR/lib/tcl/stripskullPD.tcl

but any other script can be used instead if an
absolute path name is used, or if another script
is placed in $CSURF_DIR/lib/tcl.

The stripskullPD.tcl script requires two inputs
data sets, "orig" and "PD".  A surface is
inflated from inside the "PD" data set to find
the edge of the brain, and a skull-stripped data
set "PDbrain" written out.  This data set is then
used to strip the the skull from the "orig" data
set to generate the "brain" data set.

Rationale

This procedure was devised for quantitative T1
data, which has a lot of noise in the skull.  The
skull is normally dark in a T1-weighted scan
since there is very little signal from the skull
because of the ultra short T2 there.  However,
this results in a noisy quantitative T1 estimate.

