40 #include "DGtal/helpers/StdDefs.h"
41 #include "DGtal/io/readers/VolReader.h"
42 #include "DGtal/io/DrawWithDisplay3DModifier.h"
43 #include "DGtal/io/Color.h"
44 #include "DGtal/images/ImageSelector.h"
45 #include "DGtal/images/imagesSetsUtils/SetFromImage.h"
46 #include "DGtal/shapes/Shapes.h"
47 #include "DGtal/topology/helpers/Surfaces.h"
48 #include "DGtal/io/viewers/Viewer3D.h"
54 using namespace DGtal;
61 std::cerr <<
"Usage: " << argv[ 0 ] <<
" <fileName.vol> <minT> <maxT>" << std::endl;
62 std::cerr <<
"\t - displays the boundary of the shape stored in vol file <fileName.vol>." << std::endl;
63 std::cerr <<
"\t - voxel v belongs to the shape iff its value I(v) follows minT <= I(v) <= maxT." << std::endl;
66 int main(
int argc,
char** argv )
73 std::string inputFilename = argv[ 1 ];
74 unsigned int minThreshold = atoi( argv[ 2 ] );
75 unsigned int maxThreshold = atoi( argv[ 3 ] );
83 minThreshold, maxThreshold);
89 trace.
beginBlock(
"Construct the Khalimsky space from the image domain." );
91 bool space_ok = ks.
init( image.domain().lowerBound(),
92 image.domain().upperBound(),
true );
95 trace.
error() <<
"Error in the Khamisky space construction."<<std::endl;
105 image.
domain().lowerBound(),
106 image.domain().upperBound() );
112 QApplication application(argc,argv);
118 unsigned long nbSurfels = 0;
119 for ( KSpace::SCellSet::const_iterator it = boundary.begin(),
120 it_end = boundary.end(); it != it_end; ++it, ++nbSurfels )
122 viewer << Viewer3D<>::updateDisplay;
123 trace.
info() <<
"nb surfels = " << nbSurfels << std::endl;
125 return application.exec();
Structure representing an RGB triple with alpha component.
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
const Domain & domain() const
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.
std::set< SCell > SCellSet
Preferred type for defining a set of SCell(s).
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...
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Define utilities to convert a digital set into an image.
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.
std::string className() const
Return the style name used for drawing this object.
Aim: implements methods to read a "Vol" file format.
ImageContainerBySTLVector< Domain, Value > Image
void usage(int, char **argv)
int main(int argc, char **argv)