DGtal  0.9.3beta
Public Types | Public Member Functions | Protected Attributes | Private Member Functions
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor > Class Template Reference

#include <DGtal/geometry/surfaces/estimation/TrueDigitalSurfaceLocalEstimator.h>

Collaboration diagram for DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >:
[legend]

Public Types

typedef TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor > Self
 
typedef TKSpace KSpace
 
typedef TShape Shape
 
typedef TGeometricFunctor GeometricFunctor
 
typedef KSpace::Space Space
 
typedef KSpace::SCell SCell
 
typedef KSpace::Surfel Surfel
 
typedef Space::RealPoint RealPoint
 
typedef RealPoint::Coordinate Scalar
 
typedef GeometricFunctor::Quantity Quantity
 
typedef CanonicSCellEmbedder< KSpaceSCellEmbedder
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CUnaryFunctor< GeometricFunctor, RealPoint, Quantity >))
 
 ~TrueDigitalSurfaceLocalEstimator ()
 
 TrueDigitalSurfaceLocalEstimator ()
 
 TrueDigitalSurfaceLocalEstimator (const Self &other)
 
Selfoperator= (const Self &other)
 
Scalar h () const
 
void attach (ConstAlias< Shape > aShape)
 
void setParams (ConstAlias< KSpace > ks, Clone< GeometricFunctor > fct, const int maxIter=0, const Scalar accuracy=0.1, const Scalar gamma=0.01)
 
template<typename SurfelConstIterator >
void init (const Scalar _h, SurfelConstIterator itb, SurfelConstIterator ite)
 
template<typename SurfelConstIterator >
Quantity eval (SurfelConstIterator it) const
 
template<typename OutputIterator , typename SurfelConstIterator >
OutputIterator eval (SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator result) const
 
RealPoint embed (Surfel surfel) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Attributes

CountedConstPtrOrConstPtr< KSpacemyKSpace
 
CowPtr< GeometricFunctormyFct
 
SCellEmbedder myEmbedder
 
CountedConstPtrOrConstPtr< ShapemyShape
 
Scalar myH
 
bool myNearest
 
int myMaxIter
 
Scalar myAccuracy
 
Scalar myGamma
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CCellularGridSpaceND< TKSpace >))
 

Detailed Description

template<typename TKSpace, typename TShape, typename TGeometricFunctor>
class DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >

Aim: An estimator on digital surfaces that returns the reference local geometric quantity. This is used for comparing estimators.

Description of template class 'TrueDigitalSurfaceLocalEstimator'

Note that you must call methods setParams, attach, then init before calling eval method(s).

It is a model of CDigitalSurfaceLocalEstimator.

Template Parameters
TKSpacethe type of cellular grid space, a model of CCellularGridSpaceND.
TShapethe type of the shape where geometric estimation are made. It must have methods gradient, meanCurvature, etc depending on the chosen functor.
TGeometricFunctorthe type of the function RealPoint -> Quantity, generally one of ShapeGeometricFunctors::ShapePositionFunctor, ShapeGeometricFunctors::ShapeNormalVectorFunctor, ShapeGeometricFunctors::ShapeMeanCurvatureFunctor, ShapeGeometricFunctors::ShapeGaussianCurvatureFunctor, ShapeGeometricFunctors::ShapeFirstPrincipalCurvatureFunctor, ShapeGeometricFunctors::ShapeSecondPrincipalCurvatureFunctor, ShapeGeometricFunctors::ShapeCurvatureTensorFunctor.
typedef ImplicitPolynomial3Shape<Z3i::Space> ImplicitShape;
typedef ShapeGeometricFunctors::ShapeNormalVectorFunctor<ImplicitShape> NormalFunctor;
typedef TrueDigitalSurfaceLocalEstimator<Z3i::KSpace, ImplicitShape, NormalFunctor> TrueNormalEstimator;
TrueNormalEstimator true_estimator;
true_estimator.setParams( K, NormalFunctor() ); // K is some KSpace
true_estimator.attach( shape ); // shape is some ImplicitShape
true_estimator.init( 1.0, surface.begin(), surface.end() ); // surface is a digital surface.
Todo:

add precise concept CShape

for now we use a CanonicSCellEmbedder times the gridstep to embed surfels.

Definition at line 97 of file TrueDigitalSurfaceLocalEstimator.h.

Member Typedef Documentation

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef TGeometricFunctor DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::GeometricFunctor

Definition at line 105 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef TKSpace DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::KSpace

Definition at line 103 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef GeometricFunctor::Quantity DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Quantity

Definition at line 111 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef Space::RealPoint DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::RealPoint

Definition at line 109 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef RealPoint::Coordinate DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Scalar

Definition at line 110 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef KSpace::SCell DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::SCell

Definition at line 107 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef CanonicSCellEmbedder<KSpace> DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::SCellEmbedder

Definition at line 112 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef TrueDigitalSurfaceLocalEstimator<TKSpace,TShape,TGeometricFunctor> DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Self

Definition at line 102 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef TShape DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Shape

