iRoCS Toolbox  1.1.0
Data Structures | Public Types | Static Public Member Functions
atb::MarchingCubes Class Reference

The MarchingCubes class provides the Marching Cubes Algorithm for isosurface tesselation of real scalar volume data. More...

#include "libArrayToolbox/MarchingCubes.hh"

Collaboration diagram for atb::MarchingCubes:

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...
 

Detailed Description

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.

Member Typedef Documentation

◆ Triangle

A triangle in 3-D space.

Definition at line 73 of file MarchingCubes.hh.

Member Function Documentation

◆ triangulate() [1/2]

template<typename DataT >
static void atb::MarchingCubes::triangulate ( Array< DataT, 3 > const &  data,
SurfaceGeometry surface,
double  isoLevel = 0.0,
double  simplifyTolerance = 0.0 
)
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.

Parameters
dataThe Array containing the function to extract a levelset surface from
surfaceThe SurfaceGeometry object, the surface will be written to
isoLevelThe function value to extract the surface for. For binary input 0.5 is a good choice.
simplifyToleranceIf 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

◆ triangulate() [2/2]

template<typename DataT >
static void atb::MarchingCubes::triangulate ( blitz::Array< DataT, 3 > const &  data,
blitz::TinyVector< double, 3 > const &  elementSizeUm,
SurfaceGeometry surface,
double  isoLevel = 0.0,
double  simplifyTolerance = 0.0 
)
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.

Parameters
dataThe Array containing the function to extract a levelset surface from
elementSizeUmThe element size in micrometers
surfaceThe SurfaceGeometry object, the surface will be written to
isoLevelThe function value to extract the surface for. For binary input 0.5 is a good choice.
simplifyToleranceIf 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

◆ simplifyMesh()

static void atb::MarchingCubes::simplifyMesh ( SurfaceGeometry surface,
double  simplifyTolerance 
)
static

Simplify the given mesh by merging vertices as long as the given tolerance is not exceeded.

Parameters
surfaceThe SurfaceGeometry to simplify
simplifyToleranceIf 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

The documentation for this class was generated from the following file: