DGtal  1.4.beta
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer > Class Template Reference

Aim: Implementation of the linear in time Voronoi map construction. More...

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

Inheritance diagram for DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >:
[legend]

Public Types

typedef TSpace Space
 Copy of the space type. More...
 
typedef TPointPredicate PointPredicate
 Copy of the point predicate type. More...
 
typedef TImageContainer::Domain Domain
 Definition of the underlying domain type. More...
 
typedef TSeparableMetric SeparableMetric
 Definition of the separable metric type. More...
 
typedef DGtal::int64_t IntegerLong
 Large integer type for SeparableMetricHelper construction. More...
 
typedef Space::Vector Vector
 
typedef Space::Point Point
 
typedef Space::Dimension Dimension
 
typedef Space::Size Size
 
typedef Space::Point::Coordinate Abscissa
 
typedef TImageContainer OutputImage
 Type of resulting image. More...
 
typedef Vector Value
 Definition of the image value type. More...
 
typedef OutputImage::ConstRange ConstRange
 Definition of the image value type. More...
 
typedef VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainerSelf
 Self type. More...
 
typedef std::array< bool, Space::dimension > PeriodicitySpec
 Periodicity specification type. More...
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CSpace< TSpace >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CPointPredicate< TPointPredicate >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CSeparableMetric< TSeparableMetric >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CImage< TImageContainer >))
 
 BOOST_STATIC_ASSERT ((boost::is_same< typename TSpace::Point, typename TPointPredicate::Point >::value))
 Both Space points and PointPredicate points must be the same. More...
 
 BOOST_STATIC_ASSERT ((boost::is_same< TSpace, typename TImageContainer::Domain::Space >::value))
 
 BOOST_STATIC_ASSERT ((boost::is_same< typename TSpace::Vector, typename TImageContainer::Value >::value))
 
 BOOST_STATIC_ASSERT ((boost::is_same< HyperRectDomain< TSpace >, typename TImageContainer::Domain >::value))
 
 VoronoiMap (ConstAlias< Domain > aDomain, ConstAlias< PointPredicate > predicate, ConstAlias< SeparableMetric > aMetric)
 
 VoronoiMap (ConstAlias< Domain > aDomain, ConstAlias< PointPredicate > predicate, ConstAlias< SeparableMetric > aMetric, PeriodicitySpec const &aPeriodicitySpec)
 
 ~VoronoiMap ()=default
 
 VoronoiMap ()=delete
 
Selfoperator= (const Self &aOtherVoronoiMap)=default
 
const Domaindomain () const
 
ConstRange constRange () const
 
Value operator() (const Point &aPoint) const
 
const SeparableMetricmetric () const
 
PeriodicitySpec const & getPeriodicitySpec () const
 
bool isPeriodic (const Dimension n) const
 
Point projectPoint (Point aPoint) const
 
void selfDisplay (std::ostream &out) const
 

Protected Attributes

const SeparableMetricmyMetricPtr
 Pointer to the separable metric instance. More...
 
CountedPtr< OutputImagemyImagePtr
 Voronoi map image. More...
 
PeriodicitySpec myPeriodicitySpec
 Periodicity along each dimension. More...
 

Private Member Functions

void compute ()
 
void computeOtherSteps (const Dimension dim) const
 
void computeOtherStep1D (const Point &row, const Dimension dim) const
 
Point::Coordinate projectCoordinate (typename Point::Coordinate aCoordinate, const Dimension aDim) const
 

Private Attributes

const DomainmyDomainPtr
 Pointer to the computation domain. More...
 
const PointPredicatemyPointPredicatePtr
 Pointer to the point predicate. More...
 
Point myLowerBoundCopy
 Copy of the image lower bound. More...
 
Point myUpperBoundCopy
 Copy of the image lower bound. More...
 
Point myInfinity
 Value to act as a +infinity value. More...
 
std::vector< DimensionmyPeriodicityIndex
 Index of the periodic dimensions. More...
 
Point myDomainExtent
 Domain extent. More...
 

Detailed Description

template<typename TSpace, typename TPointPredicate, typename TSeparableMetric, typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
class DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >

Aim: Implementation of the linear in time Voronoi map construction.

Description of template class 'VoronoiMap'

The algorithm uses a seperable process to construct Voronoi maps which has been described in [84] [32]. Along periodic dimensions, the algorithm is adapted following [33].

