DGtal  1.5.beta
VCMDigitalSurfaceLocalEstimator.h
1 
17 #pragma once
18 
31 #if defined(VCMDigitalSurfaceLocalEstimator_RECURSES)
32 #error Recursive header files inclusion detected in VCMDigitalSurfaceLocalEstimator.h
33 #else // defined(VCMDigitalSurfaceLocalEstimator_RECURSES)
35 #define VCMDigitalSurfaceLocalEstimator_RECURSES
36 
37 #if !defined VCMDigitalSurfaceLocalEstimator_h
39 #define VCMDigitalSurfaceLocalEstimator_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/geometry/surfaces/estimation/VoronoiCovarianceMeasureOnDigitalSurface.h"
46 #include "DGtal/geometry/surfaces/estimation/VCMGeometricFunctors.h"
48 
49 namespace DGtal
50 {
51 
53  // template class VCMDigitalSurfaceLocalEstimator
80  template <typename TDigitalSurfaceContainer, typename TSeparableMetric,
81  typename TKernelFunction, typename TVCMGeometricFunctor>
83  {
86 
87  // ----------------------- public types ------------------------------
88  public:
90  typedef TDigitalSurfaceContainer DigitalSurfaceContainer;
91  typedef TSeparableMetric Metric;
92  typedef TKernelFunction KernelFunction;
93  typedef TVCMGeometricFunctor VCMGeometricFunctor;
97  typedef typename VCMOnSurface::Surface Surface;
98 
99  // ----------------------- model of CDigitalSurfaceLocalEstimator ----------------
100  typedef typename Surface::Surfel Surfel;
101  typedef typename VCMGeometricFunctor::Quantity Quantity;
102  // ----------------------- other types -----------------------
103  typedef typename Surface::SCell SCell;
105  typedef typename VCMOnSurface::Scalar Scalar;
106 
107  // ----------------------- Standard services ------------------------------
108  public:
109 
114 
119 
125 
131  Self& operator= ( const Self& other );
132 
141 
150 
160 
186  void setParams( Surfel2PointEmbedding surfelEmbedding,
187  const Scalar R, const Scalar r, KernelFunction chi_r,
188  const Scalar t = 2.5, Metric aMetric = Metric(), bool verbose = true );
189 
201  template <typename SurfelConstIterator>
202  void init( const Scalar _h,
203  SurfelConstIterator itb,
204  SurfelConstIterator ite );
205 
211  template <typename SurfelConstIterator>
212  Quantity eval( SurfelConstIterator it ) const;
213 
221  template <typename SurfelConstIterator,typename OutputIterator>
222  OutputIterator eval( SurfelConstIterator itb,
223  SurfelConstIterator ite,
224  OutputIterator result ) const;
225 
230  Scalar h() const;
231 
232  // ----------------------- Interface --------------------------------------
233  public:
234 
239  void selfDisplay ( std::ostream & out ) const;
240 
245  bool isValid() const;
246 
247  // ------------------------- Protected Datas ------------------------------
248  protected:
259 
260  // ------------------------- Private Datas --------------------------------
261  private:
262 
263  // ------------------------- Hidden services ------------------------------
264  protected:
265 
266  private:
267 
268  // ------------------------- Internals ------------------------------------
269  private:
270 
271  }; // end of class VCMDigitalSurfaceLocalEstimator
272 
273 
280  template <typename TDigitalSurfaceContainer, typename TSeparableMetric,
281  typename TKernelFunction, typename TVCMGeometricFunctor>
282  std::ostream&
283  operator<< ( std::ostream & out,
284  const VCMDigitalSurfaceLocalEstimator< TDigitalSurfaceContainer, TSeparableMetric,
285  TKernelFunction, TVCMGeometricFunctor > & object );
286 
287 } // namespace DGtal
288 
289 
291 // Includes inline functions.
292 #include "DGtal/geometry/surfaces/estimation/VCMDigitalSurfaceLocalEstimator.ih"
293 
294 // //
296 
297 #endif // !defined VCMDigitalSurfaceLocalEstimator_h
298 
299 #undef VCMDigitalSurfaceLocalEstimator_RECURSES
300 #endif // else defined(VCMDigitalSurfaceLocalEstimator_RECURSES)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:187
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
DigitalSurfaceContainer::Surfel Surfel
DigitalSurfaceContainer::SurfelConstIterator ConstIterator
DigitalSurfaceContainer::SCell SCell
Aim: This class adapts a VoronoiCovarianceMeasureOnDigitalSurface to be a model of CDigitalSurfaceLoc...
VoronoiCovarianceMeasureOnDigitalSurface< DigitalSurfaceContainer, Metric, KernelFunction > VCMOnSurface
the type of computing the Voronoi covariance measure on a digital surface.
CountedConstPtrOrConstPtr< Surface > mySurface
A (possibly) shared object storing the digital surface.
Quantity eval(SurfelConstIterator it) const
Surface::Surfel Surfel
the signed surface element
BOOST_CONCEPT_ASSERT((concepts::CSeparableMetric< TSeparableMetric >))
VCMDigitalSurfaceLocalEstimator(ConstAlias< Surface > surface)
CountedConstPtrOrConstPtr< VCMOnSurface > myVCMOnSurface
A (possibly) shared object storing the whole Voronoi covariance measure.
Self & operator=(const Self &other)
VCMGeometricFunctor myGeomFct
The geometric functor.
void selfDisplay(std::ostream &out) const
TDigitalSurfaceContainer DigitalSurfaceContainer
the chosen container
VCMGeometricFunctor::Quantity Quantity
the estimation type is given by the geometric functor
void setParams(Surfel2PointEmbedding surfelEmbedding, const Scalar R, const Scalar r, KernelFunction chi_r, const Scalar t=2.5, Metric aMetric=Metric(), bool verbose=true)
VCMDigitalSurfaceLocalEstimator(ConstAlias< VCMOnSurface > aVCMOnSurface)
VCMDigitalSurfaceLocalEstimator< TDigitalSurfaceContainer, TSeparableMetric, TKernelFunction, TVCMGeometricFunctor > Self
my own type
TKernelFunction KernelFunction
the kernel function
BOOST_CONCEPT_ASSERT((concepts::CDigitalSurfaceContainer< TDigitalSurfaceContainer >))
OutputIterator eval(SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator result) const
VCMOnSurface::Scalar Scalar
the "real number" type
VCMOnSurface::Surface Surface
the digital surface
Surfel2PointEmbedding mySurfelEmbedding
the embedding chosen for the surfels.
VCMDigitalSurfaceLocalEstimator(const Self &other)
Surface::ConstIterator ConstIterator
the iterator on surfels
void init(const Scalar _h, SurfelConstIterator itb, SurfelConstIterator ite)
void attach(ConstAlias< Surface > surface)
Aim: This class specializes the Voronoi covariance measure for digital surfaces. It adds notably the ...
CountedPtr< SH3::DigitalSurface > surface
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
Surfel2PointEmbedding
Possible embeddings for surfel as point(s)
Aim: The digital surface container concept describes a minimal set of inner types and methods so as t...
Aim: defines the concept of separable metrics.