48 #include "DGtal/base/Common.h"
51 #include "DGtal/kernel/SpaceND.h"
52 #include "DGtal/kernel/domains/HyperRectDomain.h"
53 #include "DGtal/kernel/sets/DigitalSetFromMap.h"
54 #include "DGtal/images/ImageContainerBySTLMap.h"
55 #include "DGtal/topology/SCellsFunctors.h"
58 #include "DGtal/shapes/ShapeFactory.h"
59 #include "DGtal/shapes/Shapes.h"
60 #include "DGtal/helpers/StdDefs.h"
61 #include "DGtal/topology/helpers/Surfaces.h"
62 #include "DGtal/shapes/GaussDigitizer.h"
67 #include "DGtal/geometry/volumes/distance/FMM.h"
71 #include "DGtal/io/colormaps/HueShadeColorMap.h"
72 #include "DGtal/io/boards/Board2D.h"
77 using namespace DGtal;
88 template<
typename TImage >
89 void draw(
const TImage aImg,
const double& aMaxValue, std::string aBasename)
98 for (ConstIteratorOnPoints it = aImg.domain().begin(), itEnd = aImg.domain().end();
108 s << aBasename <<
".eps";
109 b.saveEPS(s.str().c_str());
114 s << aBasename <<
".png";
115 b.saveCairo(s.str().c_str(), Board2D::CairoPNG);
141 Z2i::Point::diagonal(size) );
142 DistanceImage distanceImage(
domain );
143 AcceptedPointSet set( distanceImage );
148 set.insert( origin );
149 distanceImage.setValue( origin, 0.0 );
156 trace.
info() <<
"Init: " << fmm << std::endl;
162 trace.
info() <<
"End: " << fmm << std::endl;
167 s <<
"DTbyFMM-" << size;
168 draw(distanceImage, fmm.
max(), s.str());
181 int main (
int argc,
char** argv )
185 for (
int i = 0; i < argc; ++i )
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: An adapter for viewing an associative image container like ImageContainerBySTLMap as a simple di...
Aim: Fast Marching Method (FMM) for nd distance transforms.
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
const Predicate & predicate() const
void beginBlock(const std::string &keyword="")
int main(int argc, char **argv)
void draw(const TImage aImg, const double &aMaxValue, std::string aBasename)
void example()
We use FMM to compute a distance field from a given point.
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
Custom style class redefining the fill color. You may use Board2D::Color::None for transparent color.