18 #include <QtGui/qapplication.h>
19 #include "DGtal/kernel/sets/SetPredicate.h"
20 #include "DGtal/io/readers/VolReader.h"
21 #include "DGtal/io/viewers/Viewer3D.h"
22 #include "DGtal/io/DrawWithDisplay3DModifier.h"
23 #include "DGtal/io/Color.h"
24 #include "DGtal/images/ImageSelector.h"
25 #include "DGtal/images/imagesSetsUtils/SetFromImage.h"
26 #include "DGtal/shapes/Shapes.h"
27 #include "DGtal/helpers/StdDefs.h"
28 #include "DGtal/topology/helpers/Surfaces.h"
34 using namespace DGtal;
39 void usage(
int,
char** argv )
41 std::cerr <<
"Usage: " << argv[ 0 ] <<
" <fileName.vol> <minT> <maxT>" << std::endl;
42 std::cerr <<
"\t - displays the boundary of the shape stored in vol file <fileName.vol>." << std::endl;
43 std::cerr <<
"\t - voxel v belongs to the shape iff its value I(v) follows minT <= I(v) <= maxT." << std::endl;
46 int main(
int argc,
char** argv )
53 std::string inputFilename = argv[ 1 ];
54 unsigned int minThreshold = atoi( argv[ 2 ] );
55 unsigned int maxThreshold = atoi( argv[ 3 ] );
64 minThreshold, maxThreshold);
70 trace.
beginBlock(
"Construct the Khalimsky space from the image domain." );
72 bool space_ok = ks.
init( image.domain().lowerBound(),
73 image.domain().upperBound(), true );
76 trace.
error() <<
"Error in the Khamisky space construction."<<std::endl;
86 image.domain().lowerBound(),
87 image.domain().upperBound() );
93 QApplication application(argc,argv);
97 unsigned long nbSurfels = 0;
98 for ( KSpace::SCellSet::const_iterator it = boundary.begin(),
99 it_end = boundary.end(); it != it_end; ++it, ++nbSurfels )
101 viewer << Viewer3D::updateDisplay;
102 trace.
info() <<
"nb surfels = " << nbSurfels << std::endl;
104 return application.exec();