Scikit Image Marching Cubes Output
<p>I'm using the Scikit Image implementation of the marching cubes algorithm to generate an isosurface.</p>

<pre><code>verts, faces = measure.marching_cubes(stack,10)
</code></pre>

<p>Creates an isosurface of value 10 of the image stack <code>stack</code>, and outputs the vertex data to <code>verts</code>, and face data to `faces.</p>

<p>The format of the output arrays for <code>verts</code> and <code>faces</code> is of the form <code>(n,3)</code> where n is the number of the vertex/face and the three columns correspond to coordinates.</p>

<p>Does anyone know how these output arrays are indexed? What determines the order in which they are registered in the array? Also, why is the <code>faces</code> array needed, as the knowledge of the vertices alone should be enough to construct the isosurface?</p>

<p>From the <a href="http://scikit-image.org/docs/stable/api/skimage.measure.html#marching-cubes" rel="nofollow">documentation</a>:</p>

<blockquote>
  <p>The output is a triangular mesh consisting of a set of unique vertices
  and connecting triangles. The order of these vertices and triangles in
  the output list is determined by the position of the smallest x,y,z
  (in lexicographical order) coordinate in the contour. This is a
  side-effect of how the input array is traversed, but can be relied
  upon.</p>
</blockquote>

python scikit-image marching-cubes