DGtal  1.3.beta
Public Types | Public Member Functions | Private Member Functions | Private Attributes
DGtal::functors::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor > Class Template Reference

Aim: implements backward 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>

Public Types

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

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Detailed Description

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

Aim: implements backward 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 'BackwardRigidTransformation3D'

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 164 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::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::RealPoint

Definition at line 174 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::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::RealVector

Definition at line 175 of file RigidTransformation3D.h.

Constructor & Destructor Documentation

◆ BackwardRigidTransformation3D()

template<typename TSpace , typename TInputValue = typename TSpace::RealPoint, typename TOutputValue = typename TSpace::Point, typename TFunctor = VectorRounding < TInputValue, TOutputValue >>
DGtal::functors::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::BackwardRigidTransformation3D ( 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 186 of file RigidTransformation3D.h.

188  : axis(aAxis.getNormalized()), origin(aOrigin), trans(aTranslate)
189  {
190  if ( std::isnan( axis.norm() ) )
191  throw std::runtime_error ( "Axis of rotation can not be set as a vector of length 0!" );
192 
193  t_sin = std::sin ( angle );
194  t_cos = std::cos ( angle );
195  }

References DGtal::functors::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::axis, DGtal::functors::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::t_cos, and DGtal::functors::BackwardRigidTransformation3D< 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::BackwardRigidTransformation3D< 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::BackwardRigidTransformation3D< 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::BackwardRigidTransformation3D< 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::BackwardRigidTransformation3D< 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::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::operator() ( const TInputValue &  aInput) const
inline

Operator

Returns
the transformed point.

Definition at line 203 of file RigidTransformation3D.h.

204  {
205  RealPoint p;
206 
207  p[0] = ( ( ( ( t_cos + ( axis[0] * axis[0] ) * ( 1. - t_cos ) ) * ( aInput[0] - trans[0] - origin[0] ) )
208  + ( ( axis[2] * t_sin + axis[0] * axis[1] * ( 1. - t_cos ) ) * ( aInput[1] - trans[1] - origin[1] ) )
209  + ( ( -axis[1] * t_sin + axis[0] * axis[2] * ( 1. - t_cos ) ) * ( aInput[2] - trans[2] - origin[2] ) ) ) ) + origin[0];
210 
211  p[1] = ( ( ( ( axis[0] * axis[1] * ( 1. - t_cos ) - axis[2] * t_sin ) * ( aInput[0] - trans[0] - origin[0] ) )
212  + ( ( t_cos + ( axis[1] * axis[1] ) * ( 1. - t_cos ) ) * ( aInput[1] - trans[1] - origin[1] ) )
213  + ( ( axis[0] * t_sin + axis[1] * axis[2] * ( 1. - t_cos ) ) * ( aInput[2] - trans[2] - origin[2] ) ) ) ) + origin[1];
214 
215  p[2] = ( ( ( ( axis[1] * t_sin + axis[0] * axis[2] * ( 1. - t_cos ) ) * ( aInput[0] - trans[0] - origin[0] ) )
216  + ( ( -axis[0] * t_sin + axis[1] * axis[2] * ( 1. - t_cos ) ) * ( aInput[1] - trans[1] - origin[1] ) )
217  + ( ( t_cos + ( axis[2] * axis[2] ) * ( 1. - t_cos ) ) * ( aInput[2] - trans[2] - origin[2] ) ) ) ) + origin[2];
218  return functor ( p );
219  }

References DGtal::functors::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::axis, DGtal::functors::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::functor, DGtal::functors::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::origin, DGtal::functors::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::t_cos, DGtal::functors::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::t_sin, and DGtal::functors::BackwardRigidTransformation3D< 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::BackwardRigidTransformation3D< TSpace, TInputValue, TOutputValue, TFunctor >::axis
private

◆ functor

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

◆ origin

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

◆ t_cos

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

◆ t_sin

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

◆ trans

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

The documentation for this class was generated from the following file:
DGtal::functors::BackwardRigidTransformation3D::trans
RealVector trans
Definition: RigidTransformation3D.h:227
DGtal::functors::BackwardRigidTransformation3D::axis
RealVector axis
Definition: RigidTransformation3D.h:223
DGtal::functors::BackwardRigidTransformation3D::t_cos
double t_cos
Definition: RigidTransformation3D.h:226
DGtal::PointVector::getNormalized
PointVector< dim, double, std::array< double, dim > > getNormalized() const
DGtal::functors::BackwardRigidTransformation3D::origin
RealPoint origin
Definition: RigidTransformation3D.h:224
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:165
DGtal::functors::BackwardRigidTransformation3D::functor
TFunctor functor
Definition: RigidTransformation3D.h:228
DGtal::functors::BackwardRigidTransformation3D::t_sin
double t_sin
Definition: RigidTransformation3D.h:225