DGtal
0.9.3
|
#include <DGtal/geometry/surfaces/estimation/LocalEstimatorFromSurfelFunctorAdapter.h>
Public Types | |
typedef TDigitalSurfaceContainer | DigitalSurfaceContainer |
typedef TMetric | Metric |
typedef TMetric::Value | Value |
typedef TFunctorOnSurfel | FunctorOnSurfel |
typedef TConvolutionFunctor | ConvolutionFunctor |
typedef TFunctorOnSurfel::Quantity | Quantity |
typedef double | Scalar |
typedef DigitalSurface< DigitalSurfaceContainer > | Surface |
typedef DigitalSurfaceContainer::Surfel | Surfel |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CMetricSpace< TMetric >)) | |
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 |
typedef std::function< typename Metric::Value(typename Metric::Point) > | MetricToPoint |
typedef functors::Composer< Embedder, MetricToPoint, Value > | VertexFunctor |
typedef DistanceBreadthFirstVisitor< Surface, VertexFunctor > | Visitor |
Private Attributes | |
CountedConstPtrOrConstPtr< Surface > | mySurface |
FunctorOnSurfel * | myFunctor |
CountedConstPtrOrConstPtr< Metric > | myMetric |
double | myH |
bool | myInit |
Embedder | myEmbedder |
CountedConstPtrOrConstPtr< ConvolutionFunctor > | myConvFunctor |
Value | myRadius |
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. |
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 127 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 145 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TFunctorOnSurfel DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::FunctorOnSurfel |
Functor on surfels type.
Definition at line 124 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 146 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TFunctorOnSurfel::Quantity DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Quantity |
Quantity type.
Definition at line 130 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef double DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Scalar |
The "real number" type.
Definition at line 133 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef DigitalSurface< DigitalSurfaceContainer > DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Surface |
Digital surface type.
Definition at line 136 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef DigitalSurfaceContainer::Surfel DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Surfel |
Surfel type.
Definition at line 139 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TMetric::Value DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Value |
Metric value type.
Definition at line 121 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Definition at line 147 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Definition at line 149 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 182 of file LocalEstimatorFromSurfelFunctorAdapter.h.
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::~LocalEstimatorFromSurfelFunctorAdapter | ( | ) |
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. |
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CMetricSpace< TMetric >) | ) |
Concept Checks.
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CLocalEstimatorFromSurfelFunctor< TFunctorOnSurfel >) | ) |
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CUnaryFunctor< TConvolutionFunctor, double, double >) | ) |
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CDigitalSurfaceContainer< TDigitalSurfaceContainer >) | ) |
Quantity DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::eval | ( | const SurfelConstIterator & | it | ) | const |
[in] | it | the surfel iterator at which we evaluate the quantity. |
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
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 |
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
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. |
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
bool DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
|
inline |
Assignment.
other | the object to copy. |
Definition at line 194 of file LocalEstimatorFromSurfelFunctorAdapter.h.
References DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::attach(), DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::eval(), DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::h(), DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::init(), DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::isValid(), 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, DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::mySurface, DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::selfDisplay(), DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::setParams(), and DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::~LocalEstimatorFromSurfelFunctorAdapter().
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. |
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
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. |
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
|
private |
Convolution functor.
Definition at line 316 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
|
private |
Embedder object.
Definition at line 313 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
|
private |
Functor member.
Definition at line 301 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
|
private |
Grid step.
Definition at line 307 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Has init been done before eval.
Definition at line 310 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Distance functor.
Definition at line 304 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().
|
private |
Ball radius.
Definition at line 319 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Digital surface member.
Definition at line 298 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::operator=().