DistanceTransform3D Class Reference

an abstract 3D distance transform class More...

#include <DistanceTransform3D.h>

Inheritance diagram for DistanceTransform3D:

Simple3D SimpleList3D List of all members.

Public Member Functions

 DistanceTransform3D (const int xSize, const int ySize, const int zSize, const double xSpace=1.0, const double ySpace=1.0, const double zSpace=1.0, const double halfXSpace=0.0, const double halfYSpace=0.0, const double halfZSpace=0.0, const bool unload=true)
virtual void doTransform (const unsigned char *const I)=0
 calculate the distance transform
double getD (const int x, const int y, const int z) const
 return the distance value assigned to a particular position
void saveResult (const char *const fname) const
 save the result
virtual bool getP (const int x, const int y, const int z, int &px, int &py, int &pz) const
 return the "parent" (border point) associated with this point

Protected Member Functions

int sub (const int x, const int y, const int z) const
virtual void borderCheck (const unsigned char *const I)
void cleanUp ()
void finish (const unsigned char *const I, double *d)
void finish (const unsigned char *const I, int *d, const int dx, const int dy, const int dz)

Protected Attributes

int xSize
 integer size (width) in pixels
int ySize
 integer size (height) in pixels
int zSize
 integer size (depth/slices) in pixels
double mXSpace
 physical size in x direction
double mYSpace
 physical size in y direction
double mZSpace
 physical size in z direction
double mHalfXSpace
 half physical size in x direction
double mHalfYSpace
 half physical size in y direction
double mHalfZSpace
 half physical size in z direction
double * dD
 result of distance transform (as doubles)
int * iD
 the calculated distance transform (as ints)

Private Attributes

int * rowOffsets
 used to speed up 3d array indexing
int * sliceOffsets
 used to spped up 3d array indexing
bool unloadFlag
 convert ints to doubles (if necessary)

Classes

class  P
 DistanceTransform::P class. Simply a 2D point. More...

Detailed Description

an abstract 3D distance transform class


Constructor & Destructor Documentation

DistanceTransform3D::DistanceTransform3D const int  xSize,
const int  ySize,
const int  zSize,
const double  xSpace = 1.0,
const double  ySpace = 1.0,
const double  zSpace = 1.0,
const double  halfXSpace = 0.0,
const double  halfYSpace = 0.0,
const double  halfZSpace = 0.0,
const bool  unload = true
 

if 'unload' is true, transforms that use ratios of integers should convert their integer results to the actual double values (of the ratios).


Member Function Documentation

void DistanceTransform3D::finish const unsigned char *const   I,
int *  d,
const int  dx,
const int  dy,
const int  dz
[protected]
 

called to finish up after distance transform employing ints

void DistanceTransform3D::finish const unsigned char *const   I,
double *  d
[protected]
 

called to finish up after distance transform employing doubles

virtual bool DistanceTransform3D::getP const int  x,
const int  y,
const int  z,
int &  px,
int &  py,
int &  pz
const [virtual]
 

return the "parent" (border point) associated with this point

Parameters:
x is the x location
y is the y location
px is the parent's x location to be returned
py is the parent's y location to be returned
Returns:
true if the parent is know; otherwise false.

Reimplemented in Simple3D, and SimpleList3D.

int DistanceTransform3D::sub const int  x,
const int  y,
const int  z
const [protected]
 

given a point (x,y,z) in an image, this method returns the corresponding 1d subscript into the 1d image array


The documentation for this class was generated from the following files:
Generated on Thu Jul 27 11:25:33 2006 by  doxygen 1.4.6