DGtal  1.1.0
IntegralInvariantVolumeEstimator.h
1 
17 #pragma once
18 
34 #if defined(IntegralInvariantVolumeEstimator_RECURSES)
35 #error Recursive header files inclusion detected in IntegralInvariantVolumeEstimator.h
36 #else // defined(IntegralInvariantVolumeEstimator_RECURSES)
37 
38 #define IntegralInvariantVolumeEstimator_RECURSES
39 
40 #if !defined IntegralInvariantVolumeEstimator_h
41 
42 #define IntegralInvariantVolumeEstimator_h
43 
45 // Inclusions
46 #include <iostream>
47 #include "DGtal/base/Common.h"
48 
49 #include "DGtal/kernel/BasicPointFunctors.h"
50 #include "DGtal/kernel/CPointPredicate.h"
51 #include "DGtal/topology/CCellFunctor.h"
52 #include "DGtal/topology/CCellularGridSpaceND.h"
53 #include "DGtal/geometry/surfaces/FunctorOnCells.h"
54 
55 #include "DGtal/shapes/GaussDigitizer.h"
56 #include "DGtal/shapes/Shapes.h"
57 
58 #include "DGtal/geometry/surfaces/DigitalSurfaceConvolver.h"
59 #include "DGtal/geometry/surfaces/estimation/IIGeometricFunctors.h"
60 #include "DGtal/shapes/EuclideanShapesDecorator.h"
61 
62 #include "DGtal/shapes/implicit/ImplicitBall.h"
64 
65 
66 namespace DGtal
67 {
68 
70 // template class IntegralInvariantVolumeEstimator
112 template <typename TKSpace, typename TPointPredicate, typename TVolumeFunctor>
114 {
115 public:
117  typedef TKSpace KSpace;
118  typedef TPointPredicate PointPredicate;
119  typedef TVolumeFunctor VolumeFunctor;
120 
123 
124  typedef typename KSpace::Space Space;
126  typedef typename Space::Point Point;
127  typedef typename Space::RealPoint RealPoint;
128  typedef typename Space::RealVector RealVector;
130  typedef typename KSpace::SCell Spel;
131  typedef typename KSpace::Surfel Surfel;
132  typedef typename KSpace::SurfelSet SurfelSet;
133  typedef typename SurfelSet::const_iterator ConstIteratorKernel;
134 
136  typedef typename VolumeFunctor::Quantity Quantity;
138  typedef int Value;
139 
146 
147 
153 
158  typedef typename Matrix::Component Component;
159  typedef double Scalar;
163  typename VolumeFunctor::Argument >::value ));
164 
165 
166  // ----------------------- Standard services ------------------------------
167 public:
168 
177 
188  ConstAlias< PointPredicate > aPointPredicate,
189  VolumeFunctor fct = VolumeFunctor() );
190 
195 
201 
207  Self& operator= ( const Self& other );
208 
212  void clear();
213 
214  // ----------------------- Interface --------------------------------------
215 public:
216 
218  Scalar h() const;
219 
228  ConstAlias<PointPredicate> aPointPredicate );
229 
235  void setParams( const double dRadius );
236 
245  template <typename SurfelConstIterator>
246  void init( const double _h, SurfelConstIterator itb, SurfelConstIterator ite );
247 
262  template< typename SurfelConstIterator >
263  Quantity eval ( SurfelConstIterator it ) const;
264 
265 
286  template <typename OutputIterator, typename SurfelConstIterator>
287  OutputIterator eval( SurfelConstIterator itb,
288  SurfelConstIterator ite,
289  OutputIterator result ) const;
290 
295  void selfDisplay ( std::ostream & out ) const;
296 
301  bool isValid() const;
302 
303  // ------------------------- Private Datas --------------------------------
304 private:
305 
308  std::vector< PairIterators > myKernels;
309  std::vector< DigitalSet * > myKernelsSet;
319 
320 private:
321 
322 
323 }; // end of class IntegralInvariantVolumeEstimator
324 
331  template <typename TKSpace, typename TPointPredicate, typename TVolumeFunctor>
332  std::ostream&
333  operator<< ( std::ostream & out,
335 
336 } // namespace DGtal
337 
338 
340 // Includes inline functions.
341 #include "DGtal/geometry/surfaces/estimation/IntegralInvariantVolumeEstimator.ih"
342 
343 // //
345 
346 #endif // !defined IntegralInvariantVolumeEstimator_h
347 
348 #undef IntegralInvariantVolumeEstimator_RECURSES
349 #endif // else defined(IntegralInvariantVolumeEstimator_RECURSES)
DGtal::IntegralInvariantVolumeEstimator::~IntegralInvariantVolumeEstimator
~IntegralInvariantVolumeEstimator()
DGtal::IntegralInvariantVolumeEstimator::myKernels
std::vector< PairIterators > myKernels
array of begin/end iterator of shifting masks.
Definition: IntegralInvariantVolumeEstimator.h:308
DGtal::GaussDigitizer
Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
Definition: GaussDigitizer.h:80
DGtal::IntegralInvariantVolumeEstimator::VolumeFunctor
TVolumeFunctor VolumeFunctor
Definition: IntegralInvariantVolumeEstimator.h:119
DGtal::IntegralInvariantVolumeEstimator::myDigKernel
CountedPtr< DigitalShapeKernel > myDigKernel
Digital kernel.
Definition: IntegralInvariantVolumeEstimator.h:311
DGtal::IntegralInvariantVolumeEstimator::PointPredicate
TPointPredicate PointPredicate
Definition: IntegralInvariantVolumeEstimator.h:118
DGtal::IntegralInvariantVolumeEstimator::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:187
DGtal::HyperRectDomain< Space >
DGtal::KhalimskySpaceND::SurfelSet
std::set< SCell > SurfelSet
Preferred type for defining a set of surfels (always signed cells).
Definition: KhalimskySpaceND.h:450
DGtal::IntegralInvariantVolumeEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CCellFunctor< ShapeSpelFunctor >))
DGtal::IntegralInvariantVolumeEstimator::h
Scalar h() const
DGtal::functors::PointFunctorFromPointPredicateAndDomain
Create a point functor from a point predicate and a domain.
Definition: BasicPointFunctors.h:524
DGtal::IntegralInvariantVolumeEstimator::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< typename Convolver::Quantity, typename VolumeFunctor::Argument >::value))
DGtal::IntegralInvariantVolumeEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CPointPredicate< PointPredicate >))
DGtal::concepts::CCellFunctor
Aim: Defines a functor on cells.
Definition: CCellFunctor.h:90
DGtal::IntegralInvariantVolumeEstimator::Quantity
VolumeFunctor::Quantity Quantity
The returned type of the estimator, depends on the functor.
Definition: IntegralInvariantVolumeEstimator.h:136
DGtal::IntegralInvariantVolumeEstimator::myShapeDomain
CountedPtr< Domain > myShapeDomain
Smart pointer on domain
Definition: IntegralInvariantVolumeEstimator.h:313
DGtal::concepts::CCellularGridSpaceND
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...
Definition: CCellularGridSpaceND.h:164
DGtal::IntegralInvariantVolumeEstimator::Value
int Value
The type used for convolutions.
Definition: IntegralInvariantVolumeEstimator.h:138
K
KSpace K
Definition: testCubicalComplex.cpp:62
DGtal::IntegralInvariantVolumeEstimator::ShapePointFunctor
functors::PointFunctorFromPointPredicateAndDomain< PointPredicate, Domain, unsigned int > ShapePointFunctor
Definition: IntegralInvariantVolumeEstimator.h:142
DGtal::IntegralInvariantVolumeEstimator::IntegralInvariantVolumeEstimator
IntegralInvariantVolumeEstimator(VolumeFunctor fct=VolumeFunctor())
DGtal::IntegralInvariantVolumeEstimator::Surfel
KSpace::Surfel Surfel
Definition: IntegralInvariantVolumeEstimator.h:131
DGtal::IntegralInvariantVolumeEstimator::KSpace
TKSpace KSpace
Definition: IntegralInvariantVolumeEstimator.h:117
DGtal::IntegralInvariantVolumeEstimator::DigitalShape
GaussDigitizer< Space, EuclideanMinus > DigitalShape
Definition: IntegralInvariantVolumeEstimator.h:152
DGtal::IntegralInvariantVolumeEstimator::myConvolver
CountedPtr< Convolver > myConvolver
Convolver.
Definition: IntegralInvariantVolumeEstimator.h:316
DGtal::IntegralInvariantVolumeEstimator::Spel
KSpace::SCell Spel
Definition: IntegralInvariantVolumeEstimator.h:130
DGtal::SignedKhalimskyCell
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Definition: KhalimskySpaceND.h:209
DGtal::IntegralInvariantVolumeEstimator::PairIterators
Convolver::PairIterators PairIterators
Definition: IntegralInvariantVolumeEstimator.h:156
DGtal::IntegralInvariantVolumeEstimator::clear
void clear()
DGtal::IntegralInvariantVolumeEstimator::myRadius
Scalar myRadius
"digital" radius of the kernel (buy may be non integer).
Definition: IntegralInvariantVolumeEstimator.h:318
DGtal::IntegralInvariantVolumeEstimator::ShapeSpelFunctor
FunctorOnCells< ShapePointFunctor, KSpace > ShapeSpelFunctor
Definition: IntegralInvariantVolumeEstimator.h:145
DGtal::IntegralInvariantVolumeEstimator::Scalar
double Scalar
Definition: IntegralInvariantVolumeEstimator.h:159
DGtal::IntegralInvariantVolumeEstimator::isValid
bool isValid() const
DGtal::SpaceND
Definition: SpaceND.h:96
DGtal::IntegralInvariantVolumeEstimator::operator=
Self & operator=(const Self &other)
DGtal::IntegralInvariantVolumeEstimator::RealPoint
Space::RealPoint RealPoint
Definition: IntegralInvariantVolumeEstimator.h:127
DGtal::IntegralInvariantVolumeEstimator
Aim: This class implement an Integral Invariant estimator which computes for each surfel the volume o...
Definition: IntegralInvariantVolumeEstimator.h:114
DGtal::IntegralInvariantVolumeEstimator::EuclideanMinus
EuclideanShapesCSG< KernelSupport, KernelSupport > EuclideanMinus
Definition: IntegralInvariantVolumeEstimator.h:150
DGtal::CountedConstPtrOrConstPtr< PointPredicate >
DGtal::SimpleMatrix
Aim: implements basic MxN Matrix services (M,N>=1).
Definition: SimpleMatrix.h:76
DGtal::IntegralInvariantVolumeEstimator::Space
KSpace::Space Space
Definition: IntegralInvariantVolumeEstimator.h:124
DGtal::IntegralInvariantVolumeEstimator::attach
void attach(ConstAlias< KSpace > K, ConstAlias< PointPredicate > aPointPredicate)
DGtal::IntegralInvariantVolumeEstimator::eval
Quantity eval(SurfelConstIterator it) const
DGtal::IntegralInvariantVolumeEstimator::KernelSupport
ImplicitBall< Space > KernelSupport
Definition: IntegralInvariantVolumeEstimator.h:149
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::IntegralInvariantVolumeEstimator::myFct
VolumeFunctor myFct
The volume functor that transforms the volume into a quantity.
Definition: IntegralInvariantVolumeEstimator.h:306
DGtal::EuclideanShapesCSG
Aim: Constructive Solid Geometry (CSG) between models of CEuclideanBoundedShape and CEuclideanOriente...
Definition: EuclideanShapesDecorator.h:68
DGtal::FunctorOnCells
Aim: Convert a functor on Digital Point to a Functor on Khalimsky Cell.
Definition: FunctorOnCells.h:71
DGtal::ImplicitBall
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD....
Definition: ImplicitBall.h:65
DGtal::IntegralInvariantVolumeEstimator::ConstIteratorKernel
SurfelSet::const_iterator ConstIteratorKernel
Definition: IntegralInvariantVolumeEstimator.h:133
DGtal::IntegralInvariantVolumeEstimator::myH
Scalar myH
precision of the grid
Definition: IntegralInvariantVolumeEstimator.h:317
DGtal::functors::ConstValueCell
Aim: Define a simple functor that returns a constant quantity (0 by default).
Definition: BasicFunctors.h:354
DGtal::IntegralInvariantVolumeEstimator::Convolver
DigitalSurfaceConvolver< ShapeSpelFunctor, KernelSpelFunctor, KSpace, DigitalShapeKernel > Convolver
Definition: IntegralInvariantVolumeEstimator.h:155
DGtal::IntegralInvariantVolumeEstimator::SurfelSet
KSpace::SurfelSet SurfelSet
Definition: IntegralInvariantVolumeEstimator.h:132
DGtal::IntegralInvariantVolumeEstimator::myPointPredicate
CountedConstPtrOrConstPtr< PointPredicate > myPointPredicate
Smart pointer (if required) on a point predicate.
Definition: IntegralInvariantVolumeEstimator.h:312
DGtal::IntegralInvariantVolumeEstimator::DigitalSet
DigitalSetSelector< Domain, BIG_DS+HIGH_VAR_DS >::Type DigitalSet
Definition: IntegralInvariantVolumeEstimator.h:129
DGtal::CountedPtr
Aim: Smart pointer based on reference counts.
Definition: CountedPtr.h:80
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::IntegralInvariantVolumeEstimator::setParams
void setParams(const double dRadius)
DGtal::DigitalSurfaceConvolver::Quantity
double Quantity
Definition: DigitalSurfaceConvolver.h:87
DGtal::concepts::ConceptUtils::SameType
Definition: ConceptUtils.h:107
DGtal::SimpleMatrix::Component
TComponent Component
Definition: SimpleMatrix.h:79
DGtal::IntegralInvariantVolumeEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< KSpace >))
DGtal::IntegralInvariantVolumeEstimator::myShapeSpelFunctor
CountedPtr< ShapeSpelFunctor > myShapeSpelFunctor
Smart pointer on functor spel -> {0,1}.
Definition: IntegralInvariantVolumeEstimator.h:315
DGtal::IntegralInvariantVolumeEstimator::IntegralInvariantVolumeEstimator
IntegralInvariantVolumeEstimator(const Self &other)
DGtal::IntegralInvariantVolumeEstimator::Component
Matrix::Component Component
Definition: IntegralInvariantVolumeEstimator.h:158
DGtal::PointVector< dim, Integer >
DGtal::IntegralInvariantVolumeEstimator::KernelSpelFunctor
functors::ConstValueCell< Value, Spel > KernelSpelFunctor
Definition: IntegralInvariantVolumeEstimator.h:148
DGtal::DigitalSurfaceConvolver::PairIterators
std::pair< KernelConstIterator, KernelConstIterator > PairIterators
Definition: DigitalSurfaceConvolver.h:97
DGtal::IntegralInvariantVolumeEstimator::myKernel
CountedPtr< KernelSupport > myKernel
Euclidean kernel.
Definition: IntegralInvariantVolumeEstimator.h:310
DGtal::IntegralInvariantVolumeEstimator::myShapePointFunctor
CountedPtr< ShapePointFunctor > myShapePointFunctor
Smart pointer on functor point -> {0,1}.
Definition: IntegralInvariantVolumeEstimator.h:314
DGtal::DigitalSurfaceConvolver
Definition: DigitalSurfaceConvolver.h:77
DGtal::IntegralInvariantVolumeEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< VolumeFunctor, Component, Quantity >))
DGtal::concepts::CPointPredicate
Aim: Defines a predicate on a point.
Definition: CPointPredicate.h:81
DGtal::IntegralInvariantVolumeEstimator::init
void init(const double _h, SurfelConstIterator itb, SurfelConstIterator ite)
DGtal::IntegralInvariantVolumeEstimator::RealVector
Space::RealVector RealVector
Definition: IntegralInvariantVolumeEstimator.h:128
DGtal::IntegralInvariantVolumeEstimator::myKernelsSet
std::vector< DigitalSet * > myKernelsSet
Array of shifting masks. Size = 9 for each shifting (0-adjacent and full kernel included)
Definition: IntegralInvariantVolumeEstimator.h:309
DGtal::IntegralInvariantVolumeEstimator::IntegralInvariantVolumeEstimator
IntegralInvariantVolumeEstimator(ConstAlias< KSpace > K, ConstAlias< PointPredicate > aPointPredicate, VolumeFunctor fct=VolumeFunctor())
DGtal::IntegralInvariantVolumeEstimator::myKernelFunctor
const KernelSpelFunctor myKernelFunctor
Kernel functor (on Spel)
Definition: IntegralInvariantVolumeEstimator.h:307
DGtal::IntegralInvariantVolumeEstimator::Domain
HyperRectDomain< Space > Domain
Definition: IntegralInvariantVolumeEstimator.h:125
DGtal::IntegralInvariantVolumeEstimator::DigitalShapeKernel
GaussDigitizer< Space, KernelSupport > DigitalShapeKernel
Definition: IntegralInvariantVolumeEstimator.h:151
DGtal::IntegralInvariantVolumeEstimator::eval
OutputIterator eval(SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator result) const
DGtal::concepts::CUnaryFunctor
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:90
DGtal::IntegralInvariantVolumeEstimator::Point
Space::Point Point
Definition: IntegralInvariantVolumeEstimator.h:126
DGtal::IntegralInvariantVolumeEstimator::Matrix
Convolver::CovarianceMatrix Matrix
Definition: IntegralInvariantVolumeEstimator.h:157
DGtal::DigitalSetByAssociativeContainer
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Definition: DigitalSetByAssociativeContainer.h:90
DGtal::IntegralInvariantVolumeEstimator::Self
IntegralInvariantVolumeEstimator< TKSpace, TPointPredicate, TVolumeFunctor > Self
Definition: IntegralInvariantVolumeEstimator.h:116