variable: $hardstatfthreshflag -- thresh behavior
default: 0 (FALSE)

This checkbutton has no effect unless stat mask
is enabled (stat data read, "ms" clicked).

When hardstatfthreshflag is 1 (clicked), the
amplitude of currently displayed data (either
real-valued or complex-valued amplitude) is
hard-thresholded to the background color if the
current value of the .stat field at a vertex is
below the value of $sfthresh there ($sfthresh
currently mirrors $fthresh).

When hardstatfthreshflag is 0 (unclicked,
default), in order for the stat mask to fade
activations smoothly into the background color,
the amplitude of the vertex is passed through a
second tanh sigmoid so that the midpoint of the
sigmoid occurs at $sfmid.  In this condition, the
value of sfmid is controlled by "fthresh".  That
is, the *data* amplitude sigmoid midpoint is set
by "fmid" and the stat sigmoid midpoint is set by
"fthresh".  In the limit of high $sfslope values
(which currently mirror $fslope), the soft
threshold is equivalent to the hard threshold.

Implementation details

There are two sets of tcl variables that control
the tanh sigmoids for the data amplitude and
the stat mask:

Overlay data tanh sigmoid controls:

  fthresh   amp hard threshold
  fmid      amp midpoint sigmoid (soft thresh)
  fslope    amp slope sigmoid

Stat mask tanh sigmoid controls:

  sfthresh  statmask hard threshold
  sfmid     statmask midpoint sigmoid (soft thr)
  sfslope   statmask slope sigmoid

Currently, if hardstatfthreshflag is set,
sfthresh mirrors fthresh.  If hardstatfthreshflag
is unset, sfthresh is set to 0 and sfmid mirrors
*fthresh* (a little awkward semantically, but
convenient).  The value of sfslope mirrors fslope
in both states.

Here is the actual per-vertex C-code that does
the 1st and 2nd squash for the stat mask case,
where x, y, and stat are the real, imaginary, and
stat values at each vertex:

  /* get complex amplitude */
  f = sqrt(x*x + y*y);

  /* convenient hack */
  sfslope = fslope;
  if (hardstatfthreshflag) {
    sfthresh = fthresh;
    sfmid = fmid;
  }
  else {
    sfthresh = 0.0;
    sfmid = fthresh;
  }

  /* hard threshold */
  if (stat<sfthresh) return; /* set BG */

  /* first squash */
  if (fslope!=0.0)
    f = (1.0 + tanh(fslope*(f-fmid)))/2.0;

  /* second squash */
  if (statmaskampflag &&
      !hardstatfthreshflag &&
      sfslope!=0.0)
    f =f*(1.0 + tanh(sfslope*(stat-sfmid)))/2.0;

  /* use f to set color saturation */
  ...
