47#include "DGtal/io/Color.h"
48#include "DGtal/base/Common.h"
49#include "DGtal/helpers/StdDefs.h"
50#include "DGtal/shapes/Shapes.h"
51#include "DGtal/io/colormaps/HueShadeColorMap.h"
52#include "DGtal/io/colormaps/GradientColorMap.h"
53#include "ConfigExamples.h"
54#include "DGtal/io/viewers/PolyscopeViewer.h"
63#include "DGtal/io/readers/VolReader.h"
64#include "DGtal/images/ImageContainerBySTLVector.h"
65#include "DGtal/images/ImageContainerBySTLMap.h"
66#include "DGtal/images/ConstImageAdapter.h"
67#include "DGtal/base/BasicFunctors.h"
68#include "DGtal/kernel/BasicPointPredicates.h"
71#include "DGtal/topology/SurfelAdjacency.h"
72#include "DGtal/topology/helpers/FrontierPredicate.h"
73#include "DGtal/topology/LightExplicitDigitalSurface.h"
76#include "DGtal/geometry/volumes/distance/FMM.h"
79int main(
int argc,
char** argv )
87 double maximalDistance = 3.0;
99 std::string imageFileName = examplesPath +
"samples/Al.100.vol";
101 trace.emphase() << imageFileName <<std::endl;
110 BinaryImage binaryImage(labelImage, labelImage.domain(), g, thresholder);
111 trace.info() <<
"threshold: "
125 trace.info() <<
"starting bel: "
130 trace.emphase() <<
"starting bel not found" << std::endl;
136 std::pair<Point,Point> bpair = functor(bel);
137 SurfelPredicate surfelPredicate( ks, binaryImage,
138 binaryImage( bpair.first ),
139 binaryImage( bpair.second ) );
140 Frontier frontier( ks, surfelPredicate,
158 DistanceImage imageDistance(
domain, 0.0 );
159 AcceptedPointSet initialPointSet( imageDistance );
161 imageDistance, initialPointSet, 0.5 );
166 FMM fmm( imageDistance, initialPointSet,
domain.predicate(),
167 domain.size(), maximalDistance );
169 trace.info() << fmm << std::endl;
180 for (DistanceImage::const_iterator it = imageDistance.begin(), itEnd = imageDistance.end();
188 double a = -extent[0]/2, b = extent[1]/2;
189 double c = 0, mu = (a+b);
190 trace.info() <<
"clipping plane ("
191 << a <<
", " << b <<
", " << c <<
", " << mu <<
")"
79int main(
int argc,
char** argv ) {
…}
Aim: implements a const image adapter with a given domain (i.e. a subdomain) and 2 functors : g for d...
Aim: An adapter for viewing an associative image container like ImageContainerBySTLMap as a simple di...
Aim: Fast Marching Method (FMM) for nd distance transforms.
static void initFromBelsRange(const KSpace &aK, const TIteratorOnBels &itb, const TIteratorOnBels &ite, Image &aImg, AcceptedPointSet &aSet, const Value &aValue, bool aFlagIsPositive=true)
functors::IsWithinPointPredicate< Point > Predicate
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
SignedKhalimskyCell< dim, Integer > SCell
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as connected surfels....
static Self diagonal(Component val=1)
void show() override
Starts the event loop and display of elements.
static SCell findABel(const KSpace &K, const PointPredicate &pp, unsigned int nbtries=1000)
Aim: Represent adjacencies between surfel elements, telling if it follows an interior to exterior ord...
Aim: The predicate on surfels that represents the frontier between two regions in an image....
Aim: transforms a signed cell c into a pair of points corresponding to the signed cells of greater di...
Aim: A small functor with an operator () that compares one value to a threshold value according to tw...
Z3i this namespace gathers the standard of types for 3D imagery.
KhalimskySpaceND< 3, Integer > KSpace
DGtal is the top-level namespace which contains all DGtal functions and types.
static ImageContainer importVol(const std::string &filename, const Functor &aFunctor=Functor())
Attach a property to an element.
Aim: Define a simple default functor that just returns its argument.