-------------------------------------------
funct(s) (left-click): write current 3D ROI/mask
  write_roi
  [write_roi_label] -> if overlay data
-------------------------------------------
funct (mid-click): write all 3D MGH seg idnums
  write_allsegids
-------------------------------------------


Detailed Description "W" button

A default left-click on the "W" button writes out
the currently displayed 3D ROI mask (C/tcl funct:
write_roi) as a 256x256x256 AFNI BRIK (2-byte
short) to the file shown in the entry to the left
(filename variable: $uplabel).  ROI voxels have a
value of 64 while non-ROI voxels are 0.

If overlay data is currently displayed, this
button also writes out the real or complex
overlay data (function: write_roi_label) into an
ASCII file with a name similar to the ROI mask
filename (filename variable: $label2).  For
example:

  maskfile:  MY_AREA+orig.BRIK
  datafile:  MY_AREA.3dlabel

Each line of the ASCII output file contains the
tkmedit intrinsic coordinates of the voxel in the
256x256x256 mask BRIK followed by either a single
real value or a complex value, written
redundantly as real, imaginary, and amplitude,
angle (radians).  For example:

Real-valued overlay data ASCII file:
 
  #!ascii , from subject martys, P/A I/S R/L real
  1058
  113 179 162 8.412699
  113 179 163 9.071663
  113 179 164 8.819065

Complex-valued overlay data ASCII file:

  #!ascii , from subject martys, P/A I/S R/L r i amp ang
  1058
  113 179 162 -8.412699 8.789361 12.166609 2.334302
  113 179 163 -9.071663 8.672894 12.550464 2.378664
  113 179 164 -8.819065 8.496123 12.245816 2.374843

-------------------------------------------
Alt funct (mid-click): write all 3D MGH seg idnums
  write_allsegids 
-------------------------------------------

An alternate middle-click on the "W" button
creates an AFNI BRIK containing the int idnums
from every 3D region in the currently loaded MGH
FreeSurfer int segmentation.

The BRIK has the resolution of the underlay
(typically 1x1x1mm).  The filename is taken from
the entry to the left (filename variable:
$uplabel).
