-------------------------------------------
var,funct: write VTK (Visualization Toolkit) surface
  set outsurf <surface>
  write_vtk_surface
-------------------------------------------

Large Panel Only: [fn-]F3

The "VTK" button on the "outsurf:" line on the
large fn-F3 panel writes out current surface as a
VTK ASCII file whose name is current value of
$outsurf (entry at left) after auto-appending
".vtk" if it isn't already there.

The button checks overwrite but the equivalent
tclfunct, write_vtk_surface, doesn't.

The vertex coordinates are not transformed in any
way -- they are written in the native freesurfer
coordinate system (which may not display as a
lateral view of a hemisphere in a vtk file
viewer).

Currently, only writes a triangle file.  The
format of the file is:

  --line 1: magic line
  --line 2: header line up to 256 chars
  --line 3: ASCII (vs. BINARY)
  --line 4: DATASET <type>
  --line 5: POINTS <numvertices>
  --line 6: first vertex (implicitly num'd)
  --line 7: second vertex (implicitly num'd)
  ...
  ... [to num_vertices POINTS lines]
  --line n: POLYGONS <numpolygons> <numpolytokens>
  --line n+1: corner_count, first face vertex numbers
  --line n+2: corner_count, first face vertex numbers
  ...
  ... [to num_polygons POLYGONS lines]

For example, a vtk file looks like this (indented
below, but natively left justified):

  # vtk DataFile Version 3.0
  BB4T130527_S4_mp2rage_0_inf_profiles
  ASCII
  DATASET POLYDATA
  POINTS 954296 float
  43.35591 108.78648 122.05577
  43.44609 108.62583 122.07568
  ...
  ...
  19.28717 77.35710 24.23914
  19.33012 77.21865 24.23220
  POLYGONS 1908740 7634960
  3 2 1 0
  3 1 3 0
  ...
  ...
  3 954295 954257 954255
  3 954295 954252 954257
