-------------------------------------------
entry variable: $outsurf -- absolute name output surf
-------------------------------------------
default: $SUBJECTS_DIR/name/surf/$hemi.surftmp

Large Panel Only: [fn-]F3

The "outsurf:" entry on the large fn-F3 panel
contains the editable name that will be used for
writing out the current state of the surface to a
file, using one of the six buttons to the right.

The default name is:

  ~/surf/$hemi.surftmp

where the tilde (~) expands to the 'home
directory' of the current subject:

  $SUBJECTS_DIR/<subject>

A relative name assumes the same directory as
above.  An absolute name (starting with '/') is
also accepted.

Surface File Formats

Six different surface file formats can be written
using the following buttons:

  W	native freesurfer format (binary)
  ASC	freesurfer format (ASCII)
  VTK	vtk 3.0 format (ASCII)
  OFF	object file format: OFF,COFF (ASCII)
  STL	stereolithography format: 3D printer (ASCII)
  GLB	glTF 2.0: GL transmission format (binary)
  OBJ	Alias/Wavefront (ASCII)

Use the native freesurfer format ("W") for normal
operations.  The other options are for exporting
a finished surface to a 3D printer, or to use it
in another software package.

The corresponding tcl/C functions for writing
each of these six file types are:

  write_binary_surface
  write_ascii_surface
  write_vtk_surface
  write_off_surface
  write_stl_surface
  write_glb_surface
  write_obj_surface

The output file written by these functions is the
current value of the $outsurf variable, so a
minimal tcl script usage is:

  set outsurf /tmp/zz.vtk
  write_vtk_surface

If you want csurf-specific globbing (e.g., ~ to
mean the current subject), use "setfile" instead
of "set":

  setfile outsurf ~/surf/zz.vtk
  write_vtk_surface

Unlike the interface buttons, the functions don't
ask if it is OK to overwrite.

In all cases except the first, type-specific
suffixes:

  *.ascii
  *.vtk
  *.off
  *.stl
  *.glb
  *.obj
 
will be appended to the name in the "outsurf:"
entry (tcl variable $outsurf) if not already
there.  The tcl/C functions do this as well.

See R-click help for each output button for full
details of the different binary and ASCII
formats.

The original binary freesurfer surface file
format (quadrangular) was designed in 1990 on an
SGI machine with a 300 MB disk.  It was optimized
to save space and defined as native big-endian
(SGI/Sun/Motorola):

    [header]
  3bytes: 16777215
  3bytes: number of vertices
  3bytes: number of faces
    [vertex list--implicit vertex numbering]
  2bytes: x[vertex0]*100
  2bytes: y[vertex0]*100
  2bytes: z[vertex0]*100
  ...
    [face list--vertex numbers of corners]
  3bytes: face1: vertex number 1st corner
  3bytes: face1: vertex number 2nd corner
  3bytes: face1: vertex number 3rd corner
  3bytes: face1: vertex number 4th corner
  ...

See R-click help for the upper left "surf:"
dropdown on the F2 interface for full details.

