DGtal  0.9.2
display3DToOFF.cpp
1 #include <iostream>
3 #include "DGtal/base/Common.h"
4 #include "DGtal/io/readers/VolReader.h"
5 #include "DGtal/io/Display3D.h"
6 
7 #include "DGtal/io/DrawWithDisplay3DModifier.h"
8 #include "DGtal/images/ImageSelector.h"
9 #include "DGtal/images/imagesSetsUtils/SetFromImage.h"
10 #include "DGtal/helpers/StdDefs.h"
11 #include "ConfigExamples.h"
12 
13 
14 using namespace std;
15 using namespace DGtal;
16 using namespace Z3i;
17 
18 
19 int main( int /*argc*/, char** /*argv*/ )
20 {
21  std::string inputFilename = examplesPath + "samples/Al.100.vol";
25  Image image = VolReader<Image>::importVol(inputFilename);
26  Z3i::DigitalSet set3d (image.domain());
27  SetFromImage<Z3i::DigitalSet>::append<Image>(set3d, image, 0,255);
28 
29  viewer << set3d ;
30  viewer >> "exportMeshToOFF.off";
32 
33  return 0;
34 }
Aim: implements association bewteen points lying in a digital domain and values.
Definition: Image.h:69
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
Aim: This semi abstract class defines the stream mechanism to display 3d primitive (like BallVector...
Definition: Common.h:134