HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Morphology.h File Reference

Implementation of morphological dilation and erosion. More...

#include <openvdb/Types.h>
#include <openvdb/Grid.h>
#include <openvdb/math/Math.h>
#include <openvdb/tree/TreeIterator.h>
#include <openvdb/tree/ValueAccessor.h>
#include <openvdb/tree/LeafManager.h>
#include "Prune.h"
#include "ValueTransformer.h"
#include <tbb/tbb_thread.h>
#include <tbb/task_scheduler_init.h>
#include <tbb/enumerable_thread_specific.h>
#include <tbb/parallel_for.h>
#include <type_traits>
+ Include dependency graph for Morphology.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openvdb::OPENVDB_VERSION_NAME::tools::DimToWord< Log2Dim >
 Mapping from a Log2Dim to a data type of size 2^Log2Dim bits. More...
 
struct  openvdb::OPENVDB_VERSION_NAME::tools::DimToWord< 3 >
 
struct  openvdb::OPENVDB_VERSION_NAME::tools::DimToWord< 4 >
 
struct  openvdb::OPENVDB_VERSION_NAME::tools::DimToWord< 5 >
 
struct  openvdb::OPENVDB_VERSION_NAME::tools::DimToWord< 6 >
 
class  openvdb::OPENVDB_VERSION_NAME::tools::Morphology< TreeType >
 
struct  openvdb::OPENVDB_VERSION_NAME::tools::Morphology< TreeType >::Neighbor
 
struct  openvdb::OPENVDB_VERSION_NAME::tools::Morphology< TreeType >::LeafCache
 
struct  openvdb::OPENVDB_VERSION_NAME::tools::Morphology< TreeType >::ErodeVoxelsOp
 
struct  openvdb::OPENVDB_VERSION_NAME::tools::Morphology< TreeType >::MaskManager
 
struct  openvdb::OPENVDB_VERSION_NAME::tools::Morphology< TreeType >::UpdateMasks
 
struct  openvdb::OPENVDB_VERSION_NAME::tools::Morphology< TreeType >::CopyMasks
 
class  openvdb::OPENVDB_VERSION_NAME::tools::activation::ActivationOp< TreeType >
 
class  openvdb::OPENVDB_VERSION_NAME::tools::DilationOp< TreeT >
 Class that performs multi-threaded dilation with support for active tiles. More...
 

Namespaces

 openvdb
 
 openvdb::OPENVDB_VERSION_NAME
 
 openvdb::OPENVDB_VERSION_NAME::tools
 
 openvdb::OPENVDB_VERSION_NAME::tools::activation
 

Enumerations

enum  openvdb::OPENVDB_VERSION_NAME::tools::NearestNeighbors { openvdb::OPENVDB_VERSION_NAME::tools::NN_FACE = 6, openvdb::OPENVDB_VERSION_NAME::tools::NN_FACE_EDGE = 18, openvdb::OPENVDB_VERSION_NAME::tools::NN_FACE_EDGE_VERTEX = 26 }
 Voxel topology of nearest neighbors. More...
 
enum  openvdb::OPENVDB_VERSION_NAME::tools::TilePolicy { openvdb::OPENVDB_VERSION_NAME::tools::IGNORE_TILES, openvdb::OPENVDB_VERSION_NAME::tools::EXPAND_TILES, openvdb::OPENVDB_VERSION_NAME::tools::PRESERVE_TILES }
 Different policies when dilating trees with active tiles. More...
 

Functions

template<typename TreeType >
OPENVDB_STATIC_SPECIALIZATION void openvdb::OPENVDB_VERSION_NAME::tools::dilateActiveValues (TreeType &tree, int iterations=1, NearestNeighbors nn=NN_FACE, TilePolicy mode=PRESERVE_TILES)
 Topologically dilate all active values (i.e. both voxels and tiles) in a tree using one of three nearest neighbor connectivity patterns. More...
 
template<typename TreeType >
OPENVDB_STATIC_SPECIALIZATION void openvdb::OPENVDB_VERSION_NAME::tools::dilateActiveValues (tree::LeafManager< TreeType > &manager, int iterations=1, NearestNeighbors nn=NN_FACE, TilePolicy mode=PRESERVE_TILES)
 Topologically dilate all active values (i.e. both voxels and tiles) in a tree using one of three nearest neighbor connectivity patterns. More...
 
template<typename TreeType >
OPENVDB_STATIC_SPECIALIZATION void openvdb::OPENVDB_VERSION_NAME::tools::dilateVoxels (TreeType &tree, int iterations=1, NearestNeighbors nn=NN_FACE)
 Topologically dilate all leaf-level active voxels in a tree using one of three nearest neighbor connectivity patterns. More...
 
template<typename TreeType >
OPENVDB_STATIC_SPECIALIZATION void openvdb::OPENVDB_VERSION_NAME::tools::dilateVoxels (tree::LeafManager< TreeType > &manager, int iterations=1, NearestNeighbors nn=NN_FACE)
 Topologically dilate all leaf-level active voxels in a tree using one of three nearest neighbor connectivity patterns. More...
 
template<typename GridOrTree >
void openvdb::OPENVDB_VERSION_NAME::tools::activate (GridOrTree &, const typename GridOrTree::ValueType &value, const typename GridOrTree::ValueType &tolerance=zeroVal< typename GridOrTree::ValueType >())
 Mark as active any inactive tiles or voxels in the given grid or tree whose values are equal to value (optionally to within the given tolerance). More...
 
template<typename GridOrTree >
void openvdb::OPENVDB_VERSION_NAME::tools::deactivate (GridOrTree &, const typename GridOrTree::ValueType &value, const typename GridOrTree::ValueType &tolerance=zeroVal< typename GridOrTree::ValueType >())
 Mark as inactive any active tiles or voxels in the given grid or tree whose values are equal to value (optionally to within the given tolerance). More...
 
template<typename TreeType >
OPENVDB_STATIC_SPECIALIZATION void openvdb::OPENVDB_VERSION_NAME::tools::erodeVoxels (TreeType &tree, int iterations=1, NearestNeighbors nn=NN_FACE)
 Topologically erode all leaf-level active voxels in the given tree. More...
 
template<typename TreeType >
OPENVDB_STATIC_SPECIALIZATION void openvdb::OPENVDB_VERSION_NAME::tools::erodeVoxels (tree::LeafManager< TreeType > &manager, int iterations=1, NearestNeighbors nn=NN_FACE)
 Topologically erode all leaf-level active voxels in the given tree. More...
 

Detailed Description

Implementation of morphological dilation and erosion.

Note
By design the morphological operations only change the state of voxels, not their values. If one desires to change the values of voxels that change state an efficient technique is to construct a boolean mask by performing a topology difference between the original and final grids.
Todo:
Extend erosion with 18 and 26 neighbors (coming soon!)
Author
Ken Museth

Definition in file Morphology.h.