37 #include "DGtal/base/Common.h"
39 #include "DGtal/images/imagesSetsUtils/ImageFromSet.h"
40 #include "DGtal/images/imagesSetsUtils/SetFromImage.h"
42 #include "DGtal/kernel/sets/DigitalSetInserter.h"
43 #include "DGtal/images/ImageHelper.h"
45 #include "DGtal/images/ImageContainerBySTLMap.h"
46 #include "DGtal/images/ImageContainerBySTLVector.h"
47 #include "DGtal/images/ImageSelector.h"
49 #include "DGtal/helpers/StdDefs.h"
51 #include "ConfigTest.h"
56 using namespace DGtal;
67 typedef typename P::Coordinate
Value;
84 unsigned int nbok = 0;
101 nbok += ( (
image(c) == 128)&&(
image(a) == 0) ) ? 1 : 0;
103 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
109 nbok += ( (image2(c) == (int)c.norm1())
110 &&(image2(a) == (int)a.norm1())
111 &&(image2(b) == (int)b.norm1()) )? 1 : 0;
113 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
123 bool flag2 = std::equal(rimg.
begin(), rimg.
end(), rimg2.
begin());
124 bool flag3 = std::equal(rimg.
begin(), rimg.
end(), rimg3.
begin());
125 bool flag23 = std::equal(rimg2.
begin(), rimg2.
end(), rimg3.
begin());
126 nbok += ( (!flag2) && (!flag3) && flag23 )?1:0;
128 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
137 unsigned int nbok = 0;
153 image.setValue(p,127);
154 image.setValue(q,128);
155 image.setValue(r,10);
159 std::copy(range.begin(), range.end(), ostream_iterator<Image::Value>(cout,
" ") );
169 nbok += ( (aSet.
find(p) == aSet.
end())
171 &&(aSet.
size()==(d.
size()-2)) ) ? 1 : 0;
173 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
180 nbok += ( (aSet2.
find(q) == aSet2.
end())
181 &&(aSet2.
size()==(d.
size()-1)) ) ? 1 : 0;
183 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
190 nbok += ( aSet3.
size()==d.
size() ) ? 1 : 0;
192 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
199 nbok += ( (aSet4.
find(r)!=aSet4.
end())&&(aSet4.
size()==1) ) ? 1 : 0;
201 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
206 using ValuePredicate = std::function<bool(
const Image::Value &)>;
215 nbok += ( (aSet5.
find(p) == aSet5.
end())
216 &&(aSet5.
find(q) == aSet5.
end())
217 &&(aSet5.
find(r) == aSet5.
end())
218 &&(aSet5.
size()==(d.
size()-3)) ) ? 1 : 0;
220 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
229 int main(
int argc,
char** argv )
233 for (
int i = 0; i < argc; ++i )
238 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
ConstIterator end() const
void insert(const Point &p)
ConstIterator find(const Point &p) const
Aim: this output iterator class is designed to allow algorithms to insert points in the digital set....
const ConstIterator & end() const
const ConstIterator & begin() const
Aim: implements association bewteen points lying in a digital domain and values.
ConstRange constRange() const
Aim: model of CConstBidirectionalRangeFromPoint that adapts any range of elements bounded by two iter...
ConstIterator begin() const
ConstIterator end() const
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
void setFromImage(const I &aImg, const O &ito, const typename I::Value &aThreshold=0)
void imageFromFunctor(I &aImg, const F &aFun)
void imageFromImage(I1 &aImg1, const I2 &aImg2)
void imageFromRangeAndValue(const It &itb, const It &ite, Im &aImg, const typename Im::Value &aValue=0)
void setFromPointsRangeAndPredicate(const I &itb, const I &ite, const O &ito, const P &aPred)
useful functions
Aim: The predicate returns true when the predicate returns true for the value assigned to a given poi...
int main(int argc, char **argv)
ImageContainerBySTLVector< Domain, Value > Image