DGtal  1.1.0
LambdaMST3D.h
1 
17 #pragma once
18 
29 #if defined(LAMBDAMST3D_RECURSES)
30 #error Recursive header files inclusion detected in LambdaMST3D.h
31 #else // defined(LAMBDAMST3D_RECURSES)
32 
33 #define LAMBDAMST3D_RECURSES
34 
35 #if !defined LAMBDAMST3D_h
36 
37 #define LAMBDAMST3D_h
38 
39 #include <algorithm>
40 #include <iterator>
41 #include <cmath>
42 #include <vector>
43 #include <map>
44 #include <DGtal/base/Common.h>
45 #include <DGtal/helpers/StdDefs.h>
46 #include "DGtal/kernel/CSpace.h"
47 #include "DGtal/kernel/PointVector.h"
48 #include "DGtal/geometry/curves/estimation/FunctorsLambdaMST.h"
49 #include "DGtal/geometry/curves/CForwardSegmentComputer.h"
50 #include "DGtal/geometry/curves/estimation/CLMSTTangentFromDSS.h"
51 #include "DGtal/geometry/curves/estimation/CLMSTDSSFilter.h"
52 
53 namespace DGtal {
61  template < typename TSpace, typename TSegmentation, typename Functor, typename DSSFilter >
63  {
64  public:
65  //Checking concepts
67  BOOST_STATIC_ASSERT(( TSpace::dimension == 3 ));
71  // ----------------------- Types ------------------------------
72  public:
74  typedef TSegmentation Segmentation;
76  typedef typename TSegmentation::SegmentComputer SegmentComputer;
80  typedef typename Functor::Value Value;
82  typedef typename TSpace::RealVector RealVector;
84  typedef typename TSpace::Point Point;
85 
86  // ----------------------- Standard services ------------------------------
87  public:
90 
96  void init ( ConstIterator itb, ConstIterator ite );
97 
101  void attach ( Alias<TSegmentation> segmentComputer );
102 
107  bool isValid ( ) const;
108 
118  RealVector eval ( const Point & p );
119 
128  template <typename OutputIterator>
129  OutputIterator eval ( ConstIterator itb, ConstIterator ite, OutputIterator result );
130 
135  DSSFilter & getDSSFilter ( );
136 
137  // ------------------------- Internals ------------------------------------
138  protected:
139 
140  typedef typename std::vector<SegmentComputer >::const_iterator OrphanDSSIterator;
141 
155  template <typename OutputIterator>
156  void accumulate ( std::multimap < Point, Value > & outValues, ConstIterator itb, ConstIterator ite, OutputIterator & result );
157 
167  template < typename DSSesIterator, typename OrphanIterator >
168 
169  void treatOrphans(DSSesIterator begin, DSSesIterator end, OrphanIterator obegin, OrphanIterator oend,
170  std::multimap<Point, Value> &outValues);
171 
172 
173  // ------------------------- Private Datas --------------------------------
174  private:
186  TSegmentation * dssSegments;
193 
194  DSSFilter myDSSFilter;
195 
196  }; // end of class LambdaTangentFromDSSEstimator
197 
198  //-------------------------------------------------------------------------------------------
199 
200  // Template class LambdaMST3D
207  template < typename DSSSegmentationComputer, typename LambdaFunction = functors::Lambda64Function,
209  class LambdaMST3D:
210  public LambdaMST3DEstimator<Z3i::Space, DSSSegmentationComputer,
211  TangentFromDSS3DFunctor< typename DSSSegmentationComputer::SegmentComputer, LambdaFunction >, DSSFilter >
212  {
213  typedef
214  LambdaMST3DEstimator<Z3i::Space, DSSSegmentationComputer,
216 
217  public:
222  };
223 }// namespace DGtal
224 
226 // Includes inline functions
227 #include "DGtal/geometry/curves/estimation/LambdaMST3D.ih"
228 // //
230 
231 #endif // !defined LAMBDAMST3D_h
232 
233 #undef LAMBDAMST3D_RECURSES
234 #endif // else defined(LAMBDAMST3D_RECURSES)
DGtal::LambdaMST3DEstimator::RealVector
TSpace::RealVector RealVector
Type of 3d real vector.
Definition: LambdaMST3D.h:82
ConstIterator
MyDigitalSurface::ConstIterator ConstIterator
Definition: greedy-plane-segmentation-ex2.cpp:93
DGtal::concepts::CSpace
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition: CSpace.h:106
DGtal::LambdaMST3DEstimator::getDSSFilter
DSSFilter & getDSSFilter()
RealVector
Z3i::RealVector RealVector
Definition: sphereCotangentLaplaceOperator.cpp:71
DGtal::LambdaMST3DEstimator::Point
TSpace::Point Point
Type of 3d real point.
Definition: LambdaMST3D.h:84
DGtal::LambdaMST3DEstimator::Value
Functor::Value Value
Type returned by model of CLMSTTangentFrom2DSS.
Definition: LambdaMST3D.h:80
DGtal::LambdaMST3DEstimator::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((TSpace::dimension==3))
DGtal::LambdaMST3DEstimator::OrphanDSSIterator
std::vector< SegmentComputer >::const_iterator OrphanDSSIterator
Definition: LambdaMST3D.h:140
Functor
InHalfPlaneBySimple3x3Matrix< Point, double > Functor
Definition: testConvexHull2DReverse.cpp:51
DGtal::LambdaMST3DEstimator::dssSegments
TSegmentation * dssSegments
Definition: LambdaMST3D.h:186
DGtal::Z3i::Space
SpaceND< 3, Integer > Space
Definition: StdDefs.h:144
DGtal::LambdaMST3DEstimator::myDSSFilter
DSSFilter myDSSFilter
Definition: LambdaMST3D.h:194
DGtal::concepts::CLMSTDSSFilter
Aim: Defines the concept describing a functor which filters DSSes for L-MST calculations.
Definition: CLMSTDSSFilter.h:90
DGtal::LambdaMST3DEstimator::myEnd
ConstIterator myEnd
Definition: LambdaMST3D.h:182
DGtal::functors::Lambda64Function
Definition: FunctorsLambdaMST.h:69
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::LambdaMST3DEstimator::attach
void attach(Alias< TSegmentation > segmentComputer)
DGtal::LambdaMST3DEstimator::eval
RealVector eval(const Point &p)
DGtal::LambdaMST3D
Aim: Simplify creation of Lambda MST tangent estimator.
Definition: LambdaMST3D.h:212
DGtal::LambdaMST3DEstimator::LambdaMST3DEstimator
LambdaMST3DEstimator()
Default constructor.
DGtal::LambdaMST3DEstimator::accumulate
void accumulate(std::multimap< Point, Value > &outValues, ConstIterator itb, ConstIterator ite, OutputIterator &result)
Accumulate partial results obtained for each point. In 3D it can happen that DSSs' direction vectors ...
DGtal::LambdaMST3DEstimator::init
void init(ConstIterator itb, ConstIterator ite)
DGtal::LambdaMST3D::Super
LambdaMST3DEstimator< Z3i::Space, DSSSegmentationComputer, TangentFromDSS3DFunctor< typename DSSSegmentationComputer::SegmentComputer, LambdaFunction >, DSSFilter > Super
Definition: LambdaMST3D.h:215
DGtal::LambdaMST3DEstimator::SegmentComputer
TSegmentation::SegmentComputer SegmentComputer
Curve segmentation algorithm.
Definition: LambdaMST3D.h:76
DGtal::LambdaMST3DEstimator::ConstIterator
SegmentComputer::ConstIterator ConstIterator
Type of iterator, at least readable and forward.
Definition: LambdaMST3D.h:78
DGtal::LambdaMST3DEstimator::Segmentation
TSegmentation Segmentation
Tangential cover algorithm.
Definition: LambdaMST3D.h:74
DGtal::LambdaMST3DEstimator::treatOrphan
Value treatOrphan(OrphanDSSIterator begin, OrphanDSSIterator end, const Point &p)
Use the DSS filter defined conditions to ensure estimation over not covered points - orphans.
DGtal::DSSMuteFilter< typename DSSSegmentationComputer::SegmentComputer >
DGtal::LambdaMST3DEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CLMSTDSSFilter< DSSFilter >))
DGtal::LambdaMST3DEstimator::isValid
bool isValid() const
DGtal::LambdaMST3DEstimator::treatOrphans
void treatOrphans(DSSesIterator begin, DSSesIterator end, OrphanIterator obegin, OrphanIterator oend, std::multimap< Point, Value > &outValues)
DGtal::concepts::CLMSTTangentFromDSS
Aim: Defines the concept describing a functor which calculates a direction of the 2D DSS and an eccen...
Definition: CLMSTTangentFromDSS.h:94
DGtal::LambdaMST3DEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CForwardSegmentComputer< typename TSegmentation::SegmentComputer >))
DGtal::concepts::CForwardSegmentComputer
Aim: Defines the concept describing a forward segment computer. Like any model of CIncrementalSegment...
Definition: CForwardSegmentComputer.h:102
DGtal::Alias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: Alias.h:183
DGtal::InHalfPlaneBySimple3x3Matrix< Point, double >::Value
Integer Value
Definition: InHalfPlaneBySimple3x3Matrix.h:131
DGtal::LambdaMST3DEstimator::myBegin
ConstIterator myBegin
Definition: LambdaMST3D.h:178
DGtal::LambdaMST3DEstimator
Definition: LambdaMST3D.h:63
Point
MyPointD Point
Definition: testClone2.cpp:383
DGtal::LambdaMST3DEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
DGtal::LambdaMST3DEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CLMSTTangentFromDSS< Functor >))
DGtal::LambdaMST3D::LambdaMST3D
LambdaMST3D()
Definition: LambdaMST3D.h:221
DGtal::LambdaMST3DEstimator::eval
OutputIterator eval(ConstIterator itb, ConstIterator ite, OutputIterator result)
DGtal::TangentFromDSS3DFunctor
Definition: FunctorsLambdaMST.h:174
DGtal::LambdaMST3DEstimator::myFunctor
Functor myFunctor
Definition: LambdaMST3D.h:192