47#include "DGtal/base/Common.h"
48#include "DGtal/helpers/StdDefs.h"
49#include "DGtal/io/colormaps/GrayscaleColorMap.h"
50#include "DGtal/io/colormaps/HueShadeColorMap.h"
51#include "DGtal/io/colormaps/TickedColorMap.h"
52#include "DGtal/io/colormaps/GradientColorMap.h"
53#include "DGtal/io/boards/Board2D.h"
54#include "DGtal/images/ImageSelector.h"
55#include "DGtal/images/SimpleThresholdForegroundPredicate.h"
56#include "DGtal/geometry/volumes/distance/DistanceTransformation.h"
71template<
typename Image>
74 typename Image::Point p, low = image.domain().lowerBound();
79 for (
unsigned int k = 0 ; k < nb; k++)
81 for (
unsigned int dim = 0;
dim < Image::dimension;
dim++)
84 image.setValue(p, value);
101 for (
Image::Iterator it = image.begin(), itend = image.end();it != itend; ++it)
111 Display2DFactory::drawImage<Gray>(board, image, (
unsigned int)0, (
unsigned int)129);
112 board.
saveSVG(
"inputShape.svg");
117 PointPredicate predicate(image,0);
132 for ( DTL2::ConstRange::ConstIterator it = dtL2.constRange().begin(), itend = dtL2.constRange().end();it != itend; ++it)
133 if ( (*it) > maxv2) maxv2 = (*it);
137 for ( DTL1::ConstRange::ConstIterator it = dtL1.constRange().begin(), itend = dtL1.constRange().end();it != itend; ++it)
138 if ( (*it) > maxv1) maxv1 = (*it);
150 Display2DFactory::drawImage<HueTwice>(board, dtL2, 0.0, maxv2 + 1);
151 board.
saveSVG (
"example-DT-L2.svg" );
155 Display2DFactory::drawImage<HueTwice>(board, dtL1, 0.0, maxv1 + 1);
156 board.
saveSVG (
"example-DT-L1.svg" );
166 for ( DTL2::Domain::ConstIterator it = dtL2.domain().begin(), itend = dtL2.domain().end();it != itend; ++it)
171 board.
saveSVG(
"example-DT-L2-ticked.svg");
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: This class template may be used to (linearly) convert scalar values in a given range into gray l...
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
std::vector< Value >::iterator Iterator
Aim: implements association bewteen points lying in a digital domain and values.
Aim: This class adapts any colormap to add "ticks" in the colormap colors.
void addRegularTicks(const unsigned int nbTicks, const Value thickness)
ColorMap * colormap() const
void beginBlock(const std::string &keyword="")
Aim: Define a simple Foreground predicate thresholding image values given a single thresold....
void clear(const DGtal::Color &color=DGtal::Color::None)
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
static const L1Metric l1Metric
static const L2Metric l2Metric
DGtal is the top-level namespace which contains all DGtal functions and types.
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...