ImFusion SDK 4.3
ImFusion::MarchingCubes Namespace Reference

Marching Cubes implementation to extract a isosurface mesh from a volume. More...

Detailed Description

Marching Cubes implementation to extract a isosurface mesh from a volume.

Functions

template<typename T>
MeshcomputeIsosurface (const TypedImage< T > *volume, const TypedImage< unsigned char > *volumeColor, float isovalue, bool aboveIsovalue=false, const TypedImage< unsigned char > *mask=nullptr)
 Compute isosurface mesh for isovalue.
 
MeshcomputeIsosurfaceHalfFloat (const TypedImage< unsigned short > *volume, const TypedImage< unsigned char > *volumeColor, float isovalue, bool aboveIsovalue=false)
 Compute isosurface mesh for isovalue.
 

Function Documentation

◆ computeIsosurface()

template<typename T>
Mesh * computeIsosurface ( const TypedImage< T > * volume,
const TypedImage< unsigned char > * volumeColor,
float isovalue,
bool aboveIsovalue = false,
const TypedImage< unsigned char > * mask = nullptr )

Compute isosurface mesh for isovalue.

The output coordinate for voxel (x,y,z) is (x,y,z)*spacing. The spacing is taken from the volume.

Parameters
volumefloat buffer with volume
volumeColoroptional 3 channel RGB color values for each voxel
isovalueiso value
aboveIsovaluetrue if the interior of the mesh is greater than the isovalue
maskoptional pointer to a unsigned char typed image forming a mask. If supplied, only faces that lie within the mask are added.
Returns
pointer to mesh object representing isosurface if successful, zero otherwise. Caller has to relase memory.

◆ computeIsosurfaceHalfFloat()

Mesh * computeIsosurfaceHalfFloat ( const TypedImage< unsigned short > * volume,
const TypedImage< unsigned char > * volumeColor,
float isovalue,
bool aboveIsovalue = false )

Compute isosurface mesh for isovalue.

The output coordinate for voxel (x,y,z) is (x,y,z)*spacing. The spacing is taken from the volume.

Parameters
volumehalf float buffer with volume
volumeColoroptional 3 channel RGB color values for each voxel
isovalueiso value
aboveIsovaluetrue if the interior of the mesh is greater than the isovalue
Returns
pointer to mesh object representing isosurface if successful, zero otherwise. Caller has to relase memory.
Search Tab / S to search, Esc to close