DGtal  0.9.2
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)
34 
35 #define VCMDigitalSurfaceLocalEstimator_RECURSES
36 
37 #if !defined VCMDigitalSurfaceLocalEstimator_h
38 
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 
124  VCMDigitalSurfaceLocalEstimator( const Self& other );
125 
131  Self& operator= ( const Self& other );
132 
141 
150 
159  void attach( ConstAlias<Surface> surface );
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:
256  VCMGeometricFunctor myGeomFct;
258  Scalar myH;
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)
TDigitalSurfaceContainer DigitalSurfaceContainer
the chosen container
Aim: This class adapts a VoronoiCovarianceMeasureOnDigitalSurface to be a model of CDigitalSurfaceLoc...
Quantity eval(SurfelConstIterator it) const
DigitalSurfaceContainer::SurfelConstIterator ConstIterator
Surfel2PointEmbedding mySurfelEmbedding
the embedding chosen for the surfels.
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
VCMGeometricFunctor::Quantity Quantity
the estimation type is given by the geometric functor
void init(const Scalar _h, SurfelConstIterator itb, SurfelConstIterator ite)
CountedConstPtrOrConstPtr< Surface > mySurface
A (possibly) shared object storing the digital surface.
Aim: Smart or simple const pointer on T. It can be a smart pointer based on reference counts or a sim...
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
VCMGeometricFunctor myGeomFct
The geometric functor.
VCMOnSurface::Scalar Scalar
the "real number" type
Surface::Surfel Surfel
the signed surface element
DigitalSurfaceContainer::SCell SCell
Aim: This class specializes the Voronoi covariance measure for digital surfaces. It adds notably the ...
VCMOnSurface::Surface Surface
the digital surface
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: defines the concept of separable metrics.
Self & operator=(const Self &other)
CountedConstPtrOrConstPtr< VCMOnSurface > myVCMOnSurface
A (possibly) shared object storing the whole Voronoi covariance measure.
BOOST_CONCEPT_ASSERT((concepts::CDigitalSurfaceContainer< TDigitalSurfaceContainer >))
void attach(ConstAlias< Surface > surface)
Surface::ConstIterator ConstIterator
the iterator on surfels
void selfDisplay(std::ostream &out) const
Aim: The digital surface container concept describes a minimal set of inner types and methods so as t...
VCMDigitalSurfaceLocalEstimator< TDigitalSurfaceContainer, TSeparableMetric, TKernelFunction, TVCMGeometricFunctor > Self
my own type
DigitalSurfaceContainer::Surfel Surfel
Surfel2PointEmbedding
Possible embeddings for surfel as point(s)
void setParams(Surfel2PointEmbedding surfelEmbedding, const Scalar R, const Scalar r, KernelFunction chi_r, const Scalar t=2.5, Metric aMetric=Metric(), bool verbose=true)
TKernelFunction KernelFunction
the kernel function
VoronoiCovarianceMeasureOnDigitalSurface< DigitalSurfaceContainer, Metric, KernelFunction > VCMOnSurface
the type of computing the Voronoi covariance measure on a digital surface.