-------------------------------------------
funct (left-click): piecewise linear hand norm
  norm_allslices_toim2 <dir:0=PA,1=IS,2=LR>
-------------------------------------------
funct (mid-click): experimental local norm
 locnorm_allslices <rad> <0=med,1=histmx> <1=ed,2=im2>
-------------------------------------------


Piecewise linear hand normalization

Left-clicking the TEST button tests the effect of
piecewise linear norm (or sphere norm if "sph" is
checked) on using current values lim's, ffrac's
(dir=0 is Post/Ant, dir=1 is Inf/Sup, dir=2 is
Left/Right (radiological).

The normalized volume is written into the
comparison/non-saveable buffer (im2) for blink
comparison using COMPARE.  To normalize the
editable/saveable dataset in place, use the APPLY
button instead (norm_allslices).

A L-click on the "PieceWiseLInNorn" label brings
up a pop-up to control piecewise linear
brightness-dependent ramps in contrast (in
addition to L/R, I/S, or P/A position-dependent
ramps).  The $contrastnochange variable sets the
image value for no change; image values above and
below are linearly increased or decreased with
slope set by $contrastslope (default is 0.0,
which is brightness-dep contrast ramps OFF).


Alternate/Experimental functions

If the TEST button is middle-clicked, a different
tcl function is run:

  locnorm_allslices <rad> <0=med,1=histmx> <1=ed,2=im2>

This performs experimental local normalization
algorithms on the 3D data currently in the
editable buffer.  The normalized images go to
im2.  Middle-click COMPARE to swap editable and
im2 in order to save them.

These routines are multi-threaded (8 threads) and
may cause an increase in CPU fans speed.

Parameters:

  operation = 0 (3D median)

    $prad (radius in pixels)
    $white_lolim (low cutoff brain)
    $white_lolim (hi cutoff brain)

  operation = 1 (3D hist max)

    $prad (radius in pixels)
    $white_lolim (low cutoff brain)
    $white_lolim (hi cutoff brain)

Voxel target value is average brain value between
$white_lolim and $white_lolim.

These are designed for ex vivo samples.  The
freesurfer normalization works better for
standard human brain scans.
