iRoCS Toolbox  1.1.0
Public Types | Public Member Functions | Data Fields | Static Public Attributes
atb::EuclideanDistanceTransformBase Class Reference

Exact 1-D euclidean distance transform using lower parabola embedding [1]. More...

#include "libArrayToolbox/DistanceTransform.hh"

Collaboration diagram for atb::EuclideanDistanceTransformBase:

Public Types

enum  Mode { DistanceToForeground, DistanceToBackground }
 DistanceTransform.hh "libArrayToolbox/DistanceTransform.hh". More...
 

Public Member Functions

 EuclideanDistanceTransformBase (int capacity)
 Create a new EuclideanDistanceTransformBase object with given maximum line length. More...
 
 ~EuclideanDistanceTransformBase ()
 Destructor. More...
 
void run (int n)
 Apply the line transform to data stored in f. More...
 

Data Fields

std::vector< double > _v
 The angular points of parabola contributing to the lower distance envelope. More...
 
std::vector< double > _z
 The intervals of parabola contributing to the lower distance envelope. More...
 
std::vector< double > d
 The squared eucliden distances of f. More...
 
std::vector< double > f
 The input to process the distance transform for. More...
 

Static Public Attributes

static double BG_VALUE
 Assign background pixels this value and foreground pixels value 0. More...
 

Detailed Description

Exact 1-D euclidean distance transform using lower parabola embedding [1].

This line transform allows to compute distance transforms of arbitrary- dimensional data by subsequent dimension-wise application.

[1] P. Felzenszwalb and D. Huttenlocher. Theory of Computing, Vol. 8, No. 19, September 2012

Definition at line 64 of file DistanceTransform.hh.

Member Enumeration Documentation

◆ Mode

DistanceTransform.hh "libArrayToolbox/DistanceTransform.hh".

The Mode enum specifies whether the distance to foreground or background pixels is computed.

Enumerator
DistanceToForeground 

Compute distance to nearest foreground pixel.

DistanceToBackground 

Compute distance to nearest background pixel.

Definition at line 74 of file DistanceTransform.hh.

Constructor & Destructor Documentation

◆ EuclideanDistanceTransformBase()

atb::EuclideanDistanceTransformBase::EuclideanDistanceTransformBase ( int  capacity)

Create a new EuclideanDistanceTransformBase object with given maximum line length.

Parameters
capacityThe maximum line length to process

◆ ~EuclideanDistanceTransformBase()

atb::EuclideanDistanceTransformBase::~EuclideanDistanceTransformBase ( )

Destructor.

Member Function Documentation

◆ run()

void atb::EuclideanDistanceTransformBase::run ( int  n)

Apply the line transform to data stored in f.

After processing, d contains the squared euclidean distances, _v contains the locations of the angular points of the parabola and _z the intervals on which the corresponding parabola has smallest value, i.e. values of parabola i with angular point (_v[i], f(_v[i])) are smaller than values of all other parabola in interval (_z[i], _z[i+1]). Only parabola contributing to the lower envelope are contained.

Parameters
nThe length of the line

Field Documentation

◆ BG_VALUE

double atb::EuclideanDistanceTransformBase::BG_VALUE
static

Assign background pixels this value and foreground pixels value 0.

Definition at line 85 of file DistanceTransform.hh.

◆ f

std::vector<double> atb::EuclideanDistanceTransformBase::f

The input to process the distance transform for.

Can be a raw binary 1-D Array containing 0 for foreground and BG_VALUE for background or the result of previous line transforms in orthogonal dimensions for n-D data.

Definition at line 127 of file DistanceTransform.hh.

◆ d

std::vector<double> atb::EuclideanDistanceTransformBase::d

The squared eucliden distances of f.

Definition at line 134 of file DistanceTransform.hh.

◆ _z

std::vector<double> atb::EuclideanDistanceTransformBase::_z

The intervals of parabola contributing to the lower distance envelope.

Definition at line 141 of file DistanceTransform.hh.

◆ _v

std::vector<double> atb::EuclideanDistanceTransformBase::_v

The angular points of parabola contributing to the lower distance envelope.

Definition at line 149 of file DistanceTransform.hh.


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