-------------------------------------------
funct (left-click): fill 3D ROI around cursor
  fill_roi
-------------------------------------------
funct (middle-click): clear FILL
  clear_rois
-------------------------------------------
funct (shift-left-click): volume current ROIs
  vol_rois
-------------------------------------------


Detailed Description FILL button

A default left-click of the FILL button performs
a region-growing 3D fill starting from the
current cursor location and filling all connected
points that also pass one of 4 following
criteria.  The criteria are described in order of
precedence.

Criterion: SegID (SegID at last click)

If a 3D annotation file has been loaded and "la"
($imtolutoverlay) is checked, the criterion is
that the connected points must have the same
SegID as the SegID at the last click.

Criterion: Mask Threshold ($sfthresh)

If both a stats/amplitude overlay as well as a
mask overlay has been loaded, and "overlay"
checkbox ($overlayflag) as well as the mask
checkbox ($overlaymaskflag) on the mskn/mskup
line are both checked, the criterion is that the
connected points must must have a mask value
above the current setting of $sfthresh (the
second entry labeled "thr").

This will ignore the value of the real or complex
overlay itself.

Criterion: Stat/Amplitude Threshold ($fthresh)

If a stats/amplitude overlay has been loaded and
"overlay" is checked (and the mask checkbox and
"la" are both *unchecked*), the criterion is that
the connected points must be above the current
setting of $fthresh.

If the data currently displayed is complex, the
complex amplitude of the data is compared to
$fthresh.

Criterion: Anatomical Underlay Limits (WMTRUNC)

If "overlay", the overlay mask tickbox, and "la"
are all *unchecked*, the criterion is instead
that the connected points must have an *underlay*
value between the limits set in the two entries
just to the right of WMTRUNC ($white_lolim,
$white_hilim).

AND Criterion: Maximum Radius ($fillrad)

This applies (logical AND) to whichever of the
above is being used.  If the entry to the right
of FILL is set above 0.0, the fill region (stat
threshold *or* mask threshold *or* WMTRUNC
anatomical limits) will also be contrained not to
go beyond this radius (in mm) from the cursor
seed point.

AND Criterion: Edit Cuts

To further constrain a FILL (another logical
AND), use temporary right-click edits (to black)
of the underlay image, which will be respected
in addition to the optional maximum radius).

Appending a Region to an Existing FILL

If the current FILL has not been cleared (see
below), you get a pop-up option to append a
region to it by clicking on a new seed point in
the volume and clicking FILL again.  The pop-up
also gives you the option to clear first, in
order to make a new FILL.

Saving and Using an ROI Mask

The resulting fill ROI mask (0,1) can be written
out as a 256x256x256 AFNI BRIK using the "W"
button on the "roi:" line in the middle of the
panel.  Once saved, it can be used to mask
overlay data (see "m" checkbutton help) or to
extract raw data timecourses (see "T" button help
on "roi:" line).

-------------------------------------------
Alt funct (middle-click): clear FILL
  clear_rois
-------------------------------------------

To clear the current FILL, use middle-click on
the FILL button.  (N.B.: this will not restore
any edits-to-black -- to restore those, re-read
the underlay image using "R" on the fn-F1
interface "im:" line).

-------------------------------------------
Alt2 funct (shift-left-click): volume current ROIs
  vol_rois
-------------------------------------------

A second alternate shift-left-click on the FILL
button measures the volume of the currently
FILL'ed ROIs in mm^3.  The result is written to
the log, shown in a popup, and also written to
$genstrret_1k (so it can be used in a tcl
script).

