Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
LocalEstimatorFromSurfelFunctorAdapter.h
1
16
17#pragma once
18
30
31#if defined(LocalEstimatorFromSurfelFunctorAdapter_RECURSES)
32#error Recursive header files inclusion detected in LocalEstimatorFromSurfelFunctorAdapter.h
33#else // defined(LocalEstimatorFromSurfelFunctorAdapter_RECURSES)
35#define LocalEstimatorFromSurfelFunctorAdapter_RECURSES
36
37#if !defined LocalEstimatorFromSurfelFunctorAdapter_h
39#define LocalEstimatorFromSurfelFunctorAdapter_h
40
42// Inclusions
43#include <iostream>
44#include <functional>
45#include "DGtal/base/Common.h"
46#include "DGtal/base/Alias.h"
47#include "DGtal/base/ConstAlias.h"
48#include "DGtal/base/CUnaryFunctor.h"
49#include "DGtal/topology/CanonicSCellEmbedder.h"
50#include "DGtal/topology/CSCellEmbedder.h"
51#include "DGtal/topology/CDigitalSurfaceContainer.h"
52#include "DGtal/topology/DigitalSurface.h"
53#include "DGtal/graph/DistanceBreadthFirstVisitor.h"
54#include "DGtal/geometry/volumes/distance/CMetricSpace.h"
55#include "DGtal/base/BasicFunctors.h"
56#include "DGtal/geometry/surfaces/estimation/estimationFunctors/CLocalEstimatorFromSurfelFunctor.h"
58
59namespace DGtal
60{
61
63 // template class LocalEstimatorFromSurfelFunctorAdapter
101 template <typename TDigitalSurfaceContainer, typename TMetric,
102 typename TFunctorOnSurfel, typename TConvolutionFunctor>
104 {
105 // ----------------------- Standard services ------------------------------
106 public:
107
113
115 typedef TDigitalSurfaceContainer DigitalSurfaceContainer;
116
118 typedef TMetric Metric;
119
121 typedef typename Metric::Value Value;
122
124 typedef typename Metric::Point Point;
127
129 typedef TFunctorOnSurfel FunctorOnSurfel;
130
132 typedef TConvolutionFunctor ConvolutionFunctor;
133
135 typedef typename TFunctorOnSurfel::Quantity Quantity;
136
138 typedef double Scalar;
139
142
144 typedef typename DigitalSurfaceContainer::Surfel Surfel;
145
146
147
148 private:
149
151 typedef typename FunctorOnSurfel::SCellEmbedder Embedder;
153 typedef typename Embedder::RealPoint RealPoint;
154 typedef std::function< Value ( Point ) > MetricToPoint;
158
159
160 public:
161
166
180 ( ConstAlias< Surface > aSurface,
181 ConstAlias<TMetric> aMetric,
182 Alias<FunctorOnSurfel> aFunctor,
183 ConstAlias<ConvolutionFunctor> aConvolutionFunctor );
184
194
195
203 {
204 mySurface = other.mySurface;
205 myFunctor = other.myFunctor;
206 myMetric = other.myMetric;
207 myEmbedder = other.myEmbedder;
209 return *this;
210 }
211
216
217 // ----------------------- Interface --------------------------------------
218 public:
219
224 Scalar h() const;
225
234 void attach( ConstAlias<Surface> aSurface );
235
250 Alias<FunctorOnSurfel> aFunctor,
251 ConstAlias<ConvolutionFunctor> aConvolutionFunctor,
252 const Value radius);
253
261 template<typename SurfelConstIterator>
262 void init(const double _h, SurfelConstIterator itb, SurfelConstIterator ite);
263
264
269 template< typename SurfelConstIterator>
270 Quantity eval(const SurfelConstIterator& it) const;
271
276 Quantity eval(const Surfel& scell) const;
277
285 template< typename SurfelConstIterator, typename OutputIterator>
286 OutputIterator eval(const SurfelConstIterator& itb,
287 const SurfelConstIterator& ite,
288 OutputIterator result) const;
289
295 template<typename OutputIterator>
296 OutputIterator evalAll(OutputIterator result) const;
297
298
299
304 void selfDisplay ( std::ostream & out ) const;
305
310 bool isValid() const;
311
312 // ------------------------- Hidden services ------------------------------
313
314 private:
315
316
317 // ------------------------- Internals ------------------------------------
318 private:
319
322
325
328
330 double myH;
331
333 bool myInit;
334
337
340
343
344 }; // end of class LocalEstimatorFromSurfelFunctorAdapter
345
352 template <typename TD, typename TV, typename TF, typename TC>
353 std::ostream&
354 operator<< ( std::ostream & out, const LocalEstimatorFromSurfelFunctorAdapter<TD,TV,TF,TC> & object );
355} // namespace DGtal
356
357
359// Includes inline functions.
360#include "DGtal/geometry/surfaces/estimation//LocalEstimatorFromSurfelFunctorAdapter.ih"
361
362// //
364
365#endif // !defined LocalEstimatorFromSurfelFunctorAdapter_h
366
367#undef LocalEstimatorFromSurfelFunctorAdapter_RECURSES
368#endif // else defined(LocalEstimatorFromSurfelFunctorAdapter_RECURSES)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition Alias.h:183
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition ConstAlias.h:187
Aim: Smart or simple const pointer on T. It can be a smart pointer based on reference counts or a sim...
Aim: This class is useful to perform an exploration of a graph given a starting point or set (called ...
Aim: this class adapts any local functor on digital surface element to define a local estimator....
CountedConstPtrOrConstPtr< ConvolutionFunctor > myConvFunctor
Convolution functor.
LocalEstimatorFromSurfelFunctorAdapter(ConstAlias< Surface > aSurface, ConstAlias< TMetric > aMetric, Alias< FunctorOnSurfel > aFunctor, ConstAlias< ConvolutionFunctor > aConvolutionFunctor)
void attach(ConstAlias< Surface > aSurface)
void init(const double _h, SurfelConstIterator itb, SurfelConstIterator ite)
void selfDisplay(std::ostream &out) const
TDigitalSurfaceContainer DigitalSurfaceContainer
Digital surface container type.
DistanceBreadthFirstVisitor< Surface, VertexFunctor > Visitor
CountedConstPtrOrConstPtr< Metric > myMetric
Distance functor.
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< typename Point::Component, double >::value))
The point must be a real point.
LocalEstimatorFromSurfelFunctorAdapter(const LocalEstimatorFromSurfelFunctorAdapter &other)
Quantity eval(const Surfel &scell) const
void setParams(ConstAlias< TMetric > aMetric, Alias< FunctorOnSurfel > aFunctor, ConstAlias< ConvolutionFunctor > aConvolutionFunctor, const Value radius)
CountedConstPtrOrConstPtr< Surface > mySurface
Digital surface member.
FunctorOnSurfel::SCellEmbedder Embedder
Embedded and type definitions.
OutputIterator evalAll(OutputIterator result) const
LocalEstimatorFromSurfelFunctorAdapter & operator=(const LocalEstimatorFromSurfelFunctorAdapter &other)
OutputIterator eval(const SurfelConstIterator &itb, const SurfelConstIterator &ite, OutputIterator result) const
DigitalSurface< DigitalSurfaceContainer > Surface
Digital surface type.
TConvolutionFunctor ConvolutionFunctor
Functor on double to compute convolution weights.
functors::Composer< Embedder, MetricToPoint, Value > VertexFunctor
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TConvolutionFunctor, double, double >))
BOOST_CONCEPT_ASSERT((concepts::CDigitalSurfaceContainer< TDigitalSurfaceContainer >))
Quantity eval(const SurfelConstIterator &it) const
BOOST_CONCEPT_ASSERT((concepts::CLocalEstimatorFromSurfelFunctor< TFunctorOnSurfel >))
BOOST_CONCEPT_ASSERT((concepts::CMetricSpace< TMetric >))
Concept Checks.
Aim: Define a new Functor from the composition of two other functors.
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Aim: The digital surface container concept describes a minimal set of inner types and methods so as t...
Aim: this concept describes functors on digtal surface surfel which can be used to define local estim...
Aim: defines the concept of metric spaces.
Aim: Defines a unary functor, which associates arguments to results.