#### read rawdata timeseries (or DTi) & registration ####
-------------------------------------------
functs (left-click): read raw data
  read_regdat
  read_rawdata
  rawdatasubbrik_to_paintable <frame>
-------------------------------------------

A default left-click on the "RD" button on the
"val3d:" entry line opens a pop-up to allow
reading a raw data BRIK ($rawdata, can select
from the "val3d:" dropdown, which contains all
BRIKs in current scandir), and a local
register.dat ($regdat).

Clicking the first button at the bottom of the
popup, "READ RAWDATA and REGISTRATION", reads the
data and registration into memory buffers, so
other functions (e.g., "val3d:" line "V"
(vectors) or "label:" line "T" (time) and "S"
(stat) and "X" (covar)) can do something with the
data.

Some examples of rawdata BRIKs include:

 (1) fMRI time-course series (typically short data)
 (2) 21-volume output of AFNI 3dDWItoDT (float data)

The startup values of $regdat and $rawdata will
typically be initialized by csurf.

If tksurfer is started using the csurf SURFACE
button on the main csurf panel, first use the
"session:" and "scandir:" dropdowns at the right
to pick the desired scandir.  The isession entry
($FUNCTIONALS_DIR/$session/image) is readonly, so
restart tksurfer if it is wrong).

If tksurfer is started using the SURFACE-STATS
button from a SessionTools -> View Functional
Data panel, the initial $regdat and $rawdata will
come from the selected $scandir in the current
panel.

To (re-)set the startup values of $regdat and
$rawdata in a tcl script, use "set" or "setfile"
(a globbing set), before calling the read
functions, for example:

  setfile regdat */some_scandir/register.dat
  read_regdat
  setfile rawdata */some_scandir/some_rawdata+orig.BRIK
  read_rawdata

where "*" is an abbreviation for the "image"
subdir of the current functional session.

The second button, "MAKE FIRST VOL PAINTABLE (for
uniq)" reads the first frame of rawdata into the
paintable (float) buffer so that the data can be
sampled to the surface by the "PA" (PAINT) button
on the "val3d:" line.  After sampling to the
surface, the unique sample vertices (for each
voxel, a 'representative' vertex for all the
vertices that sampled that 3D voxel) can be
calculated with the "UQ" button on the "val3d:"
line.

The "make paintable" operation is automatically
done when a stats volume is read with the "R"
button on the "val3d:" line.  It is not done for
(typically short integer) rawdata, since you
usually do not want to display a rawdata frame on
the surface, and so is only needed for the find
unique vertex operation, cases where you might
not have already loaded a native resolution 3D
stat file (on which the unique-ing operation can
also be done).

