OpenVDB  2.0.0
Classes | Public Types | Public Member Functions | List of all members
LevelSetFilter< GridT, InterruptT > Class Template Reference

Filtering (i.e. diffusion) of narrow-band level sets. More...

#include <LevelSetFilter.h>

Inherits LevelSetTracker< GridT, InterruptT >.

Public Types

typedef LevelSetTracker< GridT,
InterruptT > 
BaseType
 
typedef GridT GridType
 
typedef GridType::TreeType TreeType
 
typedef TreeType::ValueType ValueType
 
typedef tree::LeafManager
< TreeType >::LeafRange 
RangeType
 
typedef TreeType::LeafNodeType LeafType
 
typedef tree::LeafManager
< TreeType
LeafManagerType
 
typedef LeafManagerType::BufferType BufferType
 

Public Member Functions

 LevelSetFilter (GridType &grid, InterruptT *interrupt=NULL)
 Main constructor from a grid. More...
 
 LevelSetFilter (const LevelSetFilter &other)
 Shallow copy constructor called by tbb::parallel_for() threads during filtering. More...
 
virtual ~LevelSetFilter ()
 Destructor. More...
 
void operator() (const RangeType &range) const
 Used internally by tbb::parallel_for(). More...
 
void meanCurvature (const GridT *mask=NULL)
 One iteration of mean-curvature flow of the level set. More...
 
void laplacian (const GridT *mask=NULL)
 One iteration of laplacian flow of the level set. More...
 
void gaussian (int width=1, const GridT *mask=NULL)
 One iteration of a fast separable gaussian filter. More...
 
void offset (ValueType offset, const GridT *mask=NULL)
 Offset the level set by the specified (world) distance. More...
 
void median (int width=1, const GridT *mask=NULL)
 One iteration of median-value flow of the level set. More...
 
void mean (int width=1, const GridT *mask=NULL)
 One iteration of mean-value flow of the level set. More...
 
 BOOST_STATIC_ASSERT (boost::is_floating_point< ValueType >::value)
 
void normalize ()
 Iterative normalization, i.e. solving the Eikonal equation. More...
 
void track ()
 
void prune ()
 Remove voxels that are outside the narrow band. (substep of track) More...
 
math::BiasedGradientScheme getSpatialScheme () const
 
void setSpatialScheme (math::BiasedGradientScheme scheme)
 Set the spatial finite difference scheme. More...
 
math::TemporalIntegrationScheme getTemporalScheme () const
 
void setTemporalScheme (math::TemporalIntegrationScheme scheme)
 Set the spatial finite difference scheme. More...
 
int getNormCount () const
 
void setNormCount (int n)
 Set the number of normalizations performed per track or normalize call. More...
 
int getGrainSize () const
 
void setGrainSize (int grainsize)
 Set the grain-size used for multi-threading. More...
 
ValueType voxelSize () const
 
void startInterrupter (const char *msg)
 
void endInterrupter ()
 
bool checkInterrupter ()
 
const GridTypegrid () const
 
LeafManagerTypeleafs ()
 
const LeafManagerTypeleafs () const
 
void operator() (const RangeType &r) const
 Public functor called by tbb::parallel_for() More...
 

Detailed Description

template<typename GridT, typename InterruptT = util::NullInterrupter>
class openvdb::v2_0_0::tools::LevelSetFilter< GridT, InterruptT >

Filtering (i.e. diffusion) of narrow-band level sets.

Note
This class performs propper interface tracking which allows for unrestricted surface deformations

Member Typedef Documentation

typedef LevelSetTracker<GridT, InterruptT> BaseType
typedef GridT GridType
typedef TreeType::LeafNodeType LeafType
inherited
typedef tree::LeafManager<TreeType>::LeafRange RangeType
typedef GridType::TreeType TreeType
typedef TreeType::ValueType ValueType

Constructor & Destructor Documentation

LevelSetFilter ( GridType grid,
InterruptT *  interrupt = NULL 
)
inline