Definition at line 104 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef KSpace::Space DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Space

Definition at line 106 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef KSpace::Surfel DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Surfel

Definition at line 108 of file TrueDigitalSurfaceLocalEstimator.h.

Constructor & Destructor Documentation

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::~TrueDigitalSurfaceLocalEstimator ( )

Destructor.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::TrueDigitalSurfaceLocalEstimator ( )

Default constructor. The estimator is not valid.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::TrueDigitalSurfaceLocalEstimator ( const Self other)

Copy constructor.

Parameters
otherthe object to clone.

Member Function Documentation

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
void DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::attach ( ConstAlias< Shape aShape)

Attach a shape.

Parameters
aShapethe shape of interest. The alias can be secured if a some counted pointer is handed.
template<typename TKSpace , typename TShape , typename TGeometricFunctor >
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::BOOST_CONCEPT_ASSERT ( (concepts::CCellularGridSpaceND< TKSpace >)  )
private
template<typename TKSpace , typename TShape , typename TGeometricFunctor >
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::BOOST_CONCEPT_ASSERT ( (concepts::CUnaryFunctor< GeometricFunctor, RealPoint, Quantity >)  )
template<typename TKSpace , typename TShape , typename TGeometricFunctor >
RealPoint DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::embed ( Surfel  surfel) const
Parameters
surfelany surfel.
Returns
the associated point on the shape (the one that is closest to its centroid).
template<typename TKSpace , typename TShape , typename TGeometricFunctor >
template<typename SurfelConstIterator >
Quantity DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::eval ( SurfelConstIterator  it) const
Returns
the estimated quantity at *it
Parameters
[in]itthe surfel iterator at which we evaluate the quantity.
template<typename TKSpace , typename TShape , typename TGeometricFunctor >
template<typename OutputIterator , typename SurfelConstIterator >
OutputIterator DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::eval ( SurfelConstIterator  itb,
SurfelConstIterator  ite,
OutputIterator  result 
) const
Returns
the estimated quantity in the range [itb,ite)
Parameters
[in]itbstarting surfel iterator.
[in]iteend surfel iterator.
[in]resultresulting output iterator
template<typename TKSpace , typename TShape , typename TGeometricFunctor >
Scalar DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::h ( ) const
Returns
the grid step.
template<typename TKSpace , typename TShape , typename TGeometricFunctor >
template<typename SurfelConstIterator >
void DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::init ( const Scalar  _h,
SurfelConstIterator  itb,
SurfelConstIterator  ite 
)

Model of CDigitalSurfaceLocalEstimator. Initialisation.

Template Parameters
SurfelConstIteratorany model of forward readable iterator on Surfel.
Parameters
[in]_hgrid size (must be >0).
[in]iteiterator on the first surfel of the surface.
[in]itbiterator after the last surfel of the surface.
template<typename TKSpace , typename TShape , typename TGeometricFunctor >
bool DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TKSpace , typename TShape , typename TGeometricFunctor >
Self& DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::operator= ( const Self other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.
template<typename TKSpace , typename TShape , typename TGeometricFunctor >
void DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.
template<typename TKSpace , typename TShape , typename TGeometricFunctor >
void DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::setParams ( ConstAlias< KSpace ks,
Clone< GeometricFunctor fct,
const int  maxIter = 0,
const Scalar  accuracy = 0.1,
const Scalar  gamma = 0.01 
)

Set specific parameters. They specify the space, the estimated quantity and how the nearest point on the surface is approached.

Parameters
ksthe cellular grid space. The alias can be secured if a some counted pointer is handed.
fctthe functor RealPoint -> Quantity returning some geometric quantity.
maxIterfixes the maximum number of steps (0: takes the point as is).
accuracydistance criterion to stop the descent (proximity of implicit function).
gammacoefficient associated with the gradient (size of each step).

Field Documentation

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
Scalar DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myAccuracy
protected

distance criterion to stop the descent (proximity of implicit function).

Definition at line 244 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
SCellEmbedder DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myEmbedder
protected

The surfel embedder. /!\ For now, it is multiplied by myH.

Definition at line 233 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
CowPtr<GeometricFunctor> DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myFct
protected

The functor RealPoint -> Quantity returning some geometric quantity.

Definition at line 231 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
Scalar DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myGamma
protected

coefficient associated with the gradient (size of each step).

Definition at line 246 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
Scalar DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myH
protected

The gridstep.

Definition at line 237 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
CountedConstPtrOrConstPtr<KSpace> DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myKSpace
protected

The cellular space.

Definition at line 229 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
int DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myMaxIter
protected

fixes the maximum number of steps (0: takes the point as is).

Definition at line 242 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
bool DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myNearest
protected

Tells if we look for nearest point.

Definition at line 239 of file TrueDigitalSurfaceLocalEstimator.h.

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
CountedConstPtrOrConstPtr<Shape> DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myShape
protected

The shape of interest.

Definition at line 235 of file TrueDigitalSurfaceLocalEstimator.h.


The documentation for this class was generated from the following file: