70{
72 std::string inputFilename = examplesPath + "samples/circleR10modif.pgm";
74
78 board << image.domain() << set2d;
79
81 board2 << image.domain() << set2d;
82
84 board3 << image.domain() << set2d;
85
86
87
89 bool space_ok = ks.
init( image.domain().lowerBound(), image.domain().upperBound(),
true );
90
91
92
93
95
96
97 std::vector<Z2i::SCell> vectBdrySCell;
100 ks, SAdj, set2d, aCell );
101
102 board <<
CustomStyle( (*(vectBdrySCell.begin())).className(),
104 Color( 192, 192, 0 ) ));
105
107 cmap_grad.addColor(
Color( 50, 50, 255 ) );
108 cmap_grad.addColor(
Color( 255, 0, 0 ) );
109 cmap_grad.addColor(
Color( 255, 255, 10 ) );
110
111 unsigned int d=0;
112 std::vector<Z2i::SCell>::iterator it;
113 for ( it=vectBdrySCell.begin() ; it != vectBdrySCell.end(); it++ ){
116 cmap_grad( d )))<< *it;
117 d++;
118 }
119
120
121
122 std::set<Z2i::SCell> bdry;
123
124
126 ( bdry,
128
129
130 std::set<Z2i::SCell>::iterator itB;
131 for ( itB=bdry.begin() ; itB != bdry.end(); itB++ ){
134 cmap_grad( d )))<< *itB;
135 d++;
136 }
137
138 std::vector< std::vector<Z2i::SCell> > vectContoursBdrySCell;
140 ks, SAdj, set2d );
142 cmap_grad3.addColor(
Color( 50, 50, 255 ) );
143 cmap_grad3.addColor(
Color( 255, 0, 0 ) );
144 cmap_grad3.addColor(
Color( 20, 200, 0 ) );
145 cmap_grad3.addColor(
Color( 200, 200, 200 ) );
146 cmap_grad3.addColor(
Color( 20, 200, 200 ) );
147 cmap_grad3.addColor(
Color( 200, 20, 200 ) );
148
149 d=0;
150 for(unsigned int i=0; i< vectContoursBdrySCell.size(); i++){
151 d++;
152 for(unsigned int j=0; j< vectContoursBdrySCell.at(i).size(); j++){
153 board3<<
CustomStyle(vectContoursBdrySCell.at(i).at(j).className() ,
155 cmap_grad3( d )))<<vectContoursBdrySCell.at(i).at(j) ;
156
157 }
158 }
159
160
161
162
163 board << aCell;
166
167 board2.
saveEPS(
"ctopo-2d.eps");
168 board2.
saveFIG(
"ctopo-2d.fig");
169
170 board3.
saveEPS(
"ctopo-2e.eps");
171 board3.
saveFIG(
"ctopo-2e.fig");
172
173 return (space_ok);
174}
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Structure representing an RGB triple with alpha component.
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Aim: implements association bewteen points lying in a digital domain and values.
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
const Point & lowerBound() const
Return the lower bound for digital points in this space.
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
const Point & upperBound() const
Return the upper bound for digital points in this space.
static void extractAll2DSCellContours(std::vector< std::vector< SCell > > &aVectSCellContour2D, const KSpace &aKSpace, const SurfelAdjacency< KSpace::dimension > &aSurfelAdj, const PointPredicate &pp)
static SCell findABel(const KSpace &K, const PointPredicate &pp, unsigned int nbtries=1000)
static void track2DBoundary(std::vector< SCell > &aSCellContour2D, const KSpace &K, const SurfelAdjacency< KSpace::dimension > &surfel_adj, const PointPredicate &pp, const SCell &start_surfel)
static void sMakeBoundary(SCellSet &aBoundary, const KSpace &aKSpace, const PointPredicate &pp, const Point &aLowerBound, const Point &aUpperBound)
Aim: Represent adjacencies between surfel elements, telling if it follows an interior to exterior ord...
void saveFIG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0, bool includeFIGHeader=true) const
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...
ImageContainerBySTLVector< Domain, Value > Type
static ImageContainer importPGM(const std::string &aFilename, const Functor &aFunctor=Functor(), bool topbotomOrder=true)
static void append(Set &aSet, const ForegroundPredicate &isForeground, typename Image::Domain::ConstIterator itBegin, typename Image::Domain::ConstIterator itEnd)
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
ImageContainerBySTLVector< Domain, Value > Image