-------------------------------------------
Standard tcl script: searchlightdiff.tcl
-------------------------------------------

This script runs full-hemisphere searchlight
operations on two sets of real-valued data and
then subtracts the first result from the second.

Running it interactively from the "tcl:" script
dropdown in csurf first generates a pop-up to
adjust parameters.  Clicking "RUN SCRIPT" on the
pop-up first runs the searchlight operations:

  Searchlight operations:

    0 -> average of searchlight data
    1 -> count num classes (assumes integer data)
    2 -> variance of searchlight data
    3 -> [not relevant: neighop_val2stat paintballs]
    4 -> sum each searchlight

and writes out the result of the seachlight
operation as two vertewise labels.  These
multithreaded operations take about 10
min/hemisphere on an Intel i7.

Then, the first searchlight result is subtracted
from the second searchlight result and saved as a
third vertexwise label (with a verbose name
indicating its origin).

The size, ${num,sqmm,mm}, of the approximately
geodesic surface searchlight circles can be
specified by vertex count (num), area (mm^2),
radius (mm), or by neighbor order (1=immediate
neighbors, 2=also include neighbors of neighbors,
etc):

  Searchlight size ($fillneartype):

    0 -> num vertices
    1 -> area (in mm^2)
    2 -> radius (in mm)
    3 -> neighbor order (1-6)

The first three searchlight size specifications
($fillneartype) use the C/tcl function,
searchlightop_val2stat (multi-threaded), while
the fourth specification uses the C/tcl function,
neighop_val2stat (similar result for similar
vertex count, goes up to 6th-order neighbors,
which is 127 vertices on fsaverage).

Adjustable parameters can be hard-coded in this
script (see commented-out example inside) in
order to run it non-interactively from the
command line as a tksurfer tcl script.

To kill a running script, kill tksurfer either
using its window kill buttons, or the purple
"QuitSURFA" button on csurf (the purple "RUNNING"
button on script popup window cannot kill the
script).
