-------------------------------------------
funct (left-click): paint "im:" data to .val on surf
  direct_paint
-------------------------------------------

A left-click on the "P" button on the "im:" entry
line (large F3 interface) does a "direct paint"
(C/tcl funct: direct_paint) of the current "im:"
data into the .val field of the current surface.

This requires first loading a 3D data set using
"R" button on the "im:" line.

No transformation matrix is used, so this assumes
that the 3D data loaded is aligned with the
the samping surface ($wmgmext).

This function uses the following parameters to
sample the 3D data to the current surface:

  normdfracflag		0=mm, 1=fraction (def=0)
  normdsamp		dist along normal in mm (def=1.0)
  normdfracsamp		fraction cortical thickness (def=0.4)
  wmgmext		sampling surface (def=orig)

To adjust these parameters interactively, click
"label:" to get a popup.  All other parameters on
that pop-up besides the four above are ignored.

To sample inward (e.g., from the pial surface),
use a negative number for normdsamp (mm) or
normdfracsamp (fraction).

The .val data field can be scaled in place with
the C/tcl function:

  scale_val <scalefact>

To load complex-valued data, use the same
strategy as with read_binary_values -- "R" to
load imaginary 3D data first, "P" to paint it to
.val, middle-click "S/V", to swap it out of the
way to .val2, "R" to load real 3D data, "P" to
paint to it .val.

In a tcl script this would look like:

  setfile inim ~/mri/real.mgz
  read_images
  direct_paint
  swap_val_val2
  setfile inim ~/mri/imag.mgz
  read_images
  direct_paint
