DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer > Class Template Reference

Aim: Implementation of the linear in time reverse distance transformation for separable metrics. More...

#include <DGtal/geometry/volumes/distance/ReverseDistanceTransformation.h>

Inheritance diagram for DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >:
[legend]

Public Types

typedef TWeightImage WeightImage
 Separable Metric type.
 
typedef TPSeparableMetric PowerSeparableMetric
 Separable Metric type.
 
typedef TImageContainer ImageContainer
 Image Container type.
 
typedef PowerSeparableMetric::Value Value
 Separable Metric type value type.
 
typedef TWeightImage::Domain::Space::Point Point
 Point type.
 
typedef TWeightImage::Domain::Space::Vector Vector
 Vector type.
 
typedef PowerSeparableMetric::Weight Weight
 Separable Metric type weight type.
 
typedef ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainerSelf
 Definition of the image.
 
typedef PowerMap< TWeightImage, TPSeparableMetric > Parent
 
typedef DefaultConstImageRange< SelfConstRange
 Definition of the image constRange.
 
typedef PowerMap< TWeightImage, TPSeparableMetric, TImageContainer >::Domain Domain
 Definition of the image value type.
 
- Public Types inherited from DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >
typedef TWeightImage WeightImage
 Copy of the distance image types.
 
typedef TWeightImage::Value Weight
 
typedef WeightImage::Domain::Space Space
 
typedef Space::Vector Vector
 
typedef Space::Point Point
 
typedef Space::Dimension Dimension
 
typedef Space::Size Size
 
typedef Space::Point::Coordinate Abscissa
 
typedef TImageContainer::Domain Domain
 Definition of the underlying domain type.
 
typedef TPowerSeparableMetric PowerSeparableMetric
 We construct the type associated to the separable metric.
 
typedef TImageContainer OutputImage
 Type of resulting image.
 
typedef Vector Value
 Definition of the image model value type.
 
typedef OutputImage::ConstRange ConstRange
 Definition of the image value type.
 
typedef PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainerSelf
 Self type.
 
typedef std::array< bool, Space::dimensionPeriodicitySpec
 Periodicity specification type.
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CImage< ImageContainer >))
 
 ReverseDistanceTransformation (ConstAlias< Domain > aDomain, ConstAlias< WeightImage > aWeightImage, ConstAlias< PowerSeparableMetric > aMetric)
 
 ReverseDistanceTransformation (ConstAlias< Domain > aDomain, ConstAlias< WeightImage > aWeightImage, ConstAlias< PowerSeparableMetric > aMetric, typename Parent::PeriodicitySpec const &aPeriodicitySpec)
 
 ~ReverseDistanceTransformation ()
 
const Domaindomain () const
 
ConstRange constRange () const
 
Value operator() (const Point &aPoint) const
 
Vector getPowerVector (const Point &aPoint) const
 
const PowerSeparableMetricmetricPtr () const
 
void selfDisplay (std::ostream &out) const
 
- Public Member Functions inherited from DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >
 BOOST_CONCEPT_ASSERT ((concepts::CImage< TImageContainer >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CConstImage< TWeightImage >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CPowerSeparableMetric< TPowerSeparableMetric >))
 
 BOOST_STATIC_ASSERT ((boost::is_same< typename TWeightImage::Domain::Space, typename TImageContainer::Domain::Space >::value))
 
 BOOST_STATIC_ASSERT ((boost::is_same< typename TWeightImage::Domain::Space::Vector, typename TImageContainer::Value >::value))
 
 BOOST_STATIC_ASSERT ((boost::is_same< HyperRectDomain< typename TWeightImage::Domain::Space >, typename TImageContainer::Domain >::value))
 
 PowerMap (ConstAlias< Domain > aDomain, ConstAlias< WeightImage > aWeightImage, ConstAlias< PowerSeparableMetric > aMetric)
 
 PowerMap (ConstAlias< Domain > aDomain, ConstAlias< WeightImage > aWeightImage, ConstAlias< PowerSeparableMetric > aMetric, PeriodicitySpec const &aPeriodicitySpec)
 
 PowerMap ()=delete
 
 ~PowerMap ()=default
 
Selfoperator= (const Self &aOtherPowerMap)=default
 
