DGtal  0.9.2
FrontierPredicate.h
1 
17 #pragma once
18 
31 #if defined(FrontierPredicate_RECURSES)
32 #error Recursive header files inclusion detected in FrontierPredicate.h
33 #else // defined(FrontierPredicate_RECURSES)
34 
35 #define FrontierPredicate_RECURSES
36 
37 #if !defined FrontierPredicate_h
38 
39 #define FrontierPredicate_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/ConstAlias.h"
46 #include "DGtal/images/CConstImage.h"
47 #include "DGtal/topology/CCellularGridSpaceND.h"
49 
50 // @since 0.8 In DGtal::functors
51 namespace DGtal {
52  namespace functors {
53 
55  // class FrontierPredicate
66  template <typename TKSpace, typename TImage>
68  {
69  // ----------------------- public types ------------------------------
70  public:
73  typedef TKSpace KSpace;
74  typedef TImage Image;
75  typedef typename KSpace::Surfel Surfel;
76  typedef typename KSpace::Point Point;
77  typedef typename KSpace::SCell SCell;
78  typedef typename Image::Value Value;
79  // KSpace::Point same type as Image::Point
81  (( concepts::ConceptUtils::SameType< typename KSpace::Point,
82  typename Image::Point>::value ));
83 
84 
85  // ----------------------- Standard services ------------------------------
86  public:
87 
92 
103  const Value & l1, const Value & l2 );
104 
109  FrontierPredicate ( const FrontierPredicate & other );
110 
117 
127  bool operator()( const Surfel & s ) const;
128 
129  // ----------------------- Interface --------------------------------------
130  public:
131 
136  void selfDisplay ( std::ostream & out ) const;
137 
142  bool isValid() const;
143 
144  // ------------------------- Private Datas --------------------------------
145  private:
146 
148  const KSpace* myPtrSpace;
149  // the image of interest
150  const Image* myPtrImage;
152  Value myLabel1;
154  Value myLabel2;
155 
156  // ------------------------- Hidden services ------------------------------
157  protected:
158  // ------------------------- Internals ------------------------------------
159  private:
160 
161  }; // end of class FrontierPredicate
162 
163  } // namespace functors
164 
171  template <typename TKSpace, typename TImage>
172  std::ostream&
173  operator<< ( std::ostream & out,
175 
176 
177 } // namespace DGtal
178 
179 
181 // Includes inline functions.
182 #include "DGtal/topology/helpers/FrontierPredicate.ih"
183 
184 // //
186 
187 #endif // !defined FrontierPredicate_h
188 
189 #undef FrontierPredicate_RECURSES
190 #endif // else defined(FrontierPredicate_RECURSES)
Value myLabel1
the label of the inner region that defines the frontier.
Aim: The predicate on surfels that represents the frontier between two regions in an image...
const KSpace * myPtrSpace
the cellular space where lies the image.
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Value myLabel2
the label of the outer region that defines the frontier.
FrontierPredicate & operator=(const FrontierPredicate &other)
void selfDisplay(std::ostream &out) const
DGtal is the top-level namespace which contains all DGtal functions and types.
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< typename KSpace::Point, typename Image::Point >::value))
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...
Aim: Defines the concept describing a read-only image, which is a refinement of CPointFunctor.
Definition: CConstImage.h:94
bool operator()(const Surfel &s) const
FrontierPredicate(ConstAlias< KSpace > aSpace, ConstAlias< Image > anImage, const Value &l1, const Value &l2)