mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-27 18:44:19 +08:00
MC: docs and example fixes
This commit is contained in:
@@ -86,24 +86,6 @@ def marching_cubes_classic(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, 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_classic(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_classic(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
|
||||
|
||||
@@ -113,6 +113,27 @@ def marching_cubes(volume, level=None, spacing=(1., 1., 1.),
|
||||
keeping the algorithm relatively easy. This implementation is
|
||||
written in Cython, ported from Lewiner's C++ implementation.
|
||||
|
||||
To quantify the area of an isosurface generated by this algorithm, pass
|
||||
verts and faces to `skimage.measure.mesh_surface_area`.
|
||||
|
||||
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, normals, values = 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, normals, values = marching_cubes_classic(myvolume, 0.0) # doctest: +SKIP
|
||||
>>> vv.mesh(np.fliplr(verts), faces, normals, values) # doctest: +SKIP
|
||||
>>> vv.use().Run() # doctest: +SKIP
|
||||
|
||||
References
|
||||
----------
|
||||
.. [1] Thomas Lewiner, Helio Lopes, Antonio Wilson Vieira and Geovan
|
||||
|
||||
Reference in New Issue
Block a user