add not how to show mc surface in visvis

This commit is contained in:
Almar Klein
2016-04-20 02:37:14 +02:00
parent dc784a619d
commit 19740b0ff9
+11 -4
View File
@@ -83,17 +83,24 @@ def marching_cubes(volume, level=None, spacing=(1., 1., 1.),
To quantify the area of an isosurface generated by this algorithm, pass
outputs directly into `skimage.measure.mesh_surface_area`.
Regarding visualization of algorithm output, the ``mayavi`` package
is recommended. To contour a volume named `myvolume` about the level 0.0::
Regarding visualization of algorithm output, to contour a volume
named `myvolume` about the level 0.0, using the ``mayavi`` package::
>>> from mayavi import mlab # doctest: +SKIP
>>> verts, faces = marching_cubes(myvolume, 0.0, (1., 1., 2.)) # doctest: +SKIP
>>> verts, faces = marching_cubes(myvolume, 0.0) # doctest: +SKIP
>>> mlab.triangular_mesh([vert[0] for vert in verts],
... [vert[1] for vert in verts],
... [vert[2] for vert in verts],
... faces) # doctest: +SKIP
>>> mlab.show() # doctest: +SKIP
Similarly using the ``visvis`` package::
>>> import visvis as vv # doctest: +SKIP
>>> verts, faces = marching_cubes(myvolume, 0.0) # doctest: +SKIP
>>> vv.mesh(np.fliplr(verts), faces) # doctest: +SKIP
>>> vv.use().Run() # doctest: +SKIP
References
----------
.. [1] Lorensen, William and Harvey E. Cline. Marching Cubes: A High