Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes

cmtk::UniformDistanceMap< TDistanceDataType > Class Template Reference
[cmtkBase Library]

Distance map on a uniform grid. More...

#include <cmtkUniformDistanceMap.h>

Collaboration diagram for cmtk::UniformDistanceMap< TDistanceDataType >:
Collaboration graph
[legend]

List of all members.

Classes

class  ThreadParametersEDT
 Thread parameters. More...

Public Types

enum  Flags {
  DEFAULT = 0, INSIDE = 1, VALUE_EXACT = 2, VALUE_WINDOW = 4,
  VALUE_THRESHOLD = 8
}
 

Enumeration with binary flags that control distance map computation.

More...
typedef UniformDistanceMap
< TDistanceDataType > 
Self
 This class.
typedef UniformVolume Superclass
 Superclass.
typedef SmartPointer< SelfSmartPtr
 Smart pointer to distance map.
typedef TDistanceDataType DistanceDataType
 Distance data type.

Public Member Functions

 UniformDistanceMap (const UniformVolume &volume, const byte flags=DEFAULT, const Types::DataItem value=0, const Types::DataItem window=0)
 Construct map from given volume.
UniformVolume::SmartPtr Get ()

Static Public Attributes

static const long int EDT_MAX_DISTANCE_SQUARED = 2147329548

Private Member Functions

void BuildDistanceMap (const UniformVolume &volume, const byte flags, const Types::DataItem value=0, const Types::DataItem window=0)
 Compute distance map.
void ComputeEDT (DistanceDataType *const distance)
 Compute 3-D Euclidean Distance Transformation.
void ComputeEDT2D (DistanceDataType *const plane, std::vector< DistanceDataType > &gTemp, std::vector< DistanceDataType > &hTemp)
 Compute 2-D Euclidean Distance Transformation for one image plane.
bool VoronoiEDT (DistanceDataType *const lpY, const int nSize, const DistanceDataType delta, std::vector< DistanceDataType > &gTemp, std::vector< DistanceDataType > &hTemp)
 Compute 1-D Voronoi Euclidean Distance Transform.

Static Private Member Functions

static void ComputeEDTThreadPhase1 (void *const args, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t)
 Thread function for first phase (xy) of EDT computation.
static void ComputeEDTThreadPhase2 (void *const args, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t)
 Thread function for second phase (z) of EDT computation.

Private Attributes

std::vector< std::vector
< DistanceDataType > > 
m_G
 Internal: pointer to row storage.
std::vector< std::vector
< DistanceDataType > > 
m_H
 Internal: pointer to row storage.
UniformVolume::SmartPtr m_DistanceMap
 The computed distance map.

Detailed Description

template<class TDistanceDataType>
class cmtk::UniformDistanceMap< TDistanceDataType >

Distance map on a uniform grid.

Author:
This class is based on code originally written by Calvin R. Maurer, Jr.

Definition at line 55 of file cmtkUniformDistanceMap.h.


Member Typedef Documentation

template<class TDistanceDataType >
typedef TDistanceDataType cmtk::UniformDistanceMap< TDistanceDataType >::DistanceDataType

Distance data type.

Definition at line 70 of file cmtkUniformDistanceMap.h.

template<class TDistanceDataType >
typedef UniformDistanceMap<TDistanceDataType> cmtk::UniformDistanceMap< TDistanceDataType >::Self

This class.

Definition at line 61 of file cmtkUniformDistanceMap.h.

template<class TDistanceDataType >
typedef SmartPointer<Self> cmtk::UniformDistanceMap< TDistanceDataType >::SmartPtr

Smart pointer to distance map.

Definition at line 67 of file cmtkUniformDistanceMap.h.

template<class TDistanceDataType >
typedef UniformVolume cmtk::UniformDistanceMap< TDistanceDataType >::Superclass

Superclass.

Definition at line 64 of file cmtkUniformDistanceMap.h.


Member Enumeration Documentation

template<class TDistanceDataType >
enum cmtk::UniformDistanceMap::Flags

Enumeration with binary flags that control distance map computation.

The defined values can be combined by arithmetic "or".

Enumerator:
DEFAULT 

No special functions.

This flag will create a distance-from-feature map where any non-zero voxel in the feature image will be considered.

INSIDE 

Compute distance-from-background map.

The resulting distance values will be non-zero at all feature voxels, specifying the distance to the nearest non-feature voxel.

VALUE_EXACT 

Compute "inside", rather than "outside" map.

Ths essentially inverts the mask.

VALUE_WINDOW 

Use specific feature value.

If this flag is set, only voxels in the feature image with values equal to or larger than a given constant will be considered feature voxels. All voxels with lower values will be considered background voxels.

VALUE_THRESHOLD 

Use window around specific feature value.

If this flag is set, only voxels in the feature image with values that are within a range from a given constant will be considered feature voxels. All voxels with lower values will be considered background voxels.

Definition at line 75 of file cmtkUniformDistanceMap.h.


Member Function Documentation

template<class TDistanceDataType >
UniformVolume::SmartPtr cmtk::UniformDistanceMap< TDistanceDataType >::Get (  ) [inline]

Member Data Documentation

template<class TDistanceDataType >
const long int cmtk::UniformDistanceMap< TDistanceDataType >::EDT_MAX_DISTANCE_SQUARED = 2147329548 [static]

Definition at line 58 of file cmtkUniformDistanceMap.h.

template<class TDistanceDataType >
UniformVolume::SmartPtr cmtk::UniformDistanceMap< TDistanceDataType >::m_DistanceMap [private]
template<class TDistanceDataType >
std::vector< std::vector<DistanceDataType> > cmtk::UniformDistanceMap< TDistanceDataType >::m_G [private]
template<class TDistanceDataType >
std::vector< std::vector<DistanceDataType> > cmtk::UniformDistanceMap< TDistanceDataType >::m_H [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines