37#include "DGtal/base/Common.h"
38#include "DGtal/helpers/StdDefs.h"
40#include "DGtal/images/ImageContainerBySTLVector.h"
42#include "DGtal/io/readers/VolReader.h"
43#include "DGtal/io/writers/VolWriter.h"
45#include "DGtal/images/SimpleThresholdForegroundPredicate.h"
46#include "DGtal/geometry/volumes/distance/DistanceTransformation.h"
47#include "DGtal/shapes/implicit/ImplicitBall.h"
48#include "DGtal/base/BasicFunctors.h"
50#include "DGtal/io/viewers/PolyscopeViewer.h"
51#include "DGtal/io/colormaps/GradientColorMap.h"
53#include <boost/algorithm/minmax_element.hpp>
72 trace.
info() <<
"viewer launched..."<<std::endl;
79 Predicate binaryshape(
image, 0);
87 trace.
info() <<
"we display the dt map"<<std::endl;
91 for(DT::Domain::ConstIterator it = distancemap.domain().begin(),
92 itend = distancemap.domain().end(); it != itend;
94 if (distancemap(*it) > 0)
99 trace.
info() <<
"Got "<<cpt<<
" points."<<std::endl;
100 trace.
info() <<
"viewer2 launched..."<<std::endl;
110 trace.
info() <<
"Computing the granulometry"<<std::endl;
113 itend = imageGranulo.
domain().end(); it != itend; ++it)
115 if (distancemap(*it) > 0)
119 unsigned int radius = (
unsigned int)distancemap(*it);
126 itball != itendball; itball++)
127 if (imageGranulo.
domain().isInside(*itball) &&
128 ( ball(*itball) > 0) &&
129 (imageGranulo(*itball) < radius))
130 imageGranulo.
setValue(*itball, radius);
136 trace.
info() <<
"Granulometry ok nbBalls="<<cpt<< std::endl;
147 itend = imageGranulo.
domain().end(); it != itend;
149 if (imageGranulo(*it) > 0)
154 trace.
info() <<
"Got "<<cpt<<
" points."<<std::endl;
155 trace.
info() <<
"viewer3 launched..."<<std::endl;
Aim: implements separable l_p metrics with exact predicates.
Iterator for HyperRectDomain.
const ConstIterator & begin() const
const ConstIterator & end() const
std::vector< Value >::const_iterator ConstIterator
std::vector< Value >::iterator Iterator
Aim: implements association bewteen points lying in a digital domain and values.
const Domain & domain() const
void setValue(const Point &aPoint, const Value &aValue)
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD....
RealPoint getUpperBound() const
RealPoint getLowerBound() const
Aim: Implements basic operations that will be used in Point and Vector classes.
static Self diagonal(Component val=1)
void show() override
Starts the event loop and display of elements.
Aim: Define a simple Foreground predicate thresholding image values given a single thresold....
DGtal is the top-level namespace which contains all DGtal functions and types.
static ImageContainer importVol(const std::string &filename, const Functor &aFunctor=Functor())
Aim: Export a 3D Image using the Vol formats.
Attach a property to an element.
Functor that rounds down.