const Domaindomain () const
 
ConstRange constRange () const
 
Value operator() (const Point &aPoint) const
 
const PowerSeparableMetricmetricPtr () const
 
const WeightImageweightImagePtr () const
 
PeriodicitySpec const & getPeriodicitySpec () const
 
bool isPeriodic (const Dimension n) const
 
Point projectPoint (Point aPoint) const
 
void selfDisplay (std::ostream &out) const
 

Protected Member Functions

 ReverseDistanceTransformation ()
 

Additional Inherited Members

- Protected Attributes inherited from DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >
const PowerSeparableMetricmyMetricPtr
 Pointer to the separable metric instance.
 
CountedPtr< OutputImagemyImagePtr
 Power map image.
 
const WeightImagemyWeightImagePtr
 Pointer to the point predicate.
 
PeriodicitySpec myPeriodicitySpec
 Periodicity along each dimension.
 

Detailed Description

template<typename TWeightImage, typename TPSeparableMetric, typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
class DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >

Aim: Implementation of the linear in time reverse distance transformation for separable metrics.

Description of template class 'ReverseDistanceTransformation'

This class is a wrapper around a power map construction (see PowerMap). More precisely, at a point p, since the PowerMap at p returns a vector to the closest power site, this class adapts the operator() in order to returns the power distance to the closest weighted site for the considered metric.

Please refer to PowerMap documentation for details on the computational cost and parameter description.

This class is a model of CConstImage.

Template Parameters
TWeightImagemodel of CConstImage
TPSeparableMetricmodel of CPowerSeparableMetric
TImageContainerany model of CImage to store the PowerMap (default: ImageContainerBySTLVector). The space of the image container and the TSpace should match. Furthermore the container value type must be TSpace::Vector.

Definition at line 93 of file ReverseDistanceTransformation.h.

Member Typedef Documentation

◆ ConstRange

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
typedef DefaultConstImageRange<Self> DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::ConstRange

Definition of the image constRange.

Definition at line 129 of file ReverseDistanceTransformation.h.

◆ Domain

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
typedef PowerMap<TWeightImage,TPSeparableMetric,TImageContainer>::Domain DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::Domain

Definition of the image value type.

Definition at line 134 of file ReverseDistanceTransformation.h.

◆ ImageContainer

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
typedef TImageContainer DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::ImageContainer

Image Container type.

Definition at line 106 of file ReverseDistanceTransformation.h.

◆ Parent

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
typedef PowerMap<TWeightImage,TPSeparableMetric> DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::Parent

Definition at line 126 of file ReverseDistanceTransformation.h.

◆ Point

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
typedef TWeightImage::Domain::Space::Point DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::Point

Point type.

Definition at line 113 of file ReverseDistanceTransformation.h.

◆ PowerSeparableMetric

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
typedef TPSeparableMetric DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::PowerSeparableMetric

Separable Metric type.

Definition at line 103 of file ReverseDistanceTransformation.h.

◆ Self

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
typedef ReverseDistanceTransformation<TWeightImage, TPSeparableMetric, TImageContainer> DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::Self

Definition of the image.

Definition at line 124 of file ReverseDistanceTransformation.h.

◆ Value

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
typedef PowerSeparableMetric::Value DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::Value

Separable Metric type value type.

Definition at line 110 of file ReverseDistanceTransformation.h.

◆ Vector

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
typedef TWeightImage::Domain::Space::Vector DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::Vector

Vector type.

Definition at line 116 of file ReverseDistanceTransformation.h.

◆ Weight

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
typedef PowerSeparableMetric::Weight DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::Weight

Separable Metric type weight type.

Definition at line 119 of file ReverseDistanceTransformation.h.

◆ WeightImage

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
typedef TWeightImage DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::WeightImage

Separable Metric type.

Definition at line 100 of file ReverseDistanceTransformation.h.

Constructor & Destructor Documentation

◆ ReverseDistanceTransformation() [1/3]

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::ReverseDistanceTransformation ( ConstAlias< Domain > aDomain,
ConstAlias< WeightImage > aWeightImage,
ConstAlias< PowerSeparableMetric > aMetric )
inline

Constructor in the non-periodic case.

