35 #if defined(DigitalSurfaceConvolver_RECURSES)
36 #error Recursive header files inclusion detected in DigitalSurfaceConvolver.h
37 #else // defined(DigitalSurfaceConvolver_RECURSES)
39 #define DigitalSurfaceConvolver_RECURSES
41 #if !defined DigitalSurfaceConvolver_h
43 #define DigitalSurfaceConvolver_h
48 #include "DGtal/base/Common.h"
49 #include "DGtal/kernel/PointVector.h"
50 #include "DGtal/math/linalg/SimpleMatrix.h"
51 #include "DGtal/base/ConstAlias.h"
52 #include "DGtal/base/Alias.h"
53 #include "DGtal/base/Clone.h"
54 #include "DGtal/topology/CCellFunctor.h"
55 #include "DGtal/topology/CanonicSCellEmbedder.h"
56 #include "DGtal/topology/SCellsFunctors.h"
75 template<
typename TFunctor,
typename TKernelFunctor,
typename TKSpace,
typename TDigitalKernel, Dimension dimension = TKSpace::dimension >
97 typedef std::pair< KernelConstIterator, KernelConstIterator >
PairIterators;
149 ConstAlias< std::vector< PairIterators > > masks );
168 ConstAlias< std::vector< PairIterators > > masks );
179 template<
typename SurfelIterator >
194 template<
typename SurfelIterator,
typename EvalFunctor >
196 EvalFunctor functor )
const;
209 template<
typename SurfelIterator,
typename OutputIterator >
210 void eval (
const SurfelIterator & itbegin,
211 const SurfelIterator & itend,
212 OutputIterator & result )
const;
226 template<
typename SurfelIterator,
typename OutputIterator,
typename EvalFunctor >
227 void eval (
const SurfelIterator & itbegin,
228 const SurfelIterator & itend,
229 OutputIterator & result,
230 EvalFunctor functor )
const;
242 template<
typename SurfelIterator >
256 template<
typename SurfelIterator,
typename EvalFunctor >
258 EvalFunctor functor )
const;
270 template<
typename SurfelIterator,
typename OutputIterator >
272 const SurfelIterator & itend,
273 OutputIterator & result )
const;
287 template<
typename SurfelIterator,
typename OutputIterator,
typename EvalFunctor >
289 const SurfelIterator & itend,
290 OutputIterator & result,
291 EvalFunctor functor )
const;
354 template<
typename SurfelIterator >
355 bool core_eval (
const SurfelIterator & it,
358 bool useLastResults =
false,
378 template<
typename SurfelIterator >
382 bool useLastResults =
false,
439 template<
typename TFunctor,
typename TKernelFunctor,
typename TKSpace,
typename TDigitalKernel >
463 typedef std::pair< KernelConstIterator, KernelConstIterator >
PairIterators;
514 ConstAlias< std::vector< PairIterators > > masks );
533 ConstAlias< std::vector< PairIterators > > masks );
544 template<
typename SurfelIterator >
559 template<
typename SurfelIterator,
typename EvalFunctor >
561 EvalFunctor functor )
const;
574 template<
typename SurfelIterator,
typename OutputIterator >
575 void eval (
const SurfelIterator & itbegin,
576 const SurfelIterator & itend,
577 OutputIterator & result )
const;
591 template<
typename SurfelIterator,
typename OutputIterator,
typename EvalFunctor >
592 void eval (
const SurfelIterator & itbegin,
593 const SurfelIterator & itend,
594 OutputIterator & result,
595 EvalFunctor functor )
const;
607 template<
typename SurfelIterator >
621 template<
typename SurfelIterator,
typename EvalFunctor >
623 EvalFunctor functor )
const;
635 template<
typename SurfelIterator,
typename OutputIterator >
637 const SurfelIterator & itend,
638 OutputIterator & result )
const;
652 template<
typename SurfelIterator,
typename OutputIterator,
typename EvalFunctor >
654 const SurfelIterator & itend,
655 OutputIterator & result,
656 EvalFunctor functor )
const;
719 template<
typename SurfelIterator >
720 bool core_eval (
const SurfelIterator & it,
723 bool useLastResults =
false,
743 template<
typename SurfelIterator >
747 bool useLastResults =
false,
806 template<
typename TFunctor,
typename TKernelFunctor,
typename TKSpace,
typename TDigitalKernel >
831 typedef std::pair< KernelConstIterator, KernelConstIterator >
PairIterators;
884 ConstAlias< std::vector< PairIterators > > masks );
903 ConstAlias< std::vector< PairIterators > > masks );
914 template<
typename SurfelIterator >
929 template<
typename SurfelIterator,
typename EvalFunctor >
931 EvalFunctor functor )
const;
944 template<
typename SurfelIterator,
typename OutputIterator >
945 void eval (
const SurfelIterator & itbegin,
946 const SurfelIterator & itend,
947 OutputIterator & result )
const;
961 template<
typename SurfelIterator,
typename OutputIterator,
typename EvalFunctor >
962 void eval (
const SurfelIterator & itbegin,
963 const SurfelIterator & itend,
964 OutputIterator & result,
965 EvalFunctor functor )
const;
977 template<
typename SurfelIterator >
991 template<
typename SurfelIterator,
typename EvalFunctor >
993 EvalFunctor functor )
const;
1005 template<
typename SurfelIterator,
typename OutputIterator >
1007 const SurfelIterator & itend,
1008 OutputIterator & result )
const;
1022 template<
typename SurfelIterator,
typename OutputIterator,
typename EvalFunctor >
1024 const SurfelIterator & itend,
1025 OutputIterator & result,
1026 EvalFunctor functor )
const;
1090 template<
typename SurfelIterator >
1091 bool core_eval (
const SurfelIterator & it,
1094 bool useLastResults =
false,
1114 template<
typename SurfelIterator >
1118 bool useLastResults =
false,
1184 template<
typename TF,
typename TKF,
typename TKS,
typename TDK, Dimension dimension >
1188 template<
typename TF,
typename TKF,
typename TKS,
typename TDK >
1192 template<
typename TF,
typename TKF,
typename TKS,
typename TDK >
1202 #include "DGtal/geometry/surfaces/DigitalSurfaceConvolver.ih"
1208 #endif // !defined DigitalSurfaceConvolver_h
1210 #undef DigitalSurfaceConvolver_RECURSES
1211 #endif // else defined(DigitalSurfaceConvolver_RECURSES)
const std::vector< PairIterators > * myMasks
Pointer of vector of iterators for kernel partial masks.
CanonicSCellEmbedder< KSpace > Embedder
static const int nbMoments
the number of moments is dependent to the dimension. In 2D, they are 6 moments such that p+q <= 2....
Z2i::DigitalSet::ConstIterator KernelConstIterator
const KSpace & myKSpace
Const ref of the shape Kspace.
const KSpace & myKSpace
Const ref of the shape Kspace.
~DigitalSurfaceConvolver()
SimpleMatrix< double, 2, 2 > CovarianceMatrix
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
static Spel defaultOuterSpel
default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions
bool core_evalCovarianceMatrix(const SurfelIterator &it, CovarianceMatrix &innerMatrix, CovarianceMatrix &outerMatrix, bool useLastResults=false, Spel &lastInnerSpel=defaultInnerSpel, Spel &lastOuterSpel=defaultOuterSpel, Quantity *lastInnerMoments=defaultInnerMoments, Quantity *lastOuterMoments=defaultOuterMoments) const
core_evalCovarianceMatrix method used ( in intern by evalCovarianceMatrix() ) to compute the covarian...
PointVector< dimension, Quantity > VectorQuantity
const DigitalKernel * myKernel
Two choice to iterate over the full kernel. See init() for more information.
Spel myKernelSpelOrigin
Copy of the origin cell of the kernel.
bool isInitKernelAndMasks
If the user uses init with masks and digital (full) kernel. See init() for more information.
SimpleMatrix< Quantity, dimension, dimension > MatrixQuantity
Z3i::DigitalSet::ConstIterator KernelConstIterator
TKernelFunctor KernelFunctor
~DigitalSurfaceConvolver()
const std::vector< PairIterators > * myMasks
Pointer of vector of iterators for kernel partial masks.
Spel myKernelSpelOrigin
Copy of the origin cell of the kernel.
Aim: Defines a functor on cells.
static Quantity defaultInnerSum
default Quantity, used as default parameter in core_eval function
static Quantity defaultInnerSum
default Quantity, used as default parameter in core_eval function
DGtal::uint32_t Dimension
const DigitalKernel * myKernel
Two choice to iterate over the full kernel. See init() for more information.
Embedder myEmbedder
Converter Digital point -> Euclidean point.
void fillMoments(Quantity *aMomentMatrix, const Spel &aSpel, double direction) const
fillMoments fill the matrix of moments with a given spel.
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
static Spel defaultInnerSpel
default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions
KSpace::Space::RealPoint RealPoint
CovarianceMatrix evalCovarianceMatrix(const SurfelIterator &it) const
BOOST_CONCEPT_ASSERT((concepts::CCellFunctor< Functor >))
SimpleMatrix< Quantity, 3, 3 > MatrixQuantity
TDigitalKernel DigitalKernel
Z2i::DigitalSet::ConstIterator KernelConstIterator
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
std::pair< KernelConstIterator, KernelConstIterator > PairIterators
static Quantity defaultOuterSum
default Quantity, used as default parameter in core_eval function
static const int nbMoments
the number of moments is dependent to the dimension. In 2D, they are 6 moments such that p+q <= 2 (se...
static Quantity defaultInnerSum
default Quantity, used as default parameter in core_eval function
TKernelFunctor KernelFunctor
PointVector< 3, Quantity > VectorQuantity
static const int nbMoments
the number of moments is dependent to the dimension. In 3D, they are 10 moments such that p+q+s <= 2 ...
Quantity eval(const SurfelIterator &it) const
Embedder myEmbedder
Converter Digital point -> Euclidean point.
const Functor & myFFunctor
Const ref of the shape functor.
void computeCovarianceMatrix(const Quantity *aMomentMatrix, CovarianceMatrix &aCovarianceMatrix) const
computeCovarianceMatrix compute the covariance matrix from matrix of moments.
static Quantity defaultOuterSum
default Quantity, used as default parameter in core_eval function
Aim: implements basic MxN Matrix services (M,N>=1).
TDigitalKernel DigitalKernel
const KSpace & myKSpace
Const ref of the shape Kspace.
const PairIterators * myKernelMask
Two choice to iterate over the full kernel. See init() for more information.
PointVector< 2, Quantity > VectorQuantity
DGtal is the top-level namespace which contains all DGtal functions and types.
const std::vector< PairIterators > * myMasks
Pointer of vector of iterators for kernel partial masks.
const DigitalKernel * myKernel
Two choice to iterate over the full kernel. See init() for more information.
CanonicSCellEmbedder< KSpace > Embedder
static Spel defaultInnerSpel
default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions
SimpleMatrix< Quantity, 2, 2 > MatrixQuantity
const KernelFunctor & myGFunctor
Const ref of the kernel functor.
const KernelFunctor & myGFunctor
Const ref of the kernel functor.
Embedder myEmbedder
Converter Digital point -> Euclidean point.
DigitalSurfaceConvolver()
static Quantity defaultOuterMoments[6]
default array of Quantity, used as default parameter in core_evalCovarianceMatrix function
DigitalSurfaceConvolver & operator=(const DigitalSurfaceConvolver &other)
const PairIterators * myKernelMask
Two choice to iterate over the full kernel. See init() for more information.
KSpace::Space::RealPoint RealPoint
static Spel defaultOuterSpel
default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions
~DigitalSurfaceConvolver()
bool isInitKernelAndMasks
If the user uses init with masks and digital (full) kernel. See init() for more information.
SimpleMatrix< double, dimension, dimension > CovarianceMatrix
PointVector< dim, double > RealPoint
const Functor & myFFunctor
Const ref of the shape functor.
SimpleMatrix< double, 3, 3 > CovarianceMatrix
const KernelFunctor & myGFunctor
Const ref of the kernel functor.
std::pair< KernelConstIterator, KernelConstIterator > PairIterators
const Dimension dimension
Current dimension (= 2)
KSpace::Space::RealPoint RealPoint
Aim: Implements basic operations that will be used in Point and Vector classes.
std::pair< KernelConstIterator, KernelConstIterator > PairIterators
Spel myKernelSpelOrigin
Copy of the origin cell of the kernel.
static Quantity defaultOuterSum
default Quantity, used as default parameter in core_eval function
TDigitalKernel DigitalKernel
CanonicSCellEmbedder< KSpace > Embedder
void init(const Point &pOrigin, ConstAlias< PairIterators > fullKernel, ConstAlias< std::vector< PairIterators > > masks)
static Spel defaultInnerSpel
default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions
Container::const_iterator ConstIterator
ConstIterator type of the container;.
const Dimension dimension
Current dimension (= 3)
const Functor & myFFunctor
Const ref of the shape functor.
static Quantity defaultInnerMoments[6]
default array of Quantity, used as default parameter in core_evalCovarianceMatrix function
bool isInitFullMasks
If the user uses init with masks. See init() for more information.
bool isInitFullMasks
If the user uses init with masks. See init() for more information.
TKernelFunctor KernelFunctor
bool isInitKernelAndMasks
If the user uses init with masks and digital (full) kernel. See init() for more information.
bool isInitFullMasks
If the user uses init with masks. See init() for more information.
bool core_eval(const SurfelIterator &it, Quantity &innerSum, Quantity &outerSum, bool useLastResults=false, Spel &lastInnerSpel=defaultInnerSpel, Spel &lastOuterSpel=defaultOuterSpel, Quantity &lastInnerSum=defaultInnerSum, Quantity &lastOuterSum=defaultOuterSum) const
core_eval method used ( in intern by eval() ) to compute the Quantity on a given surfel (*it)
const PairIterators * myKernelMask
Two choice to iterate over the full kernel. See init() for more information.
static Spel defaultOuterSpel
default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions