DGtal  1.5.beta
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)
35 #define FrontierPredicate_RECURSES
36 
37 #if !defined FrontierPredicate_h
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
82  typename Image::Point>::value ));
83 
84 
85  // ----------------------- Standard services ------------------------------
86  public:
87 
92 
103  const Value & l1, const Value & l2 );
104 
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 
149  // the image of interest
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)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:187
Aim: The predicate on surfels that represents the frontier between two regions in an image....
void selfDisplay(std::ostream &out) const
FrontierPredicate(const FrontierPredicate &other)
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< typename KSpace::Point, typename Image::Point >::value))
bool operator()(const Surfel &s) const
FrontierPredicate & operator=(const FrontierPredicate &other)
BOOST_CONCEPT_ASSERT((concepts::CConstImage< TImage >))
const KSpace * myPtrSpace
the cellular space where lies the image.
Value myLabel1
the label of the inner region that defines the frontier.
FrontierPredicate(ConstAlias< KSpace > aSpace, ConstAlias< Image > anImage, const Value &l1, const Value &l2)
Value myLabel2
the label of the outer region that defines the frontier.
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean 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:95