iRoCS Toolbox
1.1.0
|
The MarchingCubes class provides the Marching Cubes Algorithm for isosurface tesselation of real scalar volume data. More...
#include "libArrayToolbox/MarchingCubes.hh"
Public Types | |
typedef blitz::TinyVector< SurfaceGeometry::VertexT, 3 > | Triangle |
A triangle in 3-D space. More... | |
Static Public Member Functions | |
static void | simplifyMesh (SurfaceGeometry &surface, double simplifyTolerance) |
Simplify the given mesh by merging vertices as long as the given tolerance is not exceeded. More... | |
template<typename DataT > | |
static void | triangulate (Array< DataT, 3 > const &data, SurfaceGeometry &surface, double isoLevel=0.0, double simplifyTolerance=0.0) |
The triangulate function computes a vertex mesh from a given levelset Array. More... | |
template<typename DataT > | |
static void | triangulate (blitz::Array< DataT, 3 > const &data, blitz::TinyVector< double, 3 > const &elementSizeUm, SurfaceGeometry &surface, double isoLevel=0.0, double simplifyTolerance=0.0) |
The triangulate function computes a vertex mesh from a given levelset Array. More... | |
The MarchingCubes class provides the Marching Cubes Algorithm for isosurface tesselation of real scalar volume data.
It is mainly used to convert volumetric masks into surface representations. For binary input the algorithm produces staircasing artifacts, that can be avoided by smoothing the transitions between foreground and background before passing the mask to the Marching Cubes algorithm.
Definition at line 63 of file MarchingCubes.hh.
typedef blitz::TinyVector<SurfaceGeometry::VertexT,3> atb::MarchingCubes::Triangle |
A triangle in 3-D space.
Definition at line 73 of file MarchingCubes.hh.
|
static |
The triangulate function computes a vertex mesh from a given levelset Array.
The input Array type must be scalar and real. Integer and boolean Arrays should work as well, for the vertex position computation the Array values are casted to double, so if your data type supports double casts properly, it should work.
data | The Array containing the function to extract a levelset surface from |
surface | The SurfaceGeometry object, the surface will be written to |
isoLevel | The function value to extract the surface for. For binary input 0.5 is a good choice. |
simplifyTolerance | If a value greater than 0 is given here the mesh will be simplified by merging triangles until a triangle merge exceeds the given tolerance which is the volume difference before and after the merge |
|
static |
The triangulate function computes a vertex mesh from a given levelset Array.
The input Array type must be scalar and real. Integer and boolean Arrays should work as well, for the vertex position computation the Array values are casted to double, so if your data type supports double casts properly, it should work.
data | The Array containing the function to extract a levelset surface from |
elementSizeUm | The element size in micrometers |
surface | The SurfaceGeometry object, the surface will be written to |
isoLevel | The function value to extract the surface for. For binary input 0.5 is a good choice. |
simplifyTolerance | If a value greater than 0 is given here the mesh will be simplified by merging triangles until a triangle merge exceeds the given tolerance which is the volume difference before and after the merge |
|
static |
Simplify the given mesh by merging vertices as long as the given tolerance is not exceeded.
surface | The SurfaceGeometry to simplify |
simplifyTolerance | If a value greater than 0 is given here the mesh will be simplified by merging triangles until a triangle merge exceeds the given tolerance which is the volume difference before and after the merge |