DGtal  1.4.beta
VoronoiCovarianceMeasureOnDigitalSurface.h
1 
17 #pragma once
18 
31 #if defined(VoronoiCovarianceMeasureOnDigitalSurface_RECURSES)
32 #error Recursive header files inclusion detected in VoronoiCovarianceMeasureOnDigitalSurface.h
33 #else // defined(VoronoiCovarianceMeasureOnDigitalSurface_RECURSES)
34 
35 #define VoronoiCovarianceMeasureOnDigitalSurface_RECURSES
36 
37 #if !defined VoronoiCovarianceMeasureOnDigitalSurface_h
38 
39 #define VoronoiCovarianceMeasureOnDigitalSurface_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/CountedConstPtrOrConstPtr.h"
46 #include "DGtal/kernel/Point2ScalarFunctors.h"
47 #include "DGtal/math/linalg/EigenDecomposition.h"
48 #include "DGtal/topology/CDigitalSurfaceContainer.h"
49 #include "DGtal/topology/DigitalSurface.h"
50 #include "DGtal/geometry/volumes/distance/CSeparableMetric.h"
51 #include "DGtal/geometry/volumes/estimation/VoronoiCovarianceMeasure.h"
53 
54 namespace DGtal
55 {
56 
59 
61  // template class VoronoiCovarianceMeasureOnDigitalSurface
84  template <typename TDigitalSurfaceContainer, typename TSeparableMetric,
85  typename TKernelFunction>
87  {
90  // ----------------------- public types ------------------------------
91  public:
92  typedef TDigitalSurfaceContainer DigitalSurfaceContainer;
93  typedef TSeparableMetric Metric;
94  typedef TKernelFunction KernelFunction;
98  typedef typename KSpace::SCell SCell;
99  typedef typename KSpace::Space Space;
100  typedef typename KSpace::Point Point;
102  typedef typename VCM::Scalar Scalar;
105  typedef typename VCM::VectorN VectorN;
106  typedef typename VCM::MatrixNN MatrixNN;
107 
109 
111  struct EigenStructure {
114  };
116  struct Normals {
119  };
120  typedef std::map<Point,EigenStructure> Point2EigenStructure;
121  typedef std::map<Surfel,Normals> Surfel2Normals;
122 
123  // ----------------------- Standard services ------------------------------
124  public:
125 
130 
161  Surfel2PointEmbedding _surfelEmbedding,
162  Scalar _R, Scalar _r,
163  KernelFunction chi_r,
164  Scalar t = 2.5, Metric aMetric = Metric(),
165  bool verbose = false );
166 
173  Scalar R() const;
176  Scalar r() const;
177 
181  Scalar radiusTrivial() const;
182 
188  template <typename PointOutputIterator>
189  PointOutputIterator getPoints( PointOutputIterator outIt, Surfel s ) const;
190 
192  const Surfel2Normals& mapSurfel2Normals() const;
193 
197  const Point2EigenStructure& mapPoint2ChiVCM() const;
198 
205  bool getChiVCMEigenvalues( VectorN& values, Surfel s ) const;
206 
214  bool getChiVCMEigenStructure( VectorN& values, MatrixNN& vectors, Surfel s ) const;
215 
216  // ----------------------- Interface --------------------------------------
217  public:
218 
219 
224  void selfDisplay ( std::ostream & out ) const;
225 
230  bool isValid() const;
231 
232  // ------------------------- Protected Datas ------------------------------
233  protected:
250 
251  // ------------------------- Private Datas --------------------------------
252  private:
253 
254  // ------------------------- Hidden services ------------------------------
255  protected:
256 
262 
263  private:
264 
271 
279 
280  // ------------------------- Internals ------------------------------------
281  private:
282 
283  }; // end of class VoronoiCovarianceMeasureOnDigitalSurface
284 
285 
292  template <typename TDigitalSurfaceContainer, typename TSeparableMetric, typename TKernelFunction>
293  std::ostream&
294  operator<< ( std::ostream & out,
296 
297 } // namespace DGtal
298 
299 
301 // Includes inline functions.
302 #include "DGtal/geometry/surfaces/estimation/VoronoiCovarianceMeasureOnDigitalSurface.ih"
303 
304 // //
306 
307 #endif // !defined VoronoiCovarianceMeasureOnDigitalSurface_h
308 
309 #undef VoronoiCovarianceMeasureOnDigitalSurface_RECURSES
310 #endif // else defined(VoronoiCovarianceMeasureOnDigitalSurface_RECURSES)
DGtal::VoronoiCovarianceMeasure< Space, Metric >::Scalar
double Scalar
the type for "real" numbers.
Definition: VoronoiCovarianceMeasure.h:117
DGtal::DigitalSurface::ConstIterator
DigitalSurfaceContainer::SurfelConstIterator ConstIterator
Definition: DigitalSurface.h:163
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::DigitalSurfaceContainer
TDigitalSurfaceContainer DigitalSurfaceContainer
the chosen container
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:92
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::r
Scalar r() const
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::Scalar
VCM::Scalar Scalar
the "real number" type
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:102
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::SCell
KSpace::SCell SCell
the signed cells
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:98
DGtal::DigitalSurface
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
Definition: DigitalSurface.h:139
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::myPt2EigenStructure
Point2EigenStructure myPt2EigenStructure
Stores for each point p its convolved VCM, i.e. VCM( chi_r( p ) )
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:247
DGtal::VoronoiCovarianceMeasureOnDigitalSurface
Aim: This class specializes the Voronoi covariance measure for digital surfaces. It adds notably the ...
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:86
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::mySurfel2Normals
Surfel2Normals mySurfel2Normals
Stores for each surfel its vcm normal and its trivial normal.
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:249
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::Space
KSpace::Space Space
the digital space
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:99
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::isValid
bool isValid() const
DGtal::InnerSpel
@ InnerSpel
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:58
DGtal::EigenDecomposition
Aim: This class provides methods to compute the eigen decomposition of a matrix. Its objective is to ...
Definition: EigenDecomposition.h:86
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::LinearAlgebraTool
EigenDecomposition< KSpace::dimension, Scalar > LinearAlgebraTool
diagonalizer (nD).
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:104
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::operator=
VoronoiCovarianceMeasureOnDigitalSurface & operator=(const VoronoiCovarianceMeasureOnDigitalSurface &other)
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::ConstIterator
Surface::ConstIterator ConstIterator
the iterator for traversing the surface
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:103
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::Normals::vcmNormal
VectorN vcmNormal
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:117
DGtal::Surfel2PointEmbedding
Surfel2PointEmbedding
Possible embeddings for surfel as point(s)
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:58
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::EigenStructure
Structure to hold a diagonalized matrix.
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:111
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::myChi
KernelFunction myChi
The kernel function chi_r.
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:239
DGtal::SignedKhalimskyCell
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Definition: KhalimskySpaceND.h:208
DGtal::concepts::CDigitalSurfaceContainer
Aim: The digital surface container concept describes a minimal set of inner types and methods so as t...
Definition: CDigitalSurfaceContainer.h:127
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::MatrixNN
VCM::MatrixNN MatrixNN
nxn R-matrix
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:106
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::Normals::trivialNormal
VectorN trivialNormal
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:118
DGtal::SpaceND
Definition: SpaceND.h:95
KSpace
Z3i::KSpace KSpace
Definition: testArithmeticalDSSComputerOnSurfels.cpp:48
Surfel
KSpace::SCell Surfel
Definition: testArithmeticalDSSComputerOnSurfels.cpp:50
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::VoronoiCovarianceMeasureOnDigitalSurface
VoronoiCovarianceMeasureOnDigitalSurface()
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::radiusTrivial
Scalar radiusTrivial() const
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::mapSurfel2Normals
const Surfel2Normals & mapSurfel2Normals() const
DGtal::CountedConstPtrOrConstPtr< Surface >
DGtal::SimpleMatrix
Aim: implements basic MxN Matrix services (M,N>=1).
Definition: SimpleMatrix.h:75
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::getPoints
PointOutputIterator getPoints(PointOutputIterator outIt, Surfel s) const
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::Point
KSpace::Point Point
the digital points
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:100
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::mySurfelEmbedding
Surfel2PointEmbedding mySurfelEmbedding
The chosen embedding for the surfels.
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:237
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::Normals
Structure to hold the normals for each surfel (the VCM one and the trivial one).
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:116
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::EigenStructure::values
VectorN values
eigenvalues from the smallest to the biggest
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:112
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::EigenStructure::vectors
MatrixNN vectors
corresponding eigenvectors
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:113
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::VCM
VoronoiCovarianceMeasure< Space, Metric > VCM
the Voronoi Covariance Measure
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:101
DGtal::OuterSpel
@ OuterSpel
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:58
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::myVCM
VCM myVCM
Stores the voronoi covariance measure of the point embedding of the surface.
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:241
DGtal::VoronoiCovarianceMeasure< Space, Metric >
DGtal::Pointels
@ Pointels
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:58
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CDigitalSurfaceContainer< TDigitalSurfaceContainer >))
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::KSpace
DigitalSurfaceContainer::KSpace KSpace
the cellular space
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:96
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::KernelFunction
TKernelFunction KernelFunction
the kernel function
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:94
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::mapPoint2ChiVCM
const Point2EigenStructure & mapPoint2ChiVCM() const
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::Point2EigenStructure
std::map< Point, EigenStructure > Point2EigenStructure
the map Point -> EigenStructure
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:120
DGtal::PointVector< dim, Integer >
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::R
Scalar R() const
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::Surface
DigitalSurface< DigitalSurfaceContainer > Surface
the chosen digital surface
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:95
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::myRadiusTrivial
Scalar myRadiusTrivial
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:245
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::getChiVCMEigenStructure
bool getChiVCMEigenStructure(VectorN &values, MatrixNN &vectors, Surfel s) const
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::Surfel
DigitalSurfaceContainer::Surfel Surfel
the n-1 cells
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:97
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::getChiVCMEigenvalues
bool getChiVCMEigenvalues(VectorN &values, Surfel s) const
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::surface
CountedConstPtrOrConstPtr< Surface > surface() const
the const-aliased digital surface.
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::mySurface
CountedConstPtrOrConstPtr< Surface > mySurface
(possibly secure) alias of the digital surface
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:235
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::~VoronoiCovarianceMeasureOnDigitalSurface
~VoronoiCovarianceMeasureOnDigitalSurface()
DGtal::concepts::CSeparableMetric
Aim: defines the concept of separable metrics.
Definition: CSeparableMetric.h:101
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::Surfel2Normals
std::map< Surfel, Normals > Surfel2Normals
the map Surfel -> Normals
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:121
DGtal::concepts::CUnaryFunctor
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:89
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::VectorN
VCM::VectorN VectorN
n-dimensional R-vector
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:105
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::Metric
TSeparableMetric Metric
the chosen metric
Definition: VoronoiCovarianceMeasureOnDigitalSurface.h:93
DGtal::VoronoiCovarianceMeasureOnDigitalSurface::surfelEmbedding
Surfel2PointEmbedding surfelEmbedding() const
the chosen embedding Surfel -> Point(s)