-------------------------------------------
funct (left-click):
  tksurfer tcl proc: getdijk2
-------------------------------------------

The "Dijk" button (lower middle) calculates the
approximate geodesic path between the last two
clicked points on the current surface (using
smoothwm, not the current surface).  The path is
found using a Dijkstra algorithm by the MGH
freesurfer binary, mris_pmake, by Rudolph
Pienaar, and a single-vertex-wide label line is
written to $hemi-dijk.label (context-dependent
location see below).

The path follows the edges of triangular faces
and is therefore very slightly longer than a
geodesic path.

When finished (about 5 sec for a standard
hemisphere), the path is displayed in yellow,
using the label generated by mris_pmake.

The displayed path label can be used to define
the edge of another label since FILL and ROI
respect displayed labels.

If the surface was opened by selecting a subject
from the csurf "subject:" dropdown and clicking
SURFACE, the single-vertex-wide geodesic path
label will be saved inside the subject's label
directory:

  ~/label/$hemi-dijk.label

If the surface was opened by selecting a session
from the csurf "session:" dropdown and clicking
SURFACE-STATS in the View Functional Data panel,
the path label will be saved inside the current
scandir:

  */$scandir/$hemi-dijk.label

Command line used:

 ### vtx0 next-to-last, vtx1 last-clicked
 mris_pmake \
   --subject $subject \
   --hemi $hemi \
   --mpmOverlay euclidean \
   --mpmProg pathFind \
   --mpmArgs startVertex:${vtx0},endVertex:${vtx1}

If the default curv file, $hemi.smoothwm.H.crv,
is not found, $hemi.curv is used instead by
also specifiying "--curv0 curv".

See: https://mail.nmr.mgh.harvard.edu/
  pipermail/freesurfer/2013-January/027543.html

N.B.: with a large surface (e.g., 5M vertex
cerebellum) this program needs a lot of RAM
(more than 16G).
