35 #include "DGtal/io/DrawWithDisplay3DModifier.h"
36 #include "DGtal/io/Color.h"
37 #include "DGtal/base/Common.h"
38 #include "DGtal/helpers/StdDefs.h"
39 #include "DGtal/shapes/Shapes.h"
40 #include "DGtal/io/colormaps/HueShadeColorMap.h"
41 #include "DGtal/io/colormaps/GradientColorMap.h"
42 #include "ConfigExamples.h"
43 #include "DGtal/io/viewers/Viewer3D.h"
47 using namespace DGtal;
52 #include "DGtal/io/readers/VolReader.h"
53 #include "DGtal/images/ImageContainerBySTLVector.h"
54 #include "DGtal/images/ImageContainerBySTLMap.h"
55 #include "DGtal/images/ConstImageAdapter.h"
56 #include "DGtal/base/BasicFunctors.h"
57 #include "DGtal/kernel/BasicPointPredicates.h"
60 #include "DGtal/topology/SurfelAdjacency.h"
61 #include "DGtal/topology/helpers/FrontierPredicate.h"
62 #include "DGtal/topology/LightExplicitDigitalSurface.h"
65 #include "DGtal/geometry/volumes/distance/FMM.h"
68 int main(
int argc,
char** argv )
76 double maximalDistance = 3.0;
88 std::string imageFileName = examplesPath +
"samples/Al.100.vol";
99 BinaryImage binaryImage(labelImage, labelImage.domain(), g, thresholder);
106 Domain domain = labelImage.domain();
119 trace.
emphase() <<
"starting bel not found" << std::endl;
125 std::pair<Point,Point> bpair = functor(bel);
126 SurfelPredicate surfelPredicate( ks, binaryImage,
127 binaryImage( bpair.first ),
128 binaryImage( bpair.second ) );
129 Frontier frontier( ks, surfelPredicate,
147 DistanceImage imageDistance( domain, 0.0 );
148 AcceptedPointSet initialPointSet( imageDistance );
149 FMM::initFromBelsRange( ks, frontier.begin(), frontier.end(),
150 imageDistance, initialPointSet, 0.5 );
155 FMM fmm( imageDistance, initialPointSet, domain.
predicate(),
156 domain.
size(), maximalDistance );
165 QApplication application(argc,argv);
171 colorMap.addColor(
Color( 255, 0, 0 ) );
172 colorMap.addColor(
Color( 0, 250, 0 ) );
173 for (DistanceImage::const_iterator it = imageDistance.begin(), itEnd = imageDistance.end();
177 viewer <<
CustomColors3D( colorMap(it->second), colorMap(it->second) ) ;
180 Point p = Point::diagonal(1);
182 double a = -extent[0]/2, b = extent[1]/2;
183 double c = 0, mu = (a+b);
185 << a <<
", " << b <<
", " << c <<
", " << mu <<
")"
190 viewer << Viewer3D<>::updateDisplay;
191 return application.exec();
void beginBlock(const std::string &keyword="")
Aim: An adapter for viewing an associative image container like ImageContainerBySTLMap as a simple di...
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Aim: The predicate on surfels that represents the frontier between two regions in an image...
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
Aim: A utility class for constructing surfaces (i.e. set of (n-1)-cells).
const Predicate & predicate() const
Aim: Define a simple default functor that just returns its argument.
Aim: Fast Marching Method (FMM) for nd distance transforms.
Aim: A small functor with an operator () that compares one value to a threshold value according to tw...
bool init(const Point &lower, const Point &upper, bool isClosed)
Aim: implements methods to read a "Vol" file format.
const Point & upperBound() const
DGtal is the top-level namespace which contains all DGtal functions and types.
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value...
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...
const Point & lowerBound() const
Class for adding a Clipping plane through the Viewer3D stream. Realizes the concept CDrawableWithView...
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex...
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as connected surfels...
Aim: transforms a signed cell c into a pair of points corresponding to the signed cells of greater di...