-------------------------------------------
funct (left-click): Gauss wmfilter on editable
  run_wmfilter gauss to_buf1
-------------------------------------------
funct (mid-click): Gauss wmfilter editable -> im2
  run_wmfilter gauss to_buf2
-------------------------------------------
funct (shift-left-click): Gauss/trunc wmfilter
  run_wmfilter gausstrunc to_buf1
-------------------------------------------
funct (shift-mid-click): Gauss/trunc wmfilter -> im2
  run_wmfilter gausstrunc to_buf2
-------------------------------------------


Detailed Description PFGAU button

This button calls the tcl function run_wmfilter:

  run_wmfilter <operation> <targbuf>

where operation is "gauss" or "gausstrunc" and
targbuf is either "to_buf1" or "to_buf2".  The
tcl function runs the standalone C binary,
wmfilter.

The source data is the current state of the
editable buffer.  The width of the Gaussian
filter is set by two entries (tcl variables:
$kcnt and $kfwhm) on either side of "fwhm:" (on
[fn]-F2 interface under the SMOOTHSTRUCT button).

N.B.: the PFGAU operation is 5-10x slower than
the PF operation.

N.B.: the only currently allowed $kcnt values are
5 (default) and 7 (2.7x slower).

The wmfilter binary implements an anisotropic
filter that searches directions in the 5x5x5 (or
7x7x7, three times slower) volume around each
voxel for planes of least variance, then does a
2D convolution with a normalized Gaussian in the
min var plane.

This smooths data sets parallel to locally planar
features such as the cortical surface or the
surface of a brainstem nucleus.  This preserves
the location and visibility of boundaries much
better than an equivalant width 3D Gaussian
filter (SMOOTHSTRUCT button).

-------------------------------------------
funct (left-click): Gauss wmfilter on editable
  run_wmfilter gauss to_buf1
-------------------------------------------

With a default left-click, the PFGAU operation
does no truncation (the values of $white_lolim,
$white_hilim, and $gray_hilim are ignored).

To save the result, go to the [fn]-F1 interface
and use "W" on the "im:" line.  The default
filename (which can be changed) will be:

 <original-editable-file>-pf.mgz  (mgz file)
        *or*
 <original-editable-file>-pf        (CORdir)

To undo, alt/cmd-z in image window (or tools
window).

-------------------------------------------
Alt funct (mid-click): Gauss wmfilter editable -> im2
  run_wmfilter gauss to_buf2
-------------------------------------------

To instead put the output of the Gaussian
planefilter into the im2 buffer so COMPARE can be
used for blink comparison with the original data,
use a middle-click on PFGAU instead of a
left-click.

N.B.: the data in the COMPARE buffer can't be
saved (unless first swapping it with the editable
buffer using a middle-click on the COMPARE
button).

-------------------------------------------
Alt2 funct (shift-left-click): Gauss/trunc wmfilter
  run_wmfilter gausstrunc to_buf1
-------------------------------------------

To truncate the output of the full Gaussian
planefilter using the current TRUNC settings, use
Shift-left-click (modify editable).

To undo, alt/cmd-z in image window (or tools
window).

-------------------------------------------
Alt3 funct (shift-mid-click): Gauss/trunc wmfilter -> im2
  run_wmfilter gausstrunc to_buf2
-------------------------------------------

To do the same but put the output in im2,
Shift-middle-click the PFGAU button.


-------------------------------------------
Trunc/PlaneFilter Summary:
-------------------------------------------

See PF help for description of original
planefilter, and TRUNC help for reversible
truncation of display (for viewing) or truncation
of editable data (for saving).

To speed up these 3D convolution operations,
voxels surrounded by a 5x5x5 (or 7x7x7) voxel
volume with values all less than 5 (near black)
are not modified.

The filter may underperform at locations where a
thin 1D stalk or a thin 2D wall attaches to a
large plane.


 Left-click TRUNC -- toggle tmp Trunc editable,COMPARE
 Middle-click TRUNC -- Trunc editable in place

 Left-click PF -- WmFilter+Trunc editable in place
 Middle-click PF -- WmFilter+Trunc to COMPARE

 Left-click PFGAU -- GaussFilter editable in place
 Middle-click PFGAU -- GaussFilter to COMPARE

 Shift-Left-click PFGAU -- Gauss+Trunc editable in place
 Shift-Middle-click PFGAU -- Gauss+Trunc to COMPARE