Given a domain and a point predicate, an instance returns, for each point in the domain, the closest point for which the predicate is false. Following Computational Geometry terminology, points for which the predicate is false are "sites" for the Voronoi map construction. If a point is equi-distant to two sites (e.g. if the digital point belong to a Voronoi cell boundary in the Euclidean space), this Voronoi map construction will only keep one of them.

By default, the domain is considered non-periodic but per-dimension periodicity can be specified in the constructor. When the domain has periodic dimensions, the closest point coordinates B to a given point A may not be between the lower and upper bounds of the domain, in such a way that the non-periodic distance between A and B is equal to their distance considering the periodicity.

The metric is specified by a model of concepts::CSeparableMetric (for instance, any instance of ExactPredicateLpSeparableMetric or InexactPredicateLpSeparableMetric). If the separable metric has a complexity of O(h) for its "hiddenBy" predicate, the overall Voronoi construction algorithm is in \( O(h.d.n^d)\) for \( n^d\) domains (see class constructor). For Euclidean the \( l_2\) metric, the overall computation is in \( O(d.n^d)\), which is optimal.

If DGtal has been built with OpenMP support (WITH_OPENMP flag set to "true"), the computation is done in parallel (multithreaded) in an optimal way: on p processors, expected runtime is in \( O(h.d.n^d / p)\).

This class is a model of concepts::CConstImage.

See also
  Volumetric Analysis on Toric domains
Template Parameters
TSpacetype of Digital Space (model of concepts::CSpace).
TPointPredicatepoint predicate returning true for points from which we compute the distance (model of concepts::CPointPredicate)
TSeparableMetrica model of concepts::CSeparableMetric
TImageContainerany model of concepts::CImage to store the VoronoiMap (default: ImageContainerBySTLVector). The space of the image container and the TSpace should match. Furthermore the container value type must be TSpace::Vector. Lastly, the domain of the container must be HyperRectDomain.

Definition at line 126 of file VoronoiMap.h.

Member Typedef Documentation

◆ Abscissa

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef Space::Point::Coordinate DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::Abscissa

Definition at line 170 of file VoronoiMap.h.

◆ ConstRange

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef OutputImage::ConstRange DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::ConstRange

Definition of the image value type.

Definition at line 179 of file VoronoiMap.h.

◆ Dimension

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef Space::Dimension DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::Dimension

Definition at line 168 of file VoronoiMap.h.

◆ Domain

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef TImageContainer::Domain DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::Domain

Definition of the underlying domain type.

Definition at line 158 of file VoronoiMap.h.

◆ IntegerLong

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef DGtal::int64_t DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::IntegerLong

Large integer type for SeparableMetricHelper construction.

Definition at line 164 of file VoronoiMap.h.

◆ OutputImage

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef TImageContainer DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::OutputImage

Type of resulting image.

Definition at line 173 of file VoronoiMap.h.

◆ PeriodicitySpec

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef std::array< bool, Space::dimension > DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::PeriodicitySpec

Periodicity specification type.

Definition at line 187 of file VoronoiMap.h.

◆ Point

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef Space::Point DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::Point

Definition at line 167 of file VoronoiMap.h.

◆ PointPredicate

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef TPointPredicate DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::PointPredicate

Copy of the point predicate type.

Definition at line 155 of file VoronoiMap.h.

◆ Self

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef VoronoiMap< TSpace, TPointPredicate, TSeparableMetric,TImageContainer > DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::Self

Self type.

Definition at line 183 of file VoronoiMap.h.

◆ SeparableMetric

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef TSeparableMetric DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::SeparableMetric

Definition of the separable metric type.

Definition at line 161 of file VoronoiMap.h.

◆ Size

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef Space::Size DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::Size

Definition at line 169 of file VoronoiMap.h.

◆ Space

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef TSpace DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::Space

Copy of the space type.

Definition at line 152 of file VoronoiMap.h.

◆ Value

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef Vector DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::Value

Definition of the image value type.

Definition at line 176 of file VoronoiMap.h.

◆ Vector

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
typedef Space::Vector DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::Vector

Definition at line 166 of file VoronoiMap.h.

Constructor & Destructor Documentation

◆ VoronoiMap() [1/3]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::VoronoiMap ( ConstAlias< Domain aDomain,
ConstAlias< PointPredicate predicate,
ConstAlias< SeparableMetric aMetric 
)

Constructor in the non-periodic case.

This constructor computes the Voronoi Map of a set of point sites using a SeparableMetric metric, on a non-periodic domain.

