-------------------------------------------
select output labelfile coords-type (left-click):
  $usetalrcoordsflag -- toggle orig vs. Talairach surf coords
  $usecurrcoordsflag -- toggle orig vs. curr surf coords
  $xform_mni_305to152_flag -- toggle MNI 350 vs. 152
-------------------------------------------

The "| ta | cu |" selection bar controls which
x,y,z coordinates are used when writing any
subsequent label files (e.g., using a left-click
on the "W" button on the "label:" line).  There
are 3 possibilities:

  1) .orig surface vtx coords (default: "ta" and "cu" both off)
  2) Talairach coordinates ("ta" selected/depressed)
  2) current surface coordinates ("cu" selected/depressed)

N.B.: The exact coordinates saved in a label file
are also affected by $normdsampsearchflag (ON by
default), which moves along the local vertex
normal to specify a point within the gray matter.
R-click the "label:" label to get a popup to
adjust the parameters of this (small) movement.

N.B.: Regardless of the state of the "ta" button,
*both* MNI 305 coordinates as well as MNI 152
coordinates are always reported to the log when
clicking SEND.

-------------------------------------------
default=.orig: (both "ta" or "cu" not depressed)
  set usetalcoordsflag 0
  set usecurrcoordsflag 0
  [set xform_mni_305to152_flag 0]
-------------------------------------------

By default, the $origcoords file (typically
$hemi.orig) is read to find x,y,z coordinates
to write into the label file, regardless of
which surface is currently being viewed 
(e.g., $hemi.inflated, or a flat patch).

This will typically be a point near the
gray/white matter border.

-------------------------------------------
Talairach: ("ta" depressed, "cu" not depressed)
  set usetalcoordsflag 1
  set usecurrcoordsflag 0
  set xform_mni_305to152_flag 0 -> MNI 305
  set xform_mni_305to152_flag 1 -> MNI 152
-------------------------------------------

Clicking/depressing "ta" causes the .orig surface
x,y,z coordinates to be first converted to MNI
Talaiarch coordinates, which are then put as the
x,y,z coordinates into any subsequently written
label file.

A popup allows choosing MNI 305 (default,
$xform_mni_305to152_flag=0) vs. MNI 152
($xform_mni_305to152_flag=1).

If movement along the normal has been specified
by setting $normdsampsearchflag, that will also
be reflected in the Talaiarch coordinates.

A R-click help on the "ta" button reports which
type of Talairach coordinates are currently being
used.  To change, untick the "ta" button and
re-tick it to get the popup 305/152 chooser.

Here are a list of functions that are affected
when the "ta" button is depressed (with either
305 or 152 selected):

  write_val_visible_vertices
  write_val_annoted_vertices
  write_val_annotedcol_vertices
  write_val_idnum_vertices
  write_val_unmasked_vertices
  write_annotedcol_autoname
  write_selected_list_to_label
  write_annotcols_timecourses_stats
  write_annotcol_timecourses_stats
  write_label_timecourses_stats

The MNI 305 coordinates are converted to MNI 152
coordinates using the following transformation
matrix:

   0.9975  -0.0073   0.0176  -0.0429
   0.0146   1.0009  -0.0024   1.5496
  -0.0130  -0.0093   0.9971   1.1840
   0.0000   0.0000   0.0000   1.0000

N.B.: the last two functions call the function
write_label_timecourses_stats, which separately
performs the normal search and writes both .orig
as well as Talairach coords (MNI 305 or 152 as
chosen from "ta" popup) into its (non-label
format) ASCII output timecourse files.

N.B.: find_orig_vertex_coordinates (SEND button)
always reports both MNI 305 and MNI 152.

-------------------------------------------
Current Surface: ("ta" not depressed, "cu" depressed)
  set usetalcoordsflag 0
  set usecurrcoordsflag 1
  [set xform_mni_305to152_flag 0]
-------------------------------------------

In other cases, you might want to save inflated
or flat patch coordinates into a label file.  By
depressing "cu" (setting $usecurrcoordsflag to
ON/1), the current surface x,y,z coordinates are
used instead of .orig coordinates.

If a flat patch is the currently viewed surface,
the z coordinate of every vertex will be 0.0
exactly.

The variable $usecurrcoordsflag also affects the
operation of find_uniqsamp_vertices in a similar
fashion.  That function is called from the "UQ"
button, which becomes visible when "val:" is
clicked to toggle it to "val3d:".  See R-click
help for UQ for details.

Movement along the normal is disabled when using
coordinates from the current surface.

N.B.: If both $usetalcoordsflag and
$usecurrcoordsflag are ON (=1) in a tcl script,
$usecurrcoordsflag overrides $usetalcoordsflag.

N.B.: If you are writing timecourses with:

  write_label_timecourses_stats
  write_annotcols_timecourses_stats
  write_annotcol_timecourses_stats

AND both $normdsampsearchflag and
$usecurrcoordsflag are ON (=1), the first flag
(do normal search) cancels the second, and
normalsearch from .orig is done and written into
the ASCII output files.
