Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
test3DImageView.cpp
Go to the documentation of this file.
1
16
29
31#include <iostream>
32#include "DGtal/base/Common.h"
33#include "DGtal/io/viewers/PolyscopeViewer.h"
34#include "DGtal/io/Color.h"
35#include "DGtal/helpers/StdDefs.h"
36#include "DGtal/shapes/Shapes.h"
37#include "DGtal/io/readers/PGMReader.h"
38#include "DGtal/io/readers/GenericReader.h"
39#include "DGtal/io/writers/GenericWriter.h"
40#include "DGtal/math/BasicMathFunctions.h"
41
42#include "ConfigTest.h"
43
44#include <limits>
46
47using namespace std;
48using namespace DGtal;
49using namespace Z3i;
50
52// Standard services - public :
53
54int main( int argc, char** argv )
55{
58
59 PolyscopeViewer<> viewer;
60
61 trace.beginBlock("Testing Viewer with 3D Image View ");
62
63 Point p1( 0, 0, 0 );
64 Point p2( 125, 188, 0 );
65 Point p3( 30, 30, 30 );
66
67 std::string filename = testPath + "samples/church-small.pgm";
68 std::string filename3 = testPath + "samples/color64.ppm";
69
71 imageNG image2 = DGtal::GenericReader<imageNG>::import(filename);
72 imageCol image3 = DGtal::GenericReader<imageCol>::import(filename3);
73
74 viewer.draw(image2, "Image 2");
75 viewer.draw(image, "Image");
76 viewer.draw(image3, "Image 3");
77
78 viewer.data["Image 2"].transform.translate(Eigen::Vector3d{50, 50, 50});
79 viewer.data["Image 3"].transform.rotate(Eigen::AngleAxisd(M_PI/2, Eigen::Vector3d{0, 1, 0}));
80
81 viewer << p1 << p2 << p3;
82
83 trace.emphase() << "Passed." << endl;
84 trace.endBlock();
85 viewer.show();
86 return 0;
87}
88// //
90
std::string draw(const Point &p, const std::string &uname="Point_{i}")
std::map< std::string, DisplayData< RealPoint > > data
Definition Display3D.h:734
void show() override
Starts the event loop and display of elements.
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
Trace trace
STL namespace.
static TContainer import(const std::string &filename, std::vector< unsigned int > dimSpace=std::vector< unsigned int >())
static ImageContainer importPGM(const std::string &aFilename, const Functor &aFunctor=Functor(), bool topbotomOrder=true)
int main()
Definition testBits.cpp:56
Image image(domain)