The method associates to each point satisfying the foreground predicate, the closest site for which the predicate is false. This algorithm is \( O(h.d.|domain size|)\) if the separable metric "hiddenBy" predicate is in \( O(h)\).

Parameters
aDomaina pointer to the (hyper-rectangular) domain on which the computation is performed.
predicatea pointer to the point predicate to define the Voronoi sites (false points).
aMetrica pointer to the separable metric instance.

◆ VoronoiMap() [2/3]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::VoronoiMap ( ConstAlias< Domain aDomain,
ConstAlias< PointPredicate predicate,
ConstAlias< SeparableMetric aMetric,
PeriodicitySpec const &  aPeriodicitySpec 
)

Constructor with periodicity specification.

This constructor computes the Voronoi Map of a set of point sites using a SeparableMetric metric, on a domain with specified periodicity.

The method associates to each point satisfying the foreground predicate, the closest site for which the predicate is false. This algorithm is \( O(h.d.|domain size|)\) if the separable metric "hiddenBy" predicate is in \( O(h)\).

Parameters
aDomaina pointer to the (hyper-rectangular) domain on which the computation is performed.
predicatea pointer to the point predicate to define the Voronoi sites (false points).
aMetrica pointer to the separable metric instance.
aPeriodicitySpecan array of size equal to the space dimension where the i-th value is true if the i-th dimension of the space is periodic, false otherwise.

◆ ~VoronoiMap()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::~VoronoiMap ( )
default

Default destructor

◆ VoronoiMap() [3/3]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::VoronoiMap ( )
delete

Disabling default constructor.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/4]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CImage< TImageContainer >)  )

◆ BOOST_CONCEPT_ASSERT() [2/4]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CPointPredicate< TPointPredicate >)  )

◆ BOOST_CONCEPT_ASSERT() [3/4]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CSeparableMetric< TSeparableMetric >)  )

◆ BOOST_CONCEPT_ASSERT() [4/4]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >)  )

◆ BOOST_STATIC_ASSERT() [1/4]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::BOOST_STATIC_ASSERT ( (boost::is_same< HyperRectDomain< TSpace >, typename TImageContainer::Domain >::value)  )

◆ BOOST_STATIC_ASSERT() [2/4]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::BOOST_STATIC_ASSERT ( (boost::is_same< TSpace, typename TImageContainer::Domain::Space >::value)  )

◆ BOOST_STATIC_ASSERT() [3/4]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::BOOST_STATIC_ASSERT ( (boost::is_same< typename TSpace::Point, typename TPointPredicate::Point >::value)  )

Both Space points and PointPredicate points must be the same.

◆ BOOST_STATIC_ASSERT() [4/4]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::BOOST_STATIC_ASSERT ( (boost::is_same< typename TSpace::Vector, typename TImageContainer::Value >::value)  )

◆ compute()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
void DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::compute ( )
private

Compute the Voronoi Map of a set of point sites using a SeparableMetric metric. The method associates to each point satisfying the foreground predicate, the closest site for which the predicate is false. This algorithm is O(h.d.|domain size|).

◆ computeOtherStep1D()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
void DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::computeOtherStep1D ( const Point row,
const Dimension  dim 
) const
private

Given a voronoi map valid at dimension dim-1, this method updates the map to make it consistent at dimension dim along the 1D span starting at row along the dimension dim.

Parameters
[in]rowstarting point of the 1D process.
[in]dimdimension of the update.

◆ computeOtherSteps()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
void DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::computeOtherSteps ( const Dimension  dim) const
private

Compute the other steps of the separable Voronoi map.

Parameters
[in]dimthe dimension to process

◆ constRange()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
ConstRange DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::constRange ( ) const
inline

Returns a const range on the Voronoi map values.

Returns
a const range

Definition at line 274 of file VoronoiMap.h.

275  {
276  return myImagePtr->constRange();
277  }
CountedPtr< OutputImage > myImagePtr
Voronoi map image.
Definition: VoronoiMap.h:409

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::constRange(), and DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myImagePtr.

◆ domain()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
const Domain& DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::domain ( ) const
inline

Returns a reference (const) to the Voronoi map domain.

Returns
a domain

Definition at line 265 of file VoronoiMap.h.

266  {
267  return *myDomainPtr;
268  }
const Domain * myDomainPtr
Pointer to the computation domain.
Definition: VoronoiMap.h:383

References DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myDomainPtr.

Referenced by DGtal::DistanceTransformation< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::domain().

