DGtal  0.9.4beta
Data Structures | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric > Class Template Reference

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

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

Data Structures

struct  CharacteristicSetPredicate
 

Public Types

typedef TSpace Space
 
typedef TSeparableMetric Metric
 
typedef Space::Point Point
 
typedef Space::Size Size
 
typedef Space::Integer Integer
 
typedef DGtal::HyperRectDomain< SpaceDomain
 
typedef DGtal::ImageContainerBySTLVector< Domain, bool > CharacteristicSet
 
typedef DGtal::SpatialCubicalSubdivision< SpaceProximityStructure
 
typedef DGtal::functors::NotPointPredicate< CharacteristicSetPredicateNotPredicate
 
typedef DGtal::VoronoiMap< Space, NotPredicate, MetricVoronoi
 
typedef double Scalar
 
typedef DGtal::SimpleMatrix< Scalar, Space::dimension, Space::dimensionMatrixNN
 
typedef MatrixNN::RowVector VectorN
 
typedef std::vector< PointPointContainer
 
typedef std::map< Point, MatrixNNPoint2MatrixNN
 

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
 
double mySmallR
 
Metric myMetric
 
bool myVerbose
 
Domain myDomain
 
CharacteristicSetmyCharSet
 
VoronoimyVoronoi
 
Point2MatrixNN myVCM
 
ProximityStructuremyProximityStructure
 

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> )

Definition at line 79 of file VoronoiCovarianceMeasure.h.

Member Typedef Documentation

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.

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.

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.

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.

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

the type of metric

Definition at line 86 of file VoronoiCovarianceMeasure.h.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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

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.
template<typename TSpace, typename TSeparableMetric>
DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::~VoronoiCovarianceMeasure ( )

Destructor.

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

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

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

template<typename TSpace, typename TSeparableMetric>
DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >)  )
private
template<typename TSpace, typename TSeparableMetric>
DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::BOOST_CONCEPT_ASSERT ( (concepts::CSeparableMetric< TSeparableMetric >)  )
private
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.
template<typename TSpace, typename TSeparableMetric>
const Domain& DGtal::VoronoiCovarianceMeasure< TSpace, TSeparableMetric >::domain ( ) const
Returns
the domain of computation
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).
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.
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.
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.
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.
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.
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.
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.
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

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.

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.

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.

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.

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.

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.

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

The map point -> VCM.

Definition at line 239 of file VoronoiCovarianceMeasure.h.

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.

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: