32#include <boost/graph/graph_concepts.hpp>
33#include "DGtal/base/Common.h"
34#include "ConfigTest.h"
35#include "DGtal/helpers/StdDefs.h"
36#include <DGtal/images/ImageSelector.h>
37#include <DGtal/images/ImageContainerBySTLVector.h>
38#include "DGtal/images/ConstImageAdapter.h"
39#include "DGtal/images/RigidTransformation3D.h"
40#include "DGtal/io/readers/PGMReader.h"
41#include "DGtal/io/readers/VolReader.h"
42#include "DGtal/io/writers/GenericWriter.h"
49using namespace functors;
58class testRigidTransformation3D
61 typedef ForwardRigidTransformation3D < Space > ForwardTrans;
62 typedef BackwardRigidTransformation3D < Space > BackwardTrans;
64 typedef DomainRigidTransformation3D < Domain, ForwardTrans > DomainTrans;
68 ForwardTrans forwardTrans;
69 BackwardTrans backwardTrans;
71 DomainTrans domainForwardTrans;
74 testRigidTransformation3D() :
75 binary (
PGMReader<
Image>::importPGM3D ( testPath +
"samples/cat10.pgm3d" ) ),
76 forwardTrans (
RealPoint ( 5, 5, 5 ),
RealVector ( 1, 0, 1 ), M_PI_4,
RealVector( 3, -3, 3 ) ),
77 backwardTrans(
RealPoint ( 5, 5, 5 ),
RealVector ( 1, 0, 1 ), M_PI_4,
RealVector( 3, -3, 3 ) ),
78 domainForwardTrans(forwardTrans)
81 bool forwardTransformation ()
83 Bounds bounds = domainForwardTrans ( binary.domain() );
84 Domain d ( bounds.first, bounds.second );
85 Image transformed ( d );
88 transformed.setValue ( forwardTrans ( *it ), binary ( *it ) );
90 transformed >>
"binary_after_forward.pgm3d";
93 bool backwardTransformation ()
95 Bounds bounds = domainForwardTrans ( binary.domain() );
96 Domain d ( bounds.first, bounds.second );
97 MyImageBackwardAdapter adapter ( binary, d, backwardTrans, idD );
98 adapter >>
"binary_after_backward.pgm3d";
109 testRigidTransformation3D rigidTest;
111 res &= rigidTest.forwardTransformation();
112 res &= rigidTest.backwardTransformation();
113 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: implements a const image adapter with a given domain (i.e. a subdomain) and 2 functors : g for d...
Iterator for HyperRectDomain.
Aim: implements association bewteen points lying in a digital domain and values.
Aim: Implements basic operations that will be used in Point and Vector classes.
void beginBlock(const std::string &keyword="")
std::pair< typename TDomain::Space::Point, typename TDomain::Space::Point > Bounds
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Import a 2D or 3D using the Netpbm formats (ASCII mode).
Aim: Define a simple default functor that just returns its argument.