See documentation of PowerMap constructor.

Definition at line 142 of file ReverseDistanceTransformation.h.

144 :
146 aWeightImage,
147 aMetric)
148 {}
PowerMap()=delete

◆ ReverseDistanceTransformation() [2/3]

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::ReverseDistanceTransformation ( ConstAlias< Domain > aDomain,
ConstAlias< WeightImage > aWeightImage,
ConstAlias< PowerSeparableMetric > aMetric,
typename Parent::PeriodicitySpec const & aPeriodicitySpec )
inline

Constructor with periodicity specification.

See documentation of PowerMap constructor.

Definition at line 155 of file ReverseDistanceTransformation.h.

160 aWeightImage,
161 aMetric,
162 aPeriodicitySpec)
163 {}

◆ ~ReverseDistanceTransformation()

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::~ReverseDistanceTransformation ( )
inline

Default destructor

Definition at line 168 of file ReverseDistanceTransformation.h.

168{};

◆ ReverseDistanceTransformation() [3/3]

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::ReverseDistanceTransformation ( )
protected

Default Constructor.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CImage< ImageContainer >) )

◆ constRange()

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
ConstRange DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::constRange ( ) const
inline

Returns a const range on the ReverseDistanceMap values.

Returns
a const range

Definition at line 186 of file ReverseDistanceTransformation.h.

187 {
188 return ConstRange(*this);
189 }
DefaultConstImageRange< Self > ConstRange
Definition of the image constRange.

◆ domain()

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
const Domain & DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::domain ( ) const
inline

Returns a const range on the ReverseDistanceMap values.

Returns
a const range

Definition at line 177 of file ReverseDistanceTransformation.h.

178 {
179 return Parent::domain();
180 }
const Domain & domain() const
Definition PowerMap.h:239

References DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >::domain().

◆ getPowerVector()

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
Vector DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::getPowerVector ( const Point & aPoint) const
inline

Access to a ReverseDistanceMap value (a.k.a. the norm of the associated Voronoi vector) at a point.

Parameters
aPointthe point to probe.

Definition at line 210 of file ReverseDistanceTransformation.h.

211 {
212 return this->myImagePtr->operator()(aPoint);
213 }
CountedPtr< OutputImage > myImagePtr
Power map image.
Definition PowerMap.h:408
const Point aPoint(3, 4)

References aPoint(), and DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >::myImagePtr.

◆ metricPtr()

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
const PowerSeparableMetric * DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::metricPtr ( ) const
inline
Returns
Returns the underlying metric.

Definition at line 218 of file ReverseDistanceTransformation.h.

219 {
220 return Parent::metricPtr();
221 }
const PowerSeparableMetric * metricPtr() const
Definition PowerMap.h:267

References DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >::metricPtr().

◆ operator()()

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
Value DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::operator() ( const Point & aPoint) const
inline

Access to a ReverseDistanceMap value (a.k.a. the norm of the associated Power vector) at a point.

Parameters
aPointthe point to probe.

Definition at line 197 of file ReverseDistanceTransformation.h.

198 {
199 return this->myMetricPtr->powerDistance(aPoint,
200 this->myImagePtr->operator()(aPoint),
201 this->myWeightImagePtr->operator()( this->myImagePtr->operator()(aPoint)));
202 }
const PowerSeparableMetric * myMetricPtr
Pointer to the separable metric instance.
Definition PowerMap.h:405

References aPoint(), DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >::myImagePtr, and DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >::myMetricPtr.

◆ selfDisplay()

template<typename TWeightImage , typename TPSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<typename TWeightImage::Domain::Space>, typename TWeightImage::Domain::Space::Vector>>
void DGtal::ReverseDistanceTransformation< TWeightImage, TPSeparableMetric, TImageContainer >::selfDisplay ( std::ostream & out) const
inline

Self Display method.

Parameters
outoutput stream

Definition at line 228 of file ReverseDistanceTransformation.h.

229 {
230 out << "[ReverseDistanceTransformation] underlying PowerMap={";
232 out << "}";
233 }
void selfDisplay(std::ostream &out) const

References DGtal::PowerMap< TWeightImage, TPowerSeparableMetric, TImageContainer >::selfDisplay().


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