Main constructor from a grid.

Parameters
gridThe level set to be filtered.
interruptOptional interrupter.
LevelSetFilter ( const LevelSetFilter< GridT, InterruptT > &  other)
inline

Shallow copy constructor called by tbb::parallel_for() threads during filtering.

Parameters
otherThe other LevelSetFilter from which to copy.
virtual ~LevelSetFilter ( )
inlinevirtual

Destructor.

Member Function Documentation

BOOST_STATIC_ASSERT ( boost::is_floating_point< ValueType >::value  )
inherited
bool checkInterrupter ( )
inlineinherited
Returns
false if the process was interrupted
void endInterrupter ( )
inlineinherited
void gaussian ( int  width = 1,
const GridT *  mask = NULL 
)
inline

One iteration of a fast separable gaussian filter.

Parameters
widthWidth of the gaussian kernel in voxel units.
maskOptional alpha mask.
Note
This is approximated as 4 iterations of a separable mean filter which typically leads an approximation that's better than 95%!
int getGrainSize ( ) const
inlineinherited
Returns
the grain-size used for multi-threading
int getNormCount ( ) const
inlineinherited
Returns
The number of normalizations performed per track or normalize call.
math::BiasedGradientScheme getSpatialScheme ( ) const
inlineinherited
Returns
the spatial finite difference scheme
math::TemporalIntegrationScheme getTemporalScheme ( ) const
inlineinherited
Returns
the temporal integration scheme
const GridType& grid ( ) const
inlineinherited
void laplacian ( const GridT *  mask = NULL)
inline

One iteration of laplacian flow of the level set.

Parameters
maskOptional alpha mask.
LeafManagerType& leafs ( )
inlineinherited
const LeafManagerType& leafs ( ) const
inlineinherited
void mean ( int  width = 1,
const GridT *  mask = NULL 
)
inline

One iteration of mean-value flow of the level set.

Parameters
widthWidth of the mean-value kernel in voxel units.
maskOptional alpha mask.
Note
This filter is separable so it's fast!
void meanCurvature ( const GridT *  mask = NULL)
inline

One iteration of mean-curvature flow of the level set.

Parameters
maskOptional alpha mask.
void median ( int  width = 1,
const GridT *  mask = NULL 
)
inline

One iteration of median-value flow of the level set.

Parameters
widthWidth of the median-value kernel in voxel units.
maskOptional alpha mask.
Warning
This filter is not separable and is hence relatively slow!
void normalize ( )
inlineinherited

Iterative normalization, i.e. solving the Eikonal equation.

void offset ( ValueType  offset,
const GridT *  mask = NULL 
)
inline

Offset the level set by the specified (world) distance.

Parameters
offsetValue of the offset.
maskOptional alpha mask.
void operator() ( const RangeType range) const
inline

Used internally by tbb::parallel_for().

Parameters
rangeThe range over which to perform multi-threading.
Warning
Never call this method directly!
void operator() ( const RangeType r) const
inlineinherited

Public functor called by tbb::parallel_for()

Note
Never call this method directly
void prune ( )
inlineinherited

Remove voxels that are outside the narrow band. (substep of track)

void setGrainSize ( int  grainsize)
inlineinherited

Set the grain-size used for multi-threading.

Note
A grainsize of 0 or less disables multi-threading!
void setNormCount ( int  n)
inlineinherited

Set the number of normalizations performed per track or normalize call.

void setSpatialScheme ( math::BiasedGradientScheme  scheme)
inlineinherited

Set the spatial finite difference scheme.

void setTemporalScheme ( math::TemporalIntegrationScheme  scheme)
inlineinherited

Set the spatial finite difference scheme.

void startInterrupter ( const char *  msg)
inlineinherited
void track ( )
inlineinherited

Track the level set interface, i.e. rebuild and normalize the narrow band of the level set.

ValueType voxelSize ( ) const
inlineinherited

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