32 #include <QImageReader>
34 #include "DGtal/io/readers/VolReader.h"
35 #include "DGtal/io/DrawWithDisplay3DModifier.h"
36 #include "DGtal/io/Color.h"
37 #include "DGtal/io/colormaps/HueShadeColorMap.h"
38 #include "DGtal/images/ImageSelector.h"
39 #include "DGtal/images/imagesSetsUtils/SetFromImage.h"
40 #include "DGtal/shapes/Shapes.h"
41 #include "DGtal/helpers/StdDefs.h"
42 #include "DGtal/topology/DigitalSurface.h"
43 #include "DGtal/topology/LightImplicitDigitalSurface.h"
44 #include "DGtal/io/viewers/Viewer3D.h"
51 using namespace DGtal;
58 std::cerr <<
"Usage: " << argv[ 0 ] <<
" <fileName.vol> <minT> <maxT>" << std::endl;
59 std::cerr <<
"\t - displays the boundary of the shape stored in vol file <fileName.vol>." << std::endl;
60 std::cerr <<
"\t - voxel v belongs to the shape iff its value I(v) follows minT <= I(v) <= maxT." << std::endl;
63 int main(
int argc,
char** argv )
70 std::string inputFilename = argv[ 1 ];
71 unsigned int minThreshold = atoi( argv[ 2 ] );
72 unsigned int maxThreshold = atoi( argv[ 3 ] );
80 minThreshold, maxThreshold);
86 trace.
beginBlock(
"Construct the Khalimsky space from the image domain." );
88 bool space_ok = ks.
init( image.domain().lowerBound(),
89 image.domain().upperBound(),
true );
92 trace.
error() <<
"Error in the Khamisky space construction."<<std::endl;
100 MySurfelAdjacency surfAdj(
true );
116 trace.
beginBlock(
"Extracting boundary by tracking from an initial bel." );
118 typedef MyBreadthFirstVisitor::Node MyNode;
120 MyBreadthFirstVisitor visitor( digSurf, bel );
121 unsigned long nbSurfels = 0;
123 while ( ! visitor.finished() )
125 node = visitor.current();
129 MySize maxDist = node.second;
135 QApplication application(argc,argv);
139 MyBreadthFirstVisitor visitor2( digSurf, bel );
143 while ( ! visitor2.finished() )
145 node = visitor2.current();
146 Color c = hueShade( node.second );
151 viewer << Viewer3D<>::updateDisplay;
152 trace.
info() <<
"nb surfels = " << nbSurfels << std::endl;
154 return application.exec();
Aim: This class is useful to perform a breadth-first exploration of a graph given a starting point or...
Structure representing an RGB triple with alpha component.
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as the boundary of a given...
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Aim: implements association bewteen points lying in a digital domain and values.
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.
Cell unsigns(const SCell &p) const
Creates an unsigned cell from a signed one.
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as the boundary of an impl...
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...
DigitalSurface< MyDigitalSurfaceContainer > MyDigitalSurface
DigitalSetBoundary< KSpace, DigitalSet > MyDigitalSurfaceContainer
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Define utilities to convert a digital set into an image.
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.
HalfEdgeDataStructure::Size Size
ImageContainerBySTLVector< Domain, Value > Image
void usage(int, char **argv)
int main(int argc, char **argv)