DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
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
47
using namespace
std
;
48
using namespace
DGtal
;
49
using namespace
Z3i
;
50
52
// Standard services - public :
53
54
int
main
()
55
{
56
typedef
DGtal::ImageContainerBySTLVector< DGtal::Z2i::Domain, unsigned char>
imageNG;
57
typedef
DGtal::ImageContainerBySTLVector< DGtal::Z2i::Domain, unsigned int>
imageCol;
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
70
imageNG
image
=
DGtal::PGMReader<imageNG>::importPGM
(filename);
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
// //
DGtal::Display3D::draw
std::string draw(const Point &p, const std::string &uname="Point_{i}")
DGtal::Display3D::data
std::map< std::string, DisplayData< RealPoint > > data
Definition
Display3D.h:753
DGtal::ImageContainerBySTLVector
Definition
ImageContainerBySTLVector.h:127
DGtal::PolyscopeViewer
Definition
PolyscopeViewer.h:57
DGtal::PolyscopeViewer::show
void show() override
Starts the event loop and display of elements.
Definition
PolyscopeViewer.h:73
DGtal::Point
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::Trace::endBlock
double endBlock()
DGtal::Z3i
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
std
STL namespace.
DGtal::GenericReader::import
static TContainer import(const std::string &filename, std::vector< unsigned int > dimSpace=std::vector< unsigned int >())
DGtal::PGMReader::importPGM
static ImageContainer importPGM(const std::string &aFilename, const Functor &aFunctor=Functor(), bool topbotomOrder=true)
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
image
Image image(domain)
tests
io
viewers
test3DImageView.cpp
Generated on
for DGtal by
1.18.0