-------------------------------------------
funct (left-click): wmfilter on editable
  run_wmfilter stdtrunc to_buf1
-------------------------------------------
funct (mid-click): wmfilter on editable -> im2
  run_wmfilter stdtrunc to_buf2
-------------------------------------------


Detailed Description PF button

This button calls the tcl function run_wmfilter:

  run_wmfilter <operation> <targbuf>

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

The source data is the current state of the
editable buffer.  The truncation settings are
taken from the entries just to the right of the
TRUNC button (tcl variables: $white_lolim and
$white_hilim) and the gray matter setting from
the entry to the right of the PF button (tcl
variable: $gray_hilim).

The  wmfilter binary implements an anisotropic
filter that searches directions in the 5x5x5 or
7x7x7 volume around each voxel for the plane of
least variance, then does a median-like filter in
that plane to "floss" and "spackle" white matter
segmentations.  The size of the volume is
controlled by the value in the unmarked left
entry under the SMOOTHSTRUCT button in the fn-F2
interface (default=5).  7x7x7 takes three times
as long as 5x5x5.

The wmfilter binary is multithreaded (8 threads)
and may cause processor fans to run faster.

The data is truncated (set by $white_lolim,
$white_hilim) before (and after) the anisotropic
filter operation.  The value of $gray_hilim
adjusts a second truncation of gray matter based
on the fraction of zeros in the 5x5x5 or 7x7x7
volume.

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

A default left-click loads the result back into
the editable buffer.

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

 <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 (middle-click):
  run_wmfilter stdtrunc to_buf2
-------------------------------------------

An alternate middle-click on the PF button puts
the output of the planefilter instead into the
im2 buffer so that left-click COMPARE can be used
for blink comparison with the original data.

N.B.: the data in the im2 buffer can't be saved
directly.  However, it can be saved after a
middle-click on the COMPARE button, which swaps
the contents of the editable and im2 buffers.


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

See PFGAU help for description of a Gaussian
version of the 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

