DGtal  1.5.beta
DigitalSurfaceConvolver.h
1 
16 #pragma once
17 
34 #if defined(DigitalSurfaceConvolver_RECURSES)
35 #error Recursive header files inclusion detected in DigitalSurfaceConvolver.h
36 #else // defined(DigitalSurfaceConvolver_RECURSES)
38 #define DigitalSurfaceConvolver_RECURSES
39 
40 #if !defined DigitalSurfaceConvolver_h
42 #define DigitalSurfaceConvolver_h
43 
45 // Inclusions
46 #include <iostream>
47 #include "DGtal/base/Common.h"
48 #include "DGtal/kernel/PointVector.h"
49 #include "DGtal/math/linalg/SimpleMatrix.h"
50 #include "DGtal/base/ConstAlias.h"
51 #include "DGtal/base/Alias.h"
52 #include "DGtal/base/Clone.h"
53 #include "DGtal/topology/CCellFunctor.h"
54 #include "DGtal/topology/CanonicSCellEmbedder.h"
55 #include "DGtal/topology/SCellsFunctors.h"
57 
58 namespace DGtal
59 {
60 
62 // template class DigitalSurfaceConvolver
74 template< typename TFunctor, typename TKernelFunctor, typename TKSpace, typename TDigitalKernel, Dimension dimension = TKSpace::dimension >
76 {
77 public:
78 
79  typedef TFunctor Functor;
80  typedef TKSpace KSpace;
81  typedef TKernelFunctor KernelFunctor;
82  typedef TDigitalKernel DigitalKernel;
83 
85 
86  typedef double Quantity;
90 
91  typedef typename KSpace::SCell Spel;
92  typedef typename KSpace::Point Point;
95 
96  typedef std::pair< KernelConstIterator, KernelConstIterator > PairIterators;
98 
101 
102  // ----------------------- Standard services ------------------------------
103 
104 public:
105 
114 
120 
121 
126 
127  // ----------------------- Interface --------------------------------------
128 
129 public:
130 
146  void init ( const Point & pOrigin,
147  ConstAlias< PairIterators > fullKernel,
148  ConstAlias< std::vector< PairIterators > > masks );
149 
165  void init ( const Point & pOrigin,
166  ConstAlias< DigitalKernel > fullKernel,
167  ConstAlias< std::vector< PairIterators > > masks );
168 
178  template< typename SurfelIterator >
179  Quantity eval ( const SurfelIterator & it ) const;
180 
181 
193  template< typename SurfelIterator, typename EvalFunctor >
194  typename EvalFunctor::Value eval ( const SurfelIterator & it,
195  EvalFunctor functor ) const;
196 
197 
208  template< typename SurfelIterator, typename OutputIterator >
209  void eval ( const SurfelIterator & itbegin,
210  const SurfelIterator & itend,
211  OutputIterator & result ) const;
212 
225  template< typename SurfelIterator, typename OutputIterator, typename EvalFunctor >
226  void eval ( const SurfelIterator & itbegin,
227  const SurfelIterator & itend,
228  OutputIterator & result,
229  EvalFunctor functor ) const;
230 
231 
241  template< typename SurfelIterator >
242  CovarianceMatrix evalCovarianceMatrix ( const SurfelIterator & it ) const;
243 
255  template< typename SurfelIterator, typename EvalFunctor >
256  typename EvalFunctor::Value evalCovarianceMatrix ( const SurfelIterator & it,
257  EvalFunctor functor ) const;
258 
269  template< typename SurfelIterator, typename OutputIterator >
270  void evalCovarianceMatrix ( const SurfelIterator & itbegin,
271  const SurfelIterator & itend,
272  OutputIterator & result ) const;
273 
286  template< typename SurfelIterator, typename OutputIterator, typename EvalFunctor >
287  void evalCovarianceMatrix ( const SurfelIterator & itbegin,
288  const SurfelIterator & itend,
289  OutputIterator & result,
290  EvalFunctor functor ) const;
291 
292 
297  bool isValid () const;
298 
299 protected:
300 
311  void computeCovarianceMatrix( const Quantity * aMomentMatrix, CovarianceMatrix & aCovarianceMatrix ) const;
312 
324  void fillMoments( Quantity* aMomentMatrix, const Spel & aSpel, double direction ) const;
325 
326 #ifdef _MSC_VER
327  // For Visual Studio, to be defined as a static const, it has to be intialized into the header file
328  static const int nbMoments = 6;
329 #else
330  static const int nbMoments;
331 #endif //_MSC_VER
338 
353  template< typename SurfelIterator >
354  bool core_eval ( const SurfelIterator & it,
355  Quantity & innerSum,
356  Quantity & outerSum,
357  bool useLastResults = false,
358  Spel & lastInnerSpel = defaultInnerSpel,
359  Spel & lastOuterSpel = defaultOuterSpel,
360  Quantity & lastInnerSum = defaultInnerSum,
361  Quantity & lastOuterSum = defaultOuterSum ) const;
362 
377  template< typename SurfelIterator >
378  bool core_evalCovarianceMatrix ( const SurfelIterator & it,
379  CovarianceMatrix & innerMatrix,
380  CovarianceMatrix & outerMatrix,
381  bool useLastResults = false,
382  Spel & lastInnerSpel = defaultInnerSpel,
383  Spel & lastOuterSpel = defaultOuterSpel,
384  Quantity * lastInnerMoments = defaultInnerMoments,
385  Quantity * lastOuterMoments = defaultOuterMoments ) const;
386 
387 
388 
389  // ------------------------- Private Datas --------------------------------
390 
391 private:
392 
393  const Functor & myFFunctor;
394 
396 
397 
398  const KSpace & myKSpace;
399 
401 
403 
405 
406  const std::vector< PairIterators > * myMasks;
407 
410 
412 
413  // ------------------------- Hidden services ------------------------------
414 
415 protected:
421 
422 private:
423 
431 
432  // ------------------------- Internals ------------------------------------
433 
434 private:
435 
436 }; // end of class DigitalSurfaceConvolver
437 
438 template< typename TFunctor, typename TKernelFunctor, typename TKSpace, typename TDigitalKernel >
439 class DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 2 >
440 {
441  // ----------------------- Types ------------------------------------------
442 
443 public:
444 
445  typedef TFunctor Functor;
446  typedef TKSpace KSpace;
447  typedef TKernelFunctor KernelFunctor;
448  typedef TDigitalKernel DigitalKernel;
449 
451 
452  typedef double Quantity;
456 
457  typedef typename KSpace::SCell Spel;
458  typedef typename KSpace::Point Point;
461 
462  typedef std::pair< KernelConstIterator, KernelConstIterator > PairIterators;
464 
467 
468  // ----------------------- Standard services ------------------------------
469 
470 public:
471 
480 
486 
491 
492  // ----------------------- Interface --------------------------------------
493 
494 public:
495 
511  void init ( const Point & pOrigin,
512  ConstAlias< PairIterators > fullKernel,
513  ConstAlias< std::vector< PairIterators > > masks );
514 
530  void init ( const Point & pOrigin,
531  ConstAlias< DigitalKernel > fullKernel,
532  ConstAlias< std::vector< PairIterators > > masks );
533 
543  template< typename SurfelIterator >
544  Quantity eval ( const SurfelIterator & it ) const;
545 
546 
558  template< typename SurfelIterator, typename EvalFunctor >
559  typename EvalFunctor::Value eval ( const SurfelIterator & it,
560  EvalFunctor functor ) const;
561 
562 
573  template< typename SurfelIterator, typename OutputIterator >
574  void eval ( const SurfelIterator & itbegin,
575  const SurfelIterator & itend,
576  OutputIterator & result ) const;
577 
590  template< typename SurfelIterator, typename OutputIterator, typename EvalFunctor >
591  void eval ( const SurfelIterator & itbegin,
592  const SurfelIterator & itend,
593  OutputIterator & result,
594  EvalFunctor functor ) const;
595 
596 
606  template< typename SurfelIterator >
607  CovarianceMatrix evalCovarianceMatrix ( const SurfelIterator & it ) const;
608 
620  template< typename SurfelIterator, typename EvalFunctor >
621  typename EvalFunctor::Value evalCovarianceMatrix ( const SurfelIterator & it,
622  EvalFunctor functor ) const;
623 
634  template< typename SurfelIterator, typename OutputIterator >
635  void evalCovarianceMatrix ( const SurfelIterator & itbegin,
636  const SurfelIterator & itend,
637  OutputIterator & result ) const;
638 
651  template< typename SurfelIterator, typename OutputIterator, typename EvalFunctor >
652  void evalCovarianceMatrix ( const SurfelIterator & itbegin,
653  const SurfelIterator & itend,
654  OutputIterator & result,
655  EvalFunctor functor ) const;
656 
657 
662  bool isValid () const;
663 
664 protected:
665 
676  void computeCovarianceMatrix( const Quantity * aMomentMatrix, CovarianceMatrix & aCovarianceMatrix ) const;
677 
689  void fillMoments( Quantity* aMomentMatrix, const Spel & aSpel, double direction ) const;
690 
691 #ifdef _MSC_VER
692  // For Visual Studio, to be defined as a static const, it has to be intialized into the header file
693  static const int nbMoments = 6;
694 #else
695  static const int nbMoments;
696 #endif //_MSC_VER
703 
718  template< typename SurfelIterator >
719  bool core_eval ( const SurfelIterator & it,
720  Quantity & innerSum,
721  Quantity & outerSum,
722  bool useLastResults = false,
723  Spel & lastInnerSpel = defaultInnerSpel,
724  Spel & lastOuterSpel = defaultOuterSpel,
725  Quantity & lastInnerSum = defaultInnerSum,
726  Quantity & lastOuterSum = defaultOuterSum ) const;
727 
742  template< typename SurfelIterator >
743  bool core_evalCovarianceMatrix ( const SurfelIterator & it,
744  CovarianceMatrix & innerMatrix,
745  CovarianceMatrix & outerMatrix,
746  bool useLastResults = false,
747  Spel & lastInnerSpel = defaultInnerSpel,
748  Spel & lastOuterSpel = defaultOuterSpel,
749  Quantity * lastInnerMoments = defaultInnerMoments,
750  Quantity * lastOuterMoments = defaultOuterMoments ) const;
751 
752 
753 
754  // ------------------------- Private Datas --------------------------------
755 
756 private:
757 
759 
760  const Functor & myFFunctor;
761 
763 
764 
765  const KSpace & myKSpace;
766 
768 
770 
772 
773  const std::vector< PairIterators > * myMasks;
774 
777 
779 
780  // ------------------------- Hidden services ------------------------------
781 
782 protected:
788 
789 private:
790 
798 
799  // ------------------------- Internals ------------------------------------
800 
801 private:
802 
803 }; // end of class DigitalSurfaceConvolver
804 
805 template< typename TFunctor, typename TKernelFunctor, typename TKSpace, typename TDigitalKernel >
806 class DigitalSurfaceConvolver< TFunctor, TKernelFunctor, TKSpace, TDigitalKernel, 3 >
807 {
808  // ----------------------- Types ------------------------------------------
809 
810 public:
811 
812  typedef TFunctor Functor;
813  typedef TKSpace KSpace;
814  typedef TKernelFunctor KernelFunctor;
815  typedef TDigitalKernel DigitalKernel;
816 
818 
819  typedef double Quantity;
823 
824  typedef typename KSpace::SCell Spel;
825  typedef typename KSpace::Point Point;
828 
829 
830  typedef std::pair< KernelConstIterator, KernelConstIterator > PairIterators;
832 
835 
836  // ----------------------- Standard services ------------------------------
837 
838 public:
839 
849  ConstAlias< KSpace > space );
850 
856 
861 
862  // ----------------------- Interface --------------------------------------
863 
864 public:
865 
881  void init ( const Point & pOrigin,
882  ConstAlias< PairIterators > fullKernel,
883  ConstAlias< std::vector< PairIterators > > masks );
884 
900  void init ( const Point & pOrigin,
901  ConstAlias< DigitalKernel > fullKernel,
902  ConstAlias< std::vector< PairIterators > > masks );
903 
913  template< typename SurfelIterator >
914  Quantity eval ( const SurfelIterator & it ) const;
915 
916 
928  template< typename SurfelIterator, typename EvalFunctor >
929  typename EvalFunctor::Value eval ( const SurfelIterator & it,
930  EvalFunctor functor ) const;
931 
932 
943  template< typename SurfelIterator, typename OutputIterator >
944  void eval ( const SurfelIterator & itbegin,
945  const SurfelIterator & itend,
946  OutputIterator & result ) const;
947 
960  template< typename SurfelIterator, typename OutputIterator, typename EvalFunctor >
961  void eval ( const SurfelIterator & itbegin,
962  const SurfelIterator & itend,
963  OutputIterator & result,
964  EvalFunctor functor ) const;
965 
966 
976  template< typename SurfelIterator >
977  CovarianceMatrix evalCovarianceMatrix ( const SurfelIterator & it ) const;
978 
990  template< typename SurfelIterator, typename EvalFunctor >
991  typename EvalFunctor::Value evalCovarianceMatrix ( const SurfelIterator & it,
992  EvalFunctor functor ) const;
993 
1004  template< typename SurfelIterator, typename OutputIterator >
1005  void evalCovarianceMatrix ( const SurfelIterator & itbegin,
1006  const SurfelIterator & itend,
1007  OutputIterator & result ) const;
1008 
1021  template< typename SurfelIterator, typename OutputIterator, typename EvalFunctor >
1022  void evalCovarianceMatrix ( const SurfelIterator & itbegin,
1023  const SurfelIterator & itend,
1024  OutputIterator & result,
1025  EvalFunctor functor ) const;
1026 
1031  bool isValid() const;
1032 
1033 protected:
1034 
1046  void computeCovarianceMatrix ( const Quantity * aMomentMatrix, CovarianceMatrix & aCovarianceMatrix ) const;
1047 
1060  void fillMoments ( Quantity * aMomentMatrix, const Spel & aSpel, double direction ) const;
1061 
1062 #ifdef _MSC_VER
1063  // For Visual Studio, to be defined as a static const, it has to be intialized into the header file
1064  static const int nbMoments = 10;
1065 #else
1066  static const int nbMoments;
1067 #endif //_MSC_VER
1074 
1089  template< typename SurfelIterator >
1090  bool core_eval ( const SurfelIterator & it,
1091  Quantity & innerSum,
1092  Quantity & outerSum,
1093  bool useLastResults = false,
1094  Spel & lastInnerSpel = defaultInnerSpel,
1095  Spel & lastOuterSpel = defaultOuterSpel,
1096  Quantity & lastInnerSum = defaultInnerSum,
1097  Quantity & lastOuterSum = defaultOuterSum ) const;
1098 
1113  template< typename SurfelIterator >
1114  bool core_evalCovarianceMatrix ( const SurfelIterator & it,
1115  CovarianceMatrix & innerMatrix,
1116  CovarianceMatrix & outerMatrix,
1117  bool useLastResults = false,
1118  Spel & lastInnerSpel = defaultInnerSpel,
1119  Spel & lastOuterSpel = defaultOuterSpel,
1120  Quantity * lastInnerMoments = defaultInnerMoments,
1121  Quantity * lastOuterMoments = defaultOuterMoments ) const;
1122 
1123 
1124  // ------------------------- Private Datas --------------------------------
1125 
1126 private:
1127 
1129 
1131 
1133 
1134 
1135  const KSpace & myKSpace;
1136 
1138 
1140 
1142 
1143  const std::vector< PairIterators > * myMasks;
1144 
1147 
1149 
1150  // ------------------------- Hidden services ------------------------------
1151 
1152 protected:
1158 
1159 private:
1160 
1168 
1169  // ------------------------- Internals ------------------------------------
1170 
1171 private:
1172 
1173 }; // end of class DigitalSurfaceConvolver
1174 
1175 
1176 
1183 template< typename TF, typename TKF, typename TKS, typename TDK, Dimension dimension >
1184 std::ostream&
1186 
1187 template< typename TF, typename TKF, typename TKS, typename TDK >
1188 std::ostream&
1189 operator<< ( std::ostream & out, const DGtal::DigitalSurfaceConvolver< TF, TKF, TKS, TDK, 2 > & object );
1190 
1191 template< typename TF, typename TKF, typename TKS, typename TDK >
1192 std::ostream&
1193 operator<< ( std::ostream & out, const DGtal::DigitalSurfaceConvolver<TF, TKF, TKS, TDK, 3 > & object );
1194 
1195 
1196 } // namespace DGtal
1197 
1198 
1200 // Includes inline functions.
1201 #include "DGtal/geometry/surfaces/DigitalSurfaceConvolver.ih"
1202 
1203 
1204 // //
1206 
1207 #endif // !defined DigitalSurfaceConvolver_h
1208 
1209 #undef DigitalSurfaceConvolver_RECURSES
1210 #endif // else defined(DigitalSurfaceConvolver_RECURSES)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:187
Container::const_iterator ConstIterator
ConstIterator type of the container;.
void evalCovarianceMatrix(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result) const
void eval(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result, EvalFunctor functor) const
void init(const Point &pOrigin, ConstAlias< PairIterators > fullKernel, ConstAlias< std::vector< PairIterators > > masks)
EvalFunctor::Value eval(const SurfelIterator &it, EvalFunctor functor) const
DigitalSurfaceConvolver(ConstAlias< Functor > f, ConstAlias< KernelFunctor > g, ConstAlias< KSpace > space)
const DigitalKernel * myKernel
Two choice to iterate over the full kernel. 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)
static Spel defaultOuterSpel
default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions
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
void evalCovarianceMatrix(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result, EvalFunctor functor) const
void fillMoments(Quantity *aMomentMatrix, const Spel &aSpel, double direction) const
fillMoments fill the matrix of moments with a given spel.
EvalFunctor::Value evalCovarianceMatrix(const SurfelIterator &it, EvalFunctor functor) const
static Quantity defaultInnerSum
default Quantity, used as default parameter in core_eval function
bool isInitFullMasks
If the user uses init with masks. See init() for more information.
void eval(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result) const
const std::vector< PairIterators > * myMasks
Pointer of vector of iterators for kernel partial masks.
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...
bool isInitKernelAndMasks
If the user uses init with masks and digital (full) kernel. See init() for more information.
static Spel defaultInnerSpel
default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions
static const int nbMoments
the number of moments is dependent to the dimension. In 2D, they are 6 moments such that p+q <= 2....
const PairIterators * myKernelMask
Two choice to iterate over the full kernel. See init() for more information.
void init(const Point &pOrigin, ConstAlias< DigitalKernel > fullKernel, ConstAlias< std::vector< PairIterators > > masks)
void eval(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result) const
static Quantity defaultOuterSum
default Quantity, used as default parameter in core_eval function
const PairIterators * myKernelMask
Two choice to iterate over the full kernel. See init() for more information.
void evalCovarianceMatrix(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result, EvalFunctor functor) const
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...
void init(const Point &pOrigin, ConstAlias< DigitalKernel > fullKernel, ConstAlias< std::vector< PairIterators > > masks)
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)
void evalCovarianceMatrix(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result) const
const std::vector< PairIterators > * myMasks
Pointer of vector of iterators for kernel partial masks.
void computeCovarianceMatrix(const Quantity *aMomentMatrix, CovarianceMatrix &aCovarianceMatrix) const
computeCovarianceMatrix compute the covariance matrix from matrix of moments.
EvalFunctor::Value evalCovarianceMatrix(const SurfelIterator &it, EvalFunctor functor) const
static Quantity defaultInnerSum
default Quantity, used as default parameter in core_eval function
void eval(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result, EvalFunctor functor) const
bool isInitFullMasks
If the user uses init with masks. See init() for more information.
bool isInitKernelAndMasks
If the user uses init with masks and digital (full) kernel. See init() for more information.
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 ...
const DigitalKernel * myKernel
Two choice to iterate over the full kernel. See init() for more information.
DigitalSurfaceConvolver(ConstAlias< Functor > f, ConstAlias< KernelFunctor > g, ConstAlias< KSpace > space)
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
EvalFunctor::Value eval(const SurfelIterator &it, EvalFunctor functor) const
static Spel defaultOuterSpel
default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions
void fillMoments(Quantity *aMomentMatrix, const Spel &aSpel, double direction) const
fillMoments fill the matrix of moments with a given spel.
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
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...
const Functor & myFFunctor
Const ref of the shape functor.
std::pair< KernelConstIterator, KernelConstIterator > PairIterators
Embedder myEmbedder
Converter Digital point -> Euclidean point.
bool isInitKernelAndMasks
If the user uses init with masks and digital (full) kernel. See init() for more information.
static Quantity defaultInnerMoments[6]
default array of Quantity, used as default parameter in core_evalCovarianceMatrix function
Quantity eval(const SurfelIterator &it) const
static Quantity defaultInnerSum
default Quantity, used as default parameter in core_eval function
Z2i::DigitalSet::ConstIterator KernelConstIterator
Spel myKernelSpelOrigin
Copy of the origin cell of the kernel.
static Quantity defaultOuterMoments[6]
default array of Quantity, used as default parameter in core_evalCovarianceMatrix function
void init(const Point &pOrigin, ConstAlias< DigitalKernel > fullKernel, ConstAlias< std::vector< PairIterators > > masks)
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)
void eval(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result, EvalFunctor functor) const
const DigitalKernel * myKernel
Two choice to iterate over the full kernel. See init() for more information.
BOOST_CONCEPT_ASSERT((concepts::CCellFunctor< Functor >))
const KernelFunctor & myGFunctor
Const ref of the kernel functor.
const std::vector< PairIterators > * myMasks
Pointer of vector of iterators for kernel partial masks.
static Spel defaultOuterSpel
default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions
void init(const Point &pOrigin, ConstAlias< PairIterators > fullKernel, ConstAlias< std::vector< PairIterators > > masks)
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
DigitalSurfaceConvolver & operator=(const DigitalSurfaceConvolver &other)
SimpleMatrix< Quantity, dimension, dimension > MatrixQuantity
const PairIterators * myKernelMask
Two choice to iterate over the full kernel. See init() for more information.
const KSpace & myKSpace
Const ref of the shape Kspace.
EvalFunctor::Value eval(const SurfelIterator &it, EvalFunctor functor) const
void evalCovarianceMatrix(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result, EvalFunctor functor) const
void eval(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result) const
BOOST_CONCEPT_ASSERT((concepts::CCellFunctor< KernelFunctor >))
DigitalSurfaceConvolver(ConstAlias< Functor > f, ConstAlias< KernelFunctor > g, ConstAlias< KSpace > space)
static Spel defaultInnerSpel
default Spel, used as default parameter in core_eval and core_evalCovarianceMatrix functions
bool isInitFullMasks
If the user uses init with masks. See init() for more information.
CovarianceMatrix evalCovarianceMatrix(const SurfelIterator &it) const
EvalFunctor::Value evalCovarianceMatrix(const SurfelIterator &it, EvalFunctor functor) const
KSpace::Space::RealPoint RealPoint
DigitalSurfaceConvolver(const DigitalSurfaceConvolver &other)
void evalCovarianceMatrix(const SurfelIterator &itbegin, const SurfelIterator &itend, OutputIterator &result) const
SimpleMatrix< double, dimension, dimension > CovarianceMatrix
void fillMoments(Quantity *aMomentMatrix, const Spel &aSpel, double direction) const
fillMoments fill the matrix of moments with a given spel.
CanonicSCellEmbedder< KSpace > Embedder
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:593
Aim: implements basic MxN Matrix services (M,N>=1).
Definition: SimpleMatrix.h:76
PointVector< dim, double > RealPoint
Definition: SpaceND.h:117
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::uint32_t Dimension
Definition: Common.h:136
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Aim: Defines a functor on cells.
Definition: CCellFunctor.h:90