34 #include "DGtal/helpers/StdDefs.h"
35 #include "DGtal/io/readers/VolReader.h"
36 #include "DGtal/io/DrawWithDisplay3DModifier.h"
37 #include "DGtal/io/viewers/Viewer3D.h"
38 #include "DGtal/io/Color.h"
39 #include "DGtal/io/colormaps/HueShadeColorMap.h"
40 #include "DGtal/images/ImageSelector.h"
41 #include "DGtal/images/imagesSetsUtils/SetFromImage.h"
42 #include "DGtal/shapes/implicit/ImplicitBall.h"
43 #include "DGtal/shapes/GaussDigitizer.h"
44 #include "DGtal/shapes/Shapes.h"
45 #include "DGtal/topology/DigitalSurface.h"
46 #include "DGtal/topology/ExplicitDigitalSurface.h"
47 #include "DGtal/topology/helpers/FrontierPredicate.h"
48 #include "DGtal/topology/helpers/BoundaryPredicate.h"
54 using namespace DGtal;
59 int main(
int argc,
char** argv )
68 EuclideanShape ball1( c1, radius1 );
75 EuclideanShape ball2( c2, radius2 );
82 std::cerr << std::endl;
87 label += shape2( *it ) ? 2 : 0;
88 image.setValue( *it, label );
89 std::cerr << (int)
image( *it );
91 std::cerr << std::endl;
95 trace.
beginBlock(
"Construct the Khalimsky space from the image domain." );
100 trace.
error() <<
"Error in the Khamisky space construction."<<std::endl;
109 MySurfelAdjacency surfAdj(
true );
119 FSurfelPredicate surfPredicate10(
K, image, 1, 0 );
120 Frontier frontier10 =
121 new FrontierContainer(
K, surfPredicate10, surfAdj, bel10 );
125 FSurfelPredicate surfPredicate20(
K, image, 2, 0 );
126 Frontier frontier20 =
127 new FrontierContainer(
K, surfPredicate20, surfAdj, bel20 );
131 BSurfelPredicate surfPredicate3(
K, image, 3 );
133 new BoundaryContainer(
K, surfPredicate3, surfAdj, bel32 );
139 QApplication application(argc,argv);
146 unsigned int nbSurfels10 = 0;
149 it = frontier10.begin(), it_end = frontier10.end();
150 it != it_end; ++it, ++nbSurfels10 )
153 unsigned int nbSurfels20 = 0;
156 it = frontier20.begin(), it_end = frontier20.end();
157 it != it_end; ++it, ++nbSurfels20 )
160 unsigned int nbSurfels3 = 0;
163 it = boundary3.begin(), it_end = boundary3.end();
164 it != it_end; ++it, ++nbSurfels3 )
166 trace.
info() <<
"nbSurfels10 = " << nbSurfels10
167 <<
", nbSurfels20 = " << nbSurfels20
168 <<
", nbSurfels3 = " << nbSurfels3 << std::endl;
169 viewer << Viewer3D<>::updateDisplay;
171 return application.exec();
Structure representing an RGB triple with alpha component.
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as connected surfels....
Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
void attach(ConstAlias< EuclideanShape > shape)
void init(const RealPoint &xLow, const RealPoint &xUp, typename RealVector::Component gridStep)
Iterator for HyperRectDomain.
const ConstIterator & end() const
const ConstIterator & begin() const
const Point & lowerBound() const
const Point & upperBound() const
std::string className() const
Aim: implements association bewteen points lying in a digital domain and values.
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD....
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.
static constexpr const Sign POS
SCell sSpel(Point p, Sign sign=POS) const
From the digital coordinates of a point in Zn, builds the corresponding spel (cell of maximal dimensi...
SCell sIncident(const SCell &c, Dimension k, bool up) const
Return the forward or backward signed cell incident to [c] along axis [k], depending on [up].
Aim: Implements basic operations that will be used in Point and Vector classes.
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 a region and its complementary in ...
Aim: The predicate on surfels that represents the frontier between two regions in an image....
int main(int argc, char **argv)
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
boost::uint8_t uint8_t
unsigned 8-bit integer.
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
ImageContainerBySTLVector< Domain, Value > Image
PointVector< 3, double > RealPoint