-------------------------------------------
Standard tcl script: phasemovie.tcl
-------------------------------------------

The phasemovie.tcl script colors a small range of
phases white (default: 0.03=3%) and saves a
bitmap for each step (default: 50) of varying the
phase of the center of the white stripe between
selected phase limits (default: 0->1, which means
0->2Pi).

To reverse the order of the phase progression
(e.g., lower-to-upper vs. upper-to-lower for
polar angle data), swap $phasemin and $phasemax.

If the desired range of phases wraps around 1.0,
use a number above 1.0 for $phasemax.  Thus
phasemin=0.75 and phasemax=1.30 will show phases
from 0.75 to 1.0 followed by 0.0 to 0.30 (these
can be reversed as above).

The current brain pose and the color scale
settings are preserved underneath the moving
white phase contour.  This is essentially an
animation of successive isocontour lines in the
color phasemap.  It makes small variations in
phase much more apparent than color variation
alone does.

The default color of the white phase stripe (255)
can be controlled with phasecontour_bright
(0-255).  Setting colphasecontourflag to 1
inverts the coloring scheme -- the phase stripe
is now colored (with its usual phase color) and
the remainder of the activation that is not at
that phase is given the same color controlled by
phasecontour_bright.  To make the moving colored
phase stripe visible, use a dark color for the
overall activation (e.g., phasecontour_bright =
20; autoset when colphasecontourflag ticked).

By default, the frames are saved with verbose
names.  There is an option to convert the frames
to an mpeg1 and delete the individual frames, and
an option to write frames with simple number
names (e.g., better for making H.264-compressed
mp4, e.g., with QuickTime 7 Pro: File -> Open
Image Sequence...) or with ffmpeg.  Here is an
example ffmpeg cmdline:

  ffmpeg \
    -v 0 \
    -f image2 \
    -r 20 \
    -i f*.tiff \
    -vcodec libx264 \
    -pix_fmt yuv420p \
    out.mp4

Finally, there is an option (dontsaveframes = 1)
to not save anything (one-time view for test).

To run this as a standalone script from the
command line, add a few lines at the top
(commented-out example in script) to first load a
data set.
