DGtal  1.3.beta
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
DGtal::VoronoiMapComplete< TSpace, TPointPredicate, TSeparableMetric, TImageContainer > Class Template Reference

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

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

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 OutputImage::Value Value
 Definition of the image value type. More...
 
typedef OutputImage::ConstRange ConstRange
 Definition of the image value type. More...
 
typedef VoronoiMapComplete< TSpace, TPointPredicate, TSeparableMetric, TImageContainerSelf
 Self type. More...
 
typedef std::array< bool, Space::dimensionPeriodicitySpec
 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< std::set< typename TSpace::Vector >, typename TImageContainer::Value >::value))
 
 BOOST_STATIC_ASSERT ((boost::is_same< HyperRectDomain< TSpace >, typename TImageContainer::Domain >::value))
 
 VoronoiMapComplete (ConstAlias< Domain > aDomain, ConstAlias< PointPredicate > predicate, ConstAlias< SeparableMetric > aMetric)
 
 VoronoiMapComplete (ConstAlias< Domain > aDomain, ConstAlias< PointPredicate > predicate, ConstAlias< SeparableMetric > aMetric, PeriodicitySpec const &aPeriodicitySpec)
 
 ~VoronoiMapComplete ()=default
 
 VoronoiMapComplete ()=delete
 
Selfoperator= (const Self &aOtherVoronoiMap)=default
 
const Domaindomain () const
 
ConstRange constRange () const
 
Value operator() (const Point &aPoint) const
 
const SeparableMetricmetric () const
 
const PeriodicitySpecgetPeriodicitySpec () 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>, std::set<typename TSpace::Vector> >>
class DGtal::VoronoiMapComplete< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >

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

Description of template class 'VoronoiMapComplete'

The algorithm uses a seperable process to construct Voronoi maps which has been described in [81] [31]. Along periodic dimensions, the algorithm is adapted following [32], and uses the co-cyclic site approach from [38].

Given a domain and a point predicate, an instance returns, for each point in the domain, the collection of closest points 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 several sites, all sites will be attached to that point (contrary to the class VoronoiMap that will only keep one of them). This implies a computational overhead:

See nD Volumetric Analysis using Separable Processes documnetation page.

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(f.h.d.n^d)\) for \( n^d\) domains (see class constructor). For Euclidean the \( l_2\) metric, the overall computation is in \( O(f.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(f.h.d.n^d / p)\).

This class is a model of concepts::CConstImage.

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 a random access container on TSpace::Vector. Lastly, the domain of the container must be HyperRectDomain.

Definition at line 135 of file VoronoiMapComplete.h.

Member Typedef Documentation

◆ Abscissa

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

Definition at line 179 of file VoronoiMapComplete.h.

◆ ConstRange

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

Definition of the image value type.

Definition at line 188 of file VoronoiMapComplete.h.

◆ Dimension

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

Definition at line 177 of file VoronoiMapComplete.h.

◆ Domain

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

Definition of the underlying domain type.

Definition at line 167 of file VoronoiMapComplete.h.

◆ IntegerLong

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

Large integer type for SeparableMetricHelper construction.

Definition at line 173 of file VoronoiMapComplete.h.

◆ OutputImage

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

Type of resulting image.

Definition at line 182 of file VoronoiMapComplete.h.

◆ PeriodicitySpec

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

Periodicity specification type.

Definition at line 196 of file VoronoiMapComplete.h.

◆ Point

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

Definition at line 176 of file VoronoiMapComplete.h.

◆ PointPredicate

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

Copy of the point predicate type.

Definition at line 164 of file VoronoiMapComplete.h.

◆ Self

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

Self type.

Definition at line 192 of file VoronoiMapComplete.h.

◆ SeparableMetric

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

Definition of the separable metric type.

Definition at line 170 of file VoronoiMapComplete.h.

◆ Size

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

Definition at line 178 of file VoronoiMapComplete.h.

◆ Space

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

Copy of the space type.

Definition at line 161 of file VoronoiMapComplete.h.

◆ Value

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, std::set<typename TSpace::Vector> >>
typedef OutputImage::Value DGtal::VoronoiMapComplete< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::Value

Definition of the image value type.

Definition at line 185 of file VoronoiMapComplete.h.

◆ Vector

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

Definition at line 175 of file VoronoiMapComplete.h.

Constructor & Destructor Documentation

◆ VoronoiMapComplete() [1/3]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, std::set<typename TSpace::Vector> >>
DGtal::VoronoiMapComplete< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::VoronoiMapComplete ( 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.

◆ VoronoiMapComplete() [2/3]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, std::set<typename TSpace::Vector> >>
DGtal::VoronoiMapComplete< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::VoronoiMapComplete ( 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.

◆ ~VoronoiMapComplete()

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

Default destructor

◆ VoronoiMapComplete() [3/3]

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

Disabling default constructor.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/4]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, std::set<typename TSpace::Vector> >>
DGtal::VoronoiMapComplete< 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>, std::set<typename TSpace::Vector> >>
DGtal::VoronoiMapComplete< 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>, std::set<typename TSpace::Vector> >>
DGtal::VoronoiMapComplete< 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>, std::set<typename TSpace::Vector> >>
DGtal::VoronoiMapComplete< 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>, std::set<typename TSpace::Vector> >>
DGtal::VoronoiMapComplete< 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>, std::set<typename TSpace::Vector> >>
DGtal::VoronoiMapComplete< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::BOOST_STATIC_ASSERT ( (boost::is_same< std::set< typename TSpace::Vector >, typename TImageContainer::Value >::value)  )

◆ BOOST_STATIC_ASSERT() [3/4]

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

◆ BOOST_STATIC_ASSERT() [4/4]

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, std::set<typename TSpace::Vector> >>
DGtal::VoronoiMapComplete< 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.

◆ compute()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, std::set<typename TSpace::Vector> >>
void DGtal::VoronoiMapComplete< 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>, std::set<typename TSpace::Vector> >>
void DGtal::VoronoiMapComplete< 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>, std::set<typename TSpace::Vector> >>
void DGtal::VoronoiMapComplete< 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>, std::set<typename TSpace::Vector> >>
ConstRange DGtal::VoronoiMapComplete< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::constRange ( ) const
inline

Returns a const range on the Voronoi map values.

Returns
a const range

Definition at line 283 of file VoronoiMapComplete.h.

284  {
285  return myImagePtr->constRange();
286  }

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

Referenced by TEST_CASE().

◆ domain()

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

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

Returns
a domain

Definition at line 274 of file VoronoiMapComplete.h.

275  {
276  return *myDomainPtr;
277  }

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

◆ getPeriodicitySpec()

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

Periodicity specification.

Returns
the periodicity specification array.

Definition at line 311 of file VoronoiMapComplete.h.

312  {
313  return myPeriodicitySpec;
314  }

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

◆ isPeriodic()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, std::set<typename TSpace::Vector> >>
bool DGtal::VoronoiMapComplete< 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 321 of file VoronoiMapComplete.h.

322  {
323  return myPeriodicitySpec[ n ];
324  }

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

◆ metric()

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

Definition at line 302 of file VoronoiMapComplete.h.

303  {
304  return myMetricPtr;
305  }

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

◆ operator()()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, std::set<typename TSpace::Vector> >>
Value DGtal::VoronoiMapComplete< 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 294 of file VoronoiMapComplete.h.

295  {
296  return myImagePtr->operator()(aPoint);
297  }

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

◆ operator=()

template<typename TSpace , typename TPointPredicate , typename TSeparableMetric , typename TImageContainer = ImageContainerBySTLVector<HyperRectDomain<TSpace>, std::set<typename TSpace::Vector> >>
Self& DGtal::VoronoiMapComplete< 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>, std::set<typename TSpace::Vector> >>
Point::Coordinate DGtal::VoronoiMapComplete< 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>, std::set<typename TSpace::Vector> >>
Point DGtal::VoronoiMapComplete< 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>, std::set<typename TSpace::Vector> >>
void DGtal::VoronoiMapComplete< TSpace, TPointPredicate, TSeparableMetric, TImageContainer >::selfDisplay ( std::ostream &  out) const

Self Display method.

Parameters
outoutput stream

Field Documentation

◆ myDomainExtent

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

Domain extent.

Definition at line 409 of file VoronoiMapComplete.h.

◆ myDomainPtr

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

Pointer to the computation domain.

Definition at line 391 of file VoronoiMapComplete.h.

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

◆ myImagePtr

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

◆ myInfinity

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

Value to act as a +infinity value.

Definition at line 403 of file VoronoiMapComplete.h.

◆ myLowerBoundCopy

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

Copy of the image lower bound.

Definition at line 397 of file VoronoiMapComplete.h.

◆ myMetricPtr

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

Pointer to the separable metric instance.

Definition at line 414 of file VoronoiMapComplete.h.

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

◆ myPeriodicityIndex

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

Index of the periodic dimensions.

Definition at line 406 of file VoronoiMapComplete.h.

◆ myPeriodicitySpec

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

◆ myPointPredicatePtr

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

Pointer to the point predicate.

Definition at line 394 of file VoronoiMapComplete.h.

◆ myUpperBoundCopy

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

Copy of the image lower bound.

Definition at line 400 of file VoronoiMapComplete.h.


The documentation for this class was generated from the following file:
DGtal::VoronoiMapComplete::myPeriodicitySpec
PeriodicitySpec myPeriodicitySpec
Periodicity along each dimension.
Definition: VoronoiMapComplete.h:420
DGtal::VoronoiMapComplete::myImagePtr
CountedPtr< OutputImage > myImagePtr
Voronoi map image.
Definition: VoronoiMapComplete.h:417
aPoint
const Point aPoint(3, 4)
DGtal::ImageContainerBySTLVector::constRange
ConstRange constRange() const
DGtal::VoronoiMapComplete::myMetricPtr
const SeparableMetric * myMetricPtr
Pointer to the separable metric instance.
Definition: VoronoiMapComplete.h:414
DGtal::VoronoiMapComplete::myDomainPtr
const Domain * myDomainPtr
Pointer to the computation domain.
Definition: VoronoiMapComplete.h:391