47 #include "DGtal/io/DrawWithDisplay3DModifier.h"
48 #include "DGtal/io/Color.h"
49 #include "DGtal/base/Common.h"
50 #include "DGtal/helpers/StdDefs.h"
51 #include "DGtal/shapes/Shapes.h"
52 #include "DGtal/io/colormaps/HueShadeColorMap.h"
53 #include "DGtal/io/colormaps/GradientColorMap.h"
54 #include "ConfigExamples.h"
55 #include "DGtal/io/viewers/Viewer3D.h"
59 using namespace DGtal;
64 #include "DGtal/io/readers/VolReader.h"
65 #include "DGtal/images/ImageContainerBySTLVector.h"
66 #include "DGtal/images/ImageContainerBySTLMap.h"
67 #include "DGtal/images/ConstImageAdapter.h"
68 #include "DGtal/base/BasicFunctors.h"
69 #include "DGtal/kernel/BasicPointPredicates.h"
72 #include "DGtal/topology/SurfelAdjacency.h"
73 #include "DGtal/topology/helpers/FrontierPredicate.h"
74 #include "DGtal/topology/LightExplicitDigitalSurface.h"
77 #include "DGtal/geometry/volumes/distance/FMM.h"
80 int main(
int argc,
char** argv )
88 double maximalDistance = 3.0;
100 std::string imageFileName = examplesPath +
"samples/Al.100.vol";
111 BinaryImage binaryImage(labelImage, labelImage.domain(), g, thresholder);
131 trace.
emphase() <<
"starting bel not found" << std::endl;
137 std::pair<Point,Point> bpair = functor(bel);
138 SurfelPredicate surfelPredicate( ks, binaryImage,
139 binaryImage( bpair.first ),
140 binaryImage( bpair.second ) );
141 Frontier frontier( ks, surfelPredicate,
159 DistanceImage imageDistance(
domain, 0.0 );
160 AcceptedPointSet initialPointSet( imageDistance );
161 FMM::initFromBelsRange( ks, frontier.begin(), frontier.end(),
162 imageDistance, initialPointSet, 0.5 );
177 QApplication application(argc,argv);
185 for (DistanceImage::const_iterator it = imageDistance.begin(), itEnd = imageDistance.end();
189 viewer <<
CustomColors3D( colorMap(it->second), colorMap(it->second) ) ;
192 Point p = Point::diagonal(1);
194 double a = -extent[0]/2, b = extent[1]/2;
195 double c = 0, mu = (a+b);
197 << a <<
", " << b <<
", " << c <<
", " << mu <<
")"
202 viewer << Viewer3D<>::updateDisplay;
203 return application.exec();
Structure representing an RGB triple with alpha component.
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.
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
void addColor(const Color &color)
const Point & lowerBound() const
const Predicate & predicate() const
const Point & upperBound() const
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as connected surfels....
Aim: A utility class for constructing surfaces (i.e. set of (n-1)-cells).
void beginBlock(const std::string &keyword="")
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
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...
int main(int argc, char **argv)
DGtal is the top-level namespace which contains all DGtal functions and types.
Class for adding a Clipping plane through the Viewer3D stream. Realizes the concept CDrawableWithView...
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Aim: implements methods to read a "Vol" file format.
Aim: Define a simple default functor that just returns its argument.