◆ getPeriodicitySpec()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
PeriodicitySpec const& DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::getPeriodicitySpec ( ) const
inline

Periodicity specification.

Returns
the periodicity specification array.

Definition at line 302 of file VoronoiMap.h.

303  {
304  return myPeriodicitySpec;
305  }
PeriodicitySpec myPeriodicitySpec
Periodicity along each dimension.
Definition: VoronoiMap.h:412

References DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myPeriodicitySpec.

◆ isPeriodic()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
bool DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::isPeriodic ( const Dimension  n) const
inline

Periodicity specification along one dimensions.

Parameters
[in]nthe dimension index.
Returns
true if the n-th dimension is periodic, false otherwise.

Definition at line 312 of file VoronoiMap.h.

313  {
314  return myPeriodicitySpec[ n ];
315  }

References DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myPeriodicitySpec.

◆ metric()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
const SeparableMetric* DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::metric ( ) const
inline
Returns
Returns an alias to the underlying metric.

Definition at line 293 of file VoronoiMap.h.

294  {
295  return myMetricPtr;
296  }
const SeparableMetric * myMetricPtr
Pointer to the separable metric instance.
Definition: VoronoiMap.h:406

References DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myMetricPtr.

Referenced by DGtal::DistanceTransformation< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::metric().

◆ operator()()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
Value DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::operator() ( const Point aPoint) const
inline

Access to a Voronoi value (a.k.a. vector to the closest site) at a point.

Parameters
aPointthe point to probe.

Definition at line 285 of file VoronoiMap.h.

286  {
287  return myImagePtr->operator()(aPoint);
288  }
const Point aPoint(3, 4)

References aPoint(), and DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myImagePtr.

◆ operator=()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
Self& DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::operator= ( const Self aOtherVoronoiMap)
default

Assignment operator from another Voronoi map.

Parameters
aOtherVoronoiMapanother instance of Self
Returns
a reference to Self

◆ projectCoordinate()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
Point::Coordinate DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::projectCoordinate ( typename Point::Coordinate  aCoordinate,
const Dimension  aDim 
) const
private

Project a coordinate into the domain, taking into account the periodicity.

Precondition
The given coordinate must come from operator()(const Point &) const (for performance reasons).
Parameters
aCoordinatethe coordinate.
aDimdimension of the coordinate.
Returns
the coordinates projected into the domain bounds accordingly to the periodicity specification.

◆ projectPoint()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
Point DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::projectPoint ( Point  aPoint) const

Project point coordinates into the domain, taking into account the periodicity.

Precondition
The given point must come from operator()(const Point &) const (for performance reasons).
Parameters
aPointthe point to project
Returns
the coordinates projected into the domain bounds accordingly to the periodicity specification.

◆ selfDisplay()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
void DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::selfDisplay ( std::ostream &  out) const

Field Documentation

◆ myDomainExtent

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
Point DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myDomainExtent
private

Domain extent.

Definition at line 401 of file VoronoiMap.h.

◆ myDomainPtr

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
const Domain* DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myDomainPtr
private

Pointer to the computation domain.

Definition at line 383 of file VoronoiMap.h.

Referenced by DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::domain().

◆ myImagePtr

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
CountedPtr<OutputImage> DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myImagePtr
protected

◆ myInfinity

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
Point DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myInfinity
private

Value to act as a +infinity value.

Definition at line 395 of file VoronoiMap.h.

◆ myLowerBoundCopy

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
Point DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myLowerBoundCopy
private

Copy of the image lower bound.

Definition at line 389 of file VoronoiMap.h.

◆ myMetricPtr

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
const SeparableMetric* DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myMetricPtr
protected

Pointer to the separable metric instance.

Definition at line 406 of file VoronoiMap.h.

Referenced by DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::metric().

◆ myPeriodicityIndex

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
std::vector< Dimension > DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myPeriodicityIndex
private

Index of the periodic dimensions.

Definition at line 398 of file VoronoiMap.h.

◆ myPeriodicitySpec

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
PeriodicitySpec DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myPeriodicitySpec
protected

◆ myPointPredicatePtr

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
const PointPredicate* DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myPointPredicatePtr
private

Pointer to the point predicate.

Definition at line 386 of file VoronoiMap.h.

◆ myUpperBoundCopy

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, typename TSpace::Vector>>
Point DGtal::VoronoiMap< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::myUpperBoundCopy
private

Copy of the image lower bound.

Definition at line 392 of file VoronoiMap.h.


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