DGtal
1.5.beta
|
Aim: this class adapts any local functor on digital surface element to define a local estimator. This class is model of CDigitalSurfaceLocalEstimator. More...
#include <DGtal/geometry/surfaces/estimation/LocalEstimatorFromSurfelFunctorAdapter.h>
Public Types | |
typedef TDigitalSurfaceContainer | DigitalSurfaceContainer |
Digital surface container type. More... | |
typedef TMetric | Metric |
Metric type. More... | |
typedef Metric::Value | Value |
Metric value type. More... | |
typedef Metric::Point | Point |
Metric point type. More... | |
typedef TFunctorOnSurfel | FunctorOnSurfel |
Functor on surfels type. More... | |
typedef TConvolutionFunctor | ConvolutionFunctor |
Functor on double to compute convolution weights. More... | |
typedef TFunctorOnSurfel::Quantity | Quantity |
Quantity type. More... | |
typedef double | Scalar |
The "real number" type. More... | |
typedef DigitalSurface< DigitalSurfaceContainer > | Surface |
Digital surface type. More... | |
typedef DigitalSurfaceContainer::Surfel | Surfel |
Surfel type. More... | |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CMetricSpace< TMetric >)) | |
Concept Checks. More... | |
BOOST_CONCEPT_ASSERT ((concepts::CLocalEstimatorFromSurfelFunctor< TFunctorOnSurfel >)) | |
BOOST_CONCEPT_ASSERT ((concepts::CUnaryFunctor< TConvolutionFunctor, double, double >)) | |
BOOST_CONCEPT_ASSERT ((concepts::CDigitalSurfaceContainer< TDigitalSurfaceContainer >)) | |
LocalEstimatorFromSurfelFunctorAdapter () | |
LocalEstimatorFromSurfelFunctorAdapter (ConstAlias< Surface > aSurface, ConstAlias< TMetric > aMetric, Alias< FunctorOnSurfel > aFunctor, ConstAlias< ConvolutionFunctor > aConvolutionFunctor) | |
LocalEstimatorFromSurfelFunctorAdapter (const LocalEstimatorFromSurfelFunctorAdapter &other) | |
LocalEstimatorFromSurfelFunctorAdapter & | operator= (const LocalEstimatorFromSurfelFunctorAdapter &other) |
~LocalEstimatorFromSurfelFunctorAdapter () | |
Scalar | h () const |
void | attach (ConstAlias< Surface > aSurface) |
void | setParams (ConstAlias< TMetric > aMetric, Alias< FunctorOnSurfel > aFunctor, ConstAlias< ConvolutionFunctor > aConvolutionFunctor, const Value radius) |
template<typename SurfelConstIterator > | |
void | init (const double _h, SurfelConstIterator itb, SurfelConstIterator ite) |
template<typename SurfelConstIterator > | |
Quantity | eval (const SurfelConstIterator &it) const |
template<typename SurfelConstIterator , typename OutputIterator > | |
OutputIterator | eval (const SurfelConstIterator &itb, const SurfelConstIterator &ite, OutputIterator result) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Types | |
typedef FunctorOnSurfel::SCellEmbedder | Embedder |
Embedded and type definitions. More... | |
typedef Embedder::RealPoint | RealPoint |
Real point type. More... | |
typedef std::function< Value(Point) > | MetricToPoint |
typedef functors::Composer< Embedder, MetricToPoint, Value > | VertexFunctor |
typedef DistanceBreadthFirstVisitor< Surface, VertexFunctor > | Visitor |
Private Attributes | |
CountedConstPtrOrConstPtr< Surface > | mySurface |
Digital surface member. More... | |
FunctorOnSurfel * | myFunctor |
Functor member. More... | |
CountedConstPtrOrConstPtr< Metric > | myMetric |
Distance functor. More... | |
double | myH |
Grid step. More... | |
bool | myInit |
Has init been done before eval. More... | |
Embedder | myEmbedder |
Embedder object. More... | |
CountedConstPtrOrConstPtr< ConvolutionFunctor > | myConvFunctor |
Convolution functor. More... | |
Value | myRadius |
Ball radius. More... | |
Aim: this class adapts any local functor on digital surface element to define a local estimator. This class is model of CDigitalSurfaceLocalEstimator.
Description of template class 'LocalEstimatorFromSurfelFunctorAdapter'
When we evaluate the adapted estimator at a surfel s, we first identify the set of neighboring around s using a DistanceBreadthFirstVisitor parametrized by a given metric. Then, the estimated quantity is computed applying a functor on the surfel set.
More precisely, this adapter needs a model of CMetricSpace to define the neighborhood and a model of CLocalEstimatorFromSurfelFunctor to perform the local estimator computation. When sent to the functor, the surfels are weighted using the distance from the kernel boundary: weights are defined in [0,1] interval, 1 for the center and decreasing to 0 with the distance to the specified kernel radius specified during the init(). The shape of the distance-to-weight function is defined by a functor of type TConvolutionFunctor.
During the init() method, we thus specify the gridstep h and the radius of the ball to consider to define the neighborhood. An instance of the convolution functor should be passed to the constructor.
Note that the visitor used in this class considers the distance function in the ambient space (not a geodesic one for instance) on canonical embedding of surfel elements (cf CanonicSCellEmbedder).
TDigitalSurfaceContainer | any model of digital surface container concept (CDigitalSurfaceContainer) |
TMetric | any model of CMetricSpace to be used in the neighborhood construction (e.g. LpMetric) |
TFunctorOnSurfel | an estimator on surfel set (model of CLocalEstimatorFromSurfelFunctor) |
TConvolutionFunctor | type of functor on double [0,1]->[0,1] to implement the response of a symmetric convolution kernel. |
Definition at line 103 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TConvolutionFunctor DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::ConvolutionFunctor |
Functor on double to compute convolution weights.
Definition at line 130 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TDigitalSurfaceContainer DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::DigitalSurfaceContainer |
Digital surface container type.
Definition at line 115 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Embedded and type definitions.
Definition at line 149 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TFunctorOnSurfel DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::FunctorOnSurfel |
Functor on surfels type.
Definition at line 127 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TMetric DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Metric |
Metric type.
Definition at line 118 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Definition at line 152 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef Metric::Point DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Point |
Metric point type.
Definition at line 124 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TFunctorOnSurfel::Quantity DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Quantity |
Quantity type.
Definition at line 133 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Real point type.
Definition at line 151 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef double DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Scalar |
The "real number" type.
Definition at line 136 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef DigitalSurface< DigitalSurfaceContainer > DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Surface |
Digital surface type.
Definition at line 139 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef DigitalSurfaceContainer::Surfel DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Surfel |
Surfel type.
Definition at line 142 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef Metric::Value DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Value |
Metric value type.
Definition at line 121 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Definition at line 153 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Definition at line 155 of file LocalEstimatorFromSurfelFunctorAdapter.h.
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::LocalEstimatorFromSurfelFunctorAdapter | ( | ) |
Default constructor.
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::LocalEstimatorFromSurfelFunctorAdapter | ( | ConstAlias< Surface > | aSurface, |
ConstAlias< TMetric > | aMetric, | ||
Alias< FunctorOnSurfel > | aFunctor, | ||
ConstAlias< ConvolutionFunctor > | aConvolutionFunctor | ||
) |
Constructor.
aSurface | a digital surface |
aMetric | the metric |
aFunctor | a functor on digital surface elements (e.g. the normal or the curvature estimation) |
aConvolutionFunctor | a functor giving the weight as a function of the distance to the surfel. |
|
inline |
Copy constructor.
other | the object to clone. Forbidden by default. |
Definition at line 188 of file LocalEstimatorFromSurfelFunctorAdapter.h.
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::~LocalEstimatorFromSurfelFunctorAdapter | ( | ) |
Destructor.
void DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::attach | ( | ConstAlias< Surface > | aSurface | ) |
Attach a digital surface. After this call, the object is then invalid and the user must called setParams.
aSurface | the digital surface that is aliased in this. The user can secure the aliasing by passing a CountedConstPtrOrConstPtr. |
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CDigitalSurfaceContainer< TDigitalSurfaceContainer >) | ) |
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CLocalEstimatorFromSurfelFunctor< TFunctorOnSurfel >) | ) |
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CMetricSpace< TMetric >) | ) |
Concept Checks.
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CUnaryFunctor< TConvolutionFunctor, double, double >) | ) |
Quantity DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::eval | ( | const SurfelConstIterator & | it | ) | const |
[in] | it | the surfel iterator at which we evaluate the quantity. |
OutputIterator DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::eval | ( | const SurfelConstIterator & | itb, |
const SurfelConstIterator & | ite, | ||
OutputIterator | result | ||
) | const |
[in] | itb | starting surfel iterator. |
[in] | ite | end surfel iterator. |
[in,out] | result | resulting output iterator |
Scalar DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::h | ( | ) | const |
void DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::init | ( | const double | _h, |
SurfelConstIterator | itb, | ||
SurfelConstIterator | ite | ||
) |
Initialisation of estimator parameters.
[in] | _h | grid size (must be >0). |
[in] | itb | iterator after the last surfel of the surface. |
[in] | ite | iterator on the first surfel of the surface. |
bool DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
|
inline |
Assignment.
other | the object to copy. |
Definition at line 200 of file LocalEstimatorFromSurfelFunctorAdapter.h.
References DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::myConvFunctor, DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::myEmbedder, DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::myFunctor, DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::myMetric, and DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::mySurface.
void DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
void DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::setParams | ( | ConstAlias< TMetric > | aMetric, |
Alias< FunctorOnSurfel > | aFunctor, | ||
ConstAlias< ConvolutionFunctor > | aConvolutionFunctor, | ||
const Value | radius | ||
) |
Initialisation of estimator specific parameters.
aMetric | the metric |
aFunctor | a functor on digital surface elements (e.g. the normal or the curvature estimation) |
aConvolutionFunctor | a functor giving the weight as a function of the distance to the surfel. |
radius | a kernel radius. |
|
private |
Convolution functor.
Definition at line 322 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
|
private |
Embedder object.
Definition at line 319 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
|
private |
Functor member.
Definition at line 307 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
|
private |
Grid step.
Definition at line 313 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Has init been done before eval.
Definition at line 316 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Distance functor.
Definition at line 310 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
|
private |
Ball radius.
Definition at line 325 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Digital surface member.
Definition at line 304 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().