DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric > Class Template Reference

Aim: This class precomputes the Voronoi Covariance Measure of a set of points. It can compute the covariance measure of an arbitrary function with given support. More...

#include <DGtal/geometry/volumes/estimation/VoronoiCovarianceMeasure.h>

Inheritance diagram for DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >:
[legend]

Data Structures

struct  CharacteristicSetPredicate
 

Public Types

typedef TSpace Space
 the type of digital space
 
typedef TSeparableMetric Metric
 the type of metric
 
typedef Space::Point Point
 the type of digital point
 
typedef Space::Size Size
 the type for counting elements
 
typedef Space::Integer Integer
 the type of each digital point coordinate, some integral type
 
typedef DGtal::HyperRectDomain< SpaceDomain
 the type of rectangular domain of the VCM.
 
typedef DGtal::ImageContainerBySTLVector< Domain, bool > CharacteristicSet
 the type of a binary image that is the characteristic function of K.
 
typedef DGtal::SpatialCubicalSubdivision< SpaceProximityStructure
 the structure used for proximity queries.
 
typedef DGtal::functors::NotPointPredicate< CharacteristicSetPredicateNotPredicate
 the type of the point predicate used by the voronoi map.
 
typedef DGtal::VoronoiMap< Space, NotPredicate, MetricVoronoi
 the type of the Voronoi map.
 
typedef double Scalar
 the type for "real" numbers.
 
typedef DGtal::SimpleMatrix< Scalar, Space::dimension, Space::dimensionMatrixNN
 the type for nxn matrix of real numbers.
 
typedef MatrixNN::RowVector VectorN
 the type for N-vector of real numbers
 
typedef std::vector< PointPointContainer
 the list of points
 
typedef std::map< Point, MatrixNNPoint2MatrixNN
 Associates a matrix to points.
 

Public Member Functions

 VoronoiCovarianceMeasure (double _R, double _r, Metric aMetric=Metric(), bool verbose=false)
 
 ~VoronoiCovarianceMeasure ()
 
Scalar R () const
 
Scalar r () const
 
void clean ()
 
template<typename PointInputIterator >
void init (PointInputIterator itb, PointInputIterator ite)
 
const Domaindomain () const
 
const VoronoivoronoiMap () const
 
const Point2MatrixNNvcmMap () const
 
template<typename Point2ScalarFunction >
MatrixNN measure (Point2ScalarFunction chi_r, Point p) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

 VoronoiCovarianceMeasure ()
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CSpace< TSpace >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CSeparableMetric< TSeparableMetric >))
 
 VoronoiCovarianceMeasure (const VoronoiCovarianceMeasure &other)
 
VoronoiCovarianceMeasureoperator= (const VoronoiCovarianceMeasure &other)
 

Private Attributes

double myBigR
 The parameter R in the VCM, i.e. the offset radius for the compact set K.
 
double mySmallR
 
Metric myMetric
 The metric chosen for the Voronoi map.
 
bool myVerbose
 Tells if it is verbose mode.
 
Domain myDomain
 The domain in which all computations are done.
 
CharacteristicSetmyCharSet
 A binary image that defines the characteristic set of K.
 
VoronoimyVoronoi
 Stores the voronoi map.
 
Point2MatrixNN myVCM
 The map point -> VCM.
 
ProximityStructuremyProximityStructure
 The structure used for proximity queries.
 

Detailed Description

template<typename TSpace, typename TSeparableMetric>
class DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >

Aim: This class precomputes the Voronoi Covariance Measure of a set of points. It can compute the covariance measure of an arbitrary function with given support.

Description of template class 'VoronoiCovarianceMeasure'

You may obtain the whole sequence (Point,VCM) by accessing the map vcmMap.

Note
Documentation in Computing the Voronoi Covariance Measure of a point set.
Template Parameters
TSpacetype of Digital Space (model of CSpace).
TSeparableMetrica model of CSeparableMetric used for computing the Voronoi map (e.g. Euclidean metric is DGtal::ExactPredicateLpSeparableMetric<TSpace, 2> )
Examples
geometry/volumes/dvcm-2d.cpp.

Definition at line 79 of file VoronoiCovarianceMeasure.h.

Member Typedef Documentation

◆ CharacteristicSet

template<typename TSpace , typename TSeparableMetric >
typedef DGtal::ImageContainerBySTLVector<Domain,bool> DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::CharacteristicSet

the type of a binary image that is the characteristic function of K.

Definition at line 91 of file VoronoiCovarianceMeasure.h.

◆ Domain

template<typename TSpace , typename TSeparableMetric >
typedef DGtal::HyperRectDomain<Space> DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::Domain

the type of rectangular domain of the VCM.

Definition at line 90 of file VoronoiCovarianceMeasure.h.

◆ Integer

template<typename TSpace , typename TSeparableMetric >
typedef Space::Integer DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::Integer

the type of each digital point coordinate, some integral type

Definition at line 89 of file VoronoiCovarianceMeasure.h.

◆ MatrixNN

template<typename TSpace , typename TSeparableMetric >
typedef DGtal::SimpleMatrix< Scalar, Space::dimension, Space::dimension > DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::MatrixNN

the type for nxn matrix of real numbers.

Definition at line 120 of file VoronoiCovarianceMeasure.h.

◆ Metric

template<typename TSpace , typename TSeparableMetric >
typedef TSeparableMetric DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::Metric

the type of metric

Definition at line 86 of file VoronoiCovarianceMeasure.h.

◆ NotPredicate

template<typename TSpace , typename TSeparableMetric >
typedef DGtal::functors::NotPointPredicate<CharacteristicSetPredicate> DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::NotPredicate

the type of the point predicate used by the voronoi map.

Definition at line 114 of file VoronoiCovarianceMeasure.h.

◆ Point

template<typename TSpace , typename TSeparableMetric >
typedef Space::Point DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::Point

the type of digital point

Definition at line 87 of file VoronoiCovarianceMeasure.h.

◆ Point2MatrixNN

template<typename TSpace , typename TSeparableMetric >
typedef std::map<Point,MatrixNN> DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::Point2MatrixNN

Associates a matrix to points.

Definition at line 123 of file VoronoiCovarianceMeasure.h.

◆ PointContainer

template<typename TSpace , typename TSeparableMetric >
typedef std::vector<Point> DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::PointContainer

the list of points

Definition at line 122 of file VoronoiCovarianceMeasure.h.

◆ ProximityStructure

template<typename TSpace , typename TSeparableMetric >
typedef DGtal::SpatialCubicalSubdivision<Space> DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::ProximityStructure

the structure used for proximity queries.

Definition at line 92 of file VoronoiCovarianceMeasure.h.

◆ Scalar

template<typename TSpace , typename TSeparableMetric >
typedef double DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::Scalar

the type for "real" numbers.

Definition at line 117 of file VoronoiCovarianceMeasure.h.

◆ Size

template<typename TSpace , typename TSeparableMetric >
typedef Space::Size DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::Size

the type for counting elements

Definition at line 88 of file VoronoiCovarianceMeasure.h.

◆ Space

template<typename TSpace , typename TSeparableMetric >
typedef TSpace DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::Space

the type of digital space

Definition at line 85 of file VoronoiCovarianceMeasure.h.

◆ VectorN

template<typename TSpace , typename TSeparableMetric >
typedef MatrixNN::RowVector DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::VectorN

the type for N-vector of real numbers

Definition at line 121 of file VoronoiCovarianceMeasure.h.

◆ Voronoi

template<typename TSpace , typename TSeparableMetric >
typedef DGtal::VoronoiMap<Space, NotPredicate, Metric > DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::Voronoi

the type of the Voronoi map.

Definition at line 115 of file VoronoiCovarianceMeasure.h.

Constructor & Destructor Documentation

◆ VoronoiCovarianceMeasure() [1/3]

template<typename TSpace , typename TSeparableMetric >
DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::VoronoiCovarianceMeasure ( double _R,
double _r,
Metric aMetric = Metric(),
bool verbose = false )

Constructor.

Parameters
_Rthe offset radius for the set of points. Voronoi cells are intersected with this offset. The unit corresponds to a step in the digital space.
_r(an upper bound of) the radius of the support of forthcoming kernel functions ( \( \chi_r \)). The unit corresponds to a step in the digital space. This parameter is used for preparing the data structure that answers to proximity queries.
aMetrican instance of the metric.
verboseif 'true' displays information on ongoing computation.

◆ ~VoronoiCovarianceMeasure()

template<typename TSpace , typename TSeparableMetric >
DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::~VoronoiCovarianceMeasure ( )

Destructor.

◆ VoronoiCovarianceMeasure() [2/3]

template<typename TSpace , typename TSeparableMetric >
DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::VoronoiCovarianceMeasure ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).

◆ VoronoiCovarianceMeasure() [3/3]

template<typename TSpace , typename TSeparableMetric >
DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::VoronoiCovarianceMeasure ( const VoronoiCovarianceMeasure< TSpace, TSeparableMetric > & other)
private

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename TSpace , typename TSeparableMetric >
DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::BOOST_CONCEPT_ASSERT ( (concepts::CSeparableMetric< TSeparableMetric >) )
private

◆ BOOST_CONCEPT_ASSERT() [2/2]

template<typename TSpace , typename TSeparableMetric >
DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >) )
private

◆ clean()

template<typename TSpace , typename TSeparableMetric >
void DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::clean ( )

Cleans intermediate data structure likes the characteristic set and the voronoi map.

Note
Further calls to voronoiMap are no more valid.

◆ domain()

template<typename TSpace , typename TSeparableMetric >
const Domain & DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::domain ( ) const
Returns
the domain of computation

◆ init()

template<typename TSpace , typename TSeparableMetric >
template<typename PointInputIterator >
void DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::init ( PointInputIterator itb,
PointInputIterator ite )

Computes the Voronoi Covariance Measure for the set of points given by range [itb,ite)

Template Parameters
PointInputIteratoran input iterator on digital points.
Parameters
itbthe start of the range
itethe end of the range.
Precondition
itb != ite.
[itb,ite) is a valid range (ite can be reached from itb).

◆ isValid()

template<typename TSpace , typename TSeparableMetric >
bool DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ measure()

template<typename TSpace , typename TSeparableMetric >
template<typename Point2ScalarFunction >
MatrixNN DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::measure ( Point2ScalarFunction chi_r,
Point p ) const

Computes the Voronoi Covariance Measure of the function chi_r.

Template Parameters
Point2ScalarFunctionthe type of a functor Point->Scalar. For instance functors::HatPointFunction and functors::BallConstantPointFunction are models of this type.
Parameters
chi_rthe kernel function whose support is included in the cube centered on the origin with edge size 2r (see VoronoiCovarianceMeasure).
pthe point where the kernel function is moved. It must lie within domain.

◆ operator=()

template<typename TSpace , typename TSeparableMetric >
VoronoiCovarianceMeasure & DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::operator= ( const VoronoiCovarianceMeasure< TSpace, TSeparableMetric > & other)
private

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.

◆ R()

template<typename TSpace , typename TSeparableMetric >
Scalar DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::R ( ) const
Returns
the parameter R in the VCM, i.e. the offset radius for the compact set K.

◆ r()

template<typename TSpace , typename TSeparableMetric >
Scalar DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::r ( ) const
Returns
the parameter r in VCM(chi_r), i.e. an upper bound for the diameter of the support of kernel functions.

◆ selfDisplay()

template<typename TSpace , typename TSeparableMetric >
void DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::selfDisplay ( std::ostream & out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ vcmMap()

template<typename TSpace , typename TSeparableMetric >
const Point2MatrixNN & DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::vcmMap ( ) const
Returns
the Voronoi Covariance Matrix of each Voronoi cell as a map Point -> Matrix
Note
empty if init has not been called.

◆ voronoiMap()

template<typename TSpace , typename TSeparableMetric >
const Voronoi & DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::voronoiMap ( ) const
Returns
the current Voronoi map
Precondition
init must have been called before.

Field Documentation

◆ myBigR

template<typename TSpace , typename TSeparableMetric >
double DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::myBigR
private

The parameter R in the VCM, i.e. the offset radius for the compact set K.

Definition at line 224 of file VoronoiCovarianceMeasure.h.

◆ myCharSet

template<typename TSpace , typename TSeparableMetric >
CharacteristicSet* DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::myCharSet
private

A binary image that defines the characteristic set of K.

Definition at line 235 of file VoronoiCovarianceMeasure.h.

◆ myDomain

template<typename TSpace , typename TSeparableMetric >
Domain DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::myDomain
private

The domain in which all computations are done.

Definition at line 233 of file VoronoiCovarianceMeasure.h.

◆ myMetric

template<typename TSpace , typename TSeparableMetric >
Metric DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::myMetric
private

The metric chosen for the Voronoi map.

Definition at line 229 of file VoronoiCovarianceMeasure.h.

◆ myProximityStructure

template<typename TSpace , typename TSeparableMetric >
ProximityStructure* DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::myProximityStructure
private

The structure used for proximity queries.

Definition at line 241 of file VoronoiCovarianceMeasure.h.

◆ mySmallR

template<typename TSpace , typename TSeparableMetric >
double DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::mySmallR
private

The parameter r in VCM(chi_r), i.e. an upper bound for the diameter of the support of kernel functions.

Definition at line 227 of file VoronoiCovarianceMeasure.h.

◆ myVCM

template<typename TSpace , typename TSeparableMetric >
Point2MatrixNN DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::myVCM
private

The map point -> VCM.

Definition at line 239 of file VoronoiCovarianceMeasure.h.

◆ myVerbose

template<typename TSpace , typename TSeparableMetric >
bool DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::myVerbose
private

Tells if it is verbose mode.

Definition at line 231 of file VoronoiCovarianceMeasure.h.

◆ myVoronoi

template<typename TSpace , typename TSeparableMetric >
Voronoi* DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::myVoronoi
private

Stores the voronoi map.

Definition at line 237 of file VoronoiCovarianceMeasure.h.


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