DGtal  0.9.2
digitalSetFromVol.cpp
1 
30 #include <iostream>
32 
33 #include "DGtal/base/Common.h"
34 #include "DGtal/io/readers/VolReader.h"
35 #include "DGtal/io/Display3D.h"
36 #include "DGtal/io/viewers/Viewer3D.h"
37 #include "DGtal/io/DrawWithDisplay3DModifier.h"
38 
39 #include "DGtal/images/ImageSelector.h"
40 #include "DGtal/images/imagesSetsUtils/SetFromImage.h"
41 #include "DGtal/helpers/StdDefs.h"
42 #include "ConfigExamples.h"
43 
45 
46 using namespace std;
47 using namespace DGtal;
48 
50 
51 int main( int argc, char** argv )
52 {
53  std::string inputFilename = examplesPath + "samples/Al.100.vol";
54  QApplication application(argc,argv);
55  Viewer3D<> viewer;
56  viewer.show();
58  Image image = VolReader<Image>::importVol(inputFilename);
59  Z3i::DigitalSet set3d (image.domain());
60  SetFromImage<Z3i::DigitalSet>::append<Image>(set3d, image, 0,255);
61  viewer << SetMode3D(image.domain().className(), "BoundingBox");
62  viewer << set3d << image.domain() << Viewer3D<>::updateDisplay;
63  return application.exec();
64 }
Aim: implements association bewteen points lying in a digital domain and values.
Definition: Image.h:69
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
STL namespace.
Aim: implements methods to read a "Vol" file format.
Definition: VolReader.h:88
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: Define utilities to convert a digital set into an image.
Definition: SetFromImage.h:63
const Domain & domain() const
Definition: Image.h:192
Modifier class in a Display3D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithDisplay3D.