You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I started using Meshing.isosurface(), with MarchingCubes as method. The docs say that setting reduceverts=true (default: true) will merge vertices within a voxel to reduce mesh size by around 30%
and with slight performance improvement.
I called both Meshing.isosurface() and skimage.measure.marching_cubes_lewiner(), a Python function from scikit-image,
to extrude a brain within a volumetric data of size (91, 109, 91).
The number of vertices of the corresponding mesh, returned by Meshing function is (345752) almost 4 times greater
than that returned by skimage function (86473).
345752/86473 = 3.99, i.e. it is exaggerated.
This is expected behavior for MarchingCubes. reduceverts is only merging vertices where it is computationally cheap to do so. I assume scikit is merging vertices across the whole mesh, which requires additional memory during computation, but saves on the vertex count in the end. A simple approach to accomplish the de-duplication of vertex references is through a dictionary. This should be okay for simple meshes, but performance would likely scale poorly with Julia's Dict. Erizo has a fast implementation of this.
MarchingTetrahedra does assure the uniqueness property, but it generates far more triangles. This may be an approach if you need connectivity information, but be aware that it generates far more triangles.
sjkelly
changed the title
Exaggerated number of vertices returned by isosurface with MarchingCube algorithm
Fully de-duplicate vertices in MarchingCube algorithm
Jul 15, 2021
Recently I started using
Meshing.isosurface()
, with MarchingCubes as method. The docs say thatsetting
reduceverts=true
(default: true) will merge vertices within a voxel to reduce mesh size by around 30%and with slight performance improvement.
I called both
Meshing.isosurface()
andskimage.measure.marching_cubes_lewiner()
, a Python function from scikit-image,to extrude a brain within a volumetric data of size (91, 109, 91).
The number of vertices of the corresponding mesh, returned by Meshing function is (345752) almost 4 times greater
than that returned by skimage function (86473).
345752/86473 = 3.99, i.e. it is exaggerated.
Here are the two blocks of code:
respectively:
The corresponding Jupyter Notebook has the size of 111MB, vs 25MB, when using Python scikit-image.
Otherwise the mesh plot is great in both cases:
The text was updated successfully, but these errors were encountered: