DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor > Class Template Reference

Aim: implements forward rigid transformation of point in 3D integer space around any arbitrary axis. This implementation uses the Rodrigues' rotation formula. Warring: This version uses closest neighbor interpolation. More...

#include <DGtal/images/RigidTransformation3D.h>

Inheritance diagram for DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >:
[legend]

Public Types

typedef TSpace::RealPoint RealPoint
 
typedef TSpace::RealVector RealVector
 

Public Member Functions

 ForwardRigidTransformation3D (const RealPoint &aOrigin, const RealVector &aAxis, const double &angle, const RealVector &aTranslate)
 
TOutputValue operator() (const TInputValue &aInput) const
 

Protected Attributes

RealVector axis
 
RealPoint origin
 
double t_sin
 
double t_cos
 
RealVector trans
 
TFunctor functor
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CSpace< TSpace >))
 Checking concepts.
 
 BOOST_STATIC_ASSERT ((TSpace::dimension==3))
 
 BOOST_STATIC_ASSERT ((TOutputValue::dimension==3))
 
 BOOST_STATIC_ASSERT ((TInputValue::dimension==3))
 

Detailed Description

template<typename TSpace, typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
class DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >

Aim: implements forward rigid transformation of point in 3D integer space around any arbitrary axis. This implementation uses the Rodrigues' rotation formula. Warring: This version uses closest neighbor interpolation.

Description of template functor like class 'ForwardRigidTransformation3D'

Template Parameters
TSpacea 3 dimensional space.
TInputValuetype of the input point e.g., TSpace::RealPoint
TOutputValuetype of the output point e.g., TSpace::Point
TFunctora functor operating on the output e.g., a rounding function.
See also
exampleRigidtransformation3d.cpp

Definition at line 76 of file RigidTransformation3D.h.

Member Typedef Documentation

◆ RealPoint

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
typedef TSpace::RealPoint DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::RealPoint

Definition at line 86 of file RigidTransformation3D.h.

◆ RealVector

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
typedef TSpace::RealVector DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::RealVector

Definition at line 87 of file RigidTransformation3D.h.

Constructor & Destructor Documentation

◆ ForwardRigidTransformation3D()

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::ForwardRigidTransformation3D ( const RealPoint & aOrigin,
const RealVector & aAxis,
const double & angle,
const RealVector & aTranslate )
inline

Constructor.

Parameters
aOriginthe center of rotation.
aAxisthe axis of rotation.
anglethe angle given in radians.
aTranslatethe 3D dimensional vector which represents translation.

Definition at line 98 of file RigidTransformation3D.h.

100 : axis(aAxis.getNormalized()), origin(aOrigin), trans(aTranslate)
101
102
103 {
104 if ( std::isnan( axis.norm() ) )
105 throw std::runtime_error ( "Axis of rotation can not be set as a vector of length 0!" );
106 t_sin = std::sin ( angle );
107 t_cos = std::cos ( angle );
108 }

References DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::axis, DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::t_cos, and DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::t_sin.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >) )
private

Checking concepts.

◆ BOOST_STATIC_ASSERT() [1/3]

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::BOOST_STATIC_ASSERT ( (TInputValue::dimension==3) )
private

◆ BOOST_STATIC_ASSERT() [2/3]

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::BOOST_STATIC_ASSERT ( (TOutputValue::dimension==3) )
private

◆ BOOST_STATIC_ASSERT() [3/3]

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::BOOST_STATIC_ASSERT ( (TSpace::dimension==3) )
private

◆ operator()()

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
TOutputValue DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::operator() ( const TInputValue & aInput) const
inline

Operator

Returns
the transformed point.

Definition at line 116 of file RigidTransformation3D.h.

117 {
118 RealPoint p;
119
120 p[0] = ( ( ( ( t_cos + ( axis[0] * axis[0] ) * ( 1. - t_cos ) ) * ( aInput[0] - origin[0] ) )
121 + ( ( axis[0] * axis[1] * ( 1. - t_cos ) - axis[2] * t_sin ) * ( aInput[1] - origin[1] ) )
122 + ( ( axis[1] * t_sin + axis[0] * axis[2] * ( 1. - t_cos ) ) * ( aInput[2] - origin[2] ) ) ) + trans[0] ) + origin[0];
123
124 p[1] = ( ( ( ( axis[2] * t_sin + axis[0] * axis[1] * ( 1. - t_cos ) ) * ( aInput[0] - origin[0] ) )
125 + ( ( t_cos + ( axis[1] * axis[1] ) * ( 1. - t_cos ) ) * ( aInput[1] - origin[1] ) )
126 + ( ( -axis[0] * t_sin + axis[1] * axis[2] * ( 1. - t_cos ) ) * ( aInput[2] - origin[2] ) ) ) + trans[1] ) + origin[1];
127
128 p[2] = ( ( ( ( -axis[1] * t_sin + axis[0] * axis[2] * ( 1. - t_cos ) ) * ( aInput[0] - origin[0] ) )
129 + ( ( axis[0] * t_sin + axis[1] * axis[2] * ( 1. - t_cos ) ) * ( aInput[1] - origin[1] ) )
130 + ( ( t_cos + ( axis[2] * axis[2] ) * ( 1. - t_cos ) ) * ( aInput[2] - origin[2] ) ) ) + trans[2] ) + origin[2];
131
132 return functor ( p );
133 }
PointVector< 3, double > RealPoint

References DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::axis, DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::functor, DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::origin, DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::t_cos, DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::t_sin, and DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::trans.

Field Documentation

◆ axis

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
RealVector DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::axis
protected

◆ functor

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
TFunctor DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::functor
protected

◆ origin

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
RealPoint DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::origin
protected

◆ t_cos

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
double DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::t_cos
protected

◆ t_sin

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
double DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::t_sin
protected

◆ trans

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
RealVector DGtal::functors::ForwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::trans
protected

The documentation for this class was generated from the following file: