DGtal  0.9.3beta
Public Types | Public Member Functions | Private Member Functions | Private Attributes
DGtal::functors::BackwardRigidTransformation3D< TSpace > Class Template Reference

#include <DGtal/images/RigidTransformation3D.h>

Inheritance diagram for DGtal::functors::BackwardRigidTransformation3D< TSpace >:
[legend]
Collaboration diagram for DGtal::functors::BackwardRigidTransformation3D< TSpace >:
[legend]

Public Types

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

Public Member Functions

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

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CSpace< TSpace >))
 
 BOOST_STATIC_ASSERT ((TSpace::dimension==3))
 

Private Attributes

RealVector axis
 
RealPoint origin
 
double t_sin
 
double t_cos
 
RealVector trans
 

Detailed Description

template<typename TSpace>
class DGtal::functors::BackwardRigidTransformation3D< TSpace >

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.
See also
exampleRigidtransformation3d.cpp

Definition at line 151 of file RigidTransformation3D.h.

Member Typedef Documentation

template<typename TSpace >
typedef TSpace::Point DGtal::functors::BackwardRigidTransformation3D< TSpace >::Point

Definition at line 159 of file RigidTransformation3D.h.

template<typename TSpace >
typedef TSpace::RealPoint DGtal::functors::BackwardRigidTransformation3D< TSpace >::RealPoint

Definition at line 160 of file RigidTransformation3D.h.

template<typename TSpace >
typedef TSpace::RealVector DGtal::functors::BackwardRigidTransformation3D< TSpace >::RealVector

Definition at line 161 of file RigidTransformation3D.h.

Constructor & Destructor Documentation

template<typename TSpace >
DGtal::functors::BackwardRigidTransformation3D< TSpace >::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 172 of file RigidTransformation3D.h.

References DGtal::functors::BackwardRigidTransformation3D< TSpace >::axis, DGtal::functors::BackwardRigidTransformation3D< TSpace >::t_cos, and DGtal::functors::BackwardRigidTransformation3D< TSpace >::t_sin.

174  : axis(aAxis.getNormalized()), origin(aOrigin), trans(aTranslate)
175  {
176  if ( std::isnan( axis.norm() ) )
177  throw std::runtime_error ( "Axis of rotation can not be set as a vector of length 0!" );
178 
179  t_sin = std::sin ( angle );
180  t_cos = std::cos ( angle );
181  }

Member Function Documentation

template<typename TSpace >
DGtal::functors::BackwardRigidTransformation3D< TSpace >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >)  )
private

Checking concepts.

template<typename TSpace >
DGtal::functors::BackwardRigidTransformation3D< TSpace >::BOOST_STATIC_ASSERT ( (TSpace::dimension==3)  )
private
template<typename TSpace >
Point DGtal::functors::BackwardRigidTransformation3D< TSpace >::operator() ( const Point aInput) const
inline

Operator

Returns
the transformed point.

Definition at line 189 of file RigidTransformation3D.h.

References DGtal::functors::BackwardRigidTransformation3D< TSpace >::axis, DGtal::functors::BackwardRigidTransformation3D< TSpace >::origin, DGtal::functors::BackwardRigidTransformation3D< TSpace >::t_cos, DGtal::functors::BackwardRigidTransformation3D< TSpace >::t_sin, and DGtal::functors::BackwardRigidTransformation3D< TSpace >::trans.

190  {
191  Point p;
192 
193  p[0] = std::floor ( ( ( ( ( t_cos + ( axis[0] * axis[0] ) * ( 1. - t_cos ) ) * ( aInput[0] - trans[0] - origin[0] ) )
194  + ( ( axis[2] * t_sin + axis[0] * axis[1] * ( 1. - t_cos ) ) * ( aInput[1] - trans[1] - origin[1] ) )
195  + ( ( -axis[1] * t_sin + axis[0] * axis[2] * ( 1. - t_cos ) ) * ( aInput[2] - trans[2] - origin[2] ) ) ) ) + origin[0] + 0.5 );
196 
197  p[1] = std::floor ( ( ( ( ( axis[0] * axis[1] * ( 1. - t_cos ) - axis[2] * t_sin ) * ( aInput[0] - trans[0] - origin[0] ) )
198  + ( ( t_cos + ( axis[1] * axis[1] ) * ( 1. - t_cos ) ) * ( aInput[1] - trans[1] - origin[1] ) )
199  + ( ( axis[0] * t_sin + axis[1] * axis[2] * ( 1. - t_cos ) ) * ( aInput[2] - trans[2] - origin[2] ) ) ) ) + origin[1] + 0.5 );
200 
201  p[2] = std::floor ( ( ( ( ( axis[1] * t_sin + axis[0] * axis[2] * ( 1. - t_cos ) ) * ( aInput[0] - trans[0] - origin[0] ) )
202  + ( ( -axis[0] * t_sin + axis[1] * axis[2] * ( 1. - t_cos ) ) * ( aInput[1] - trans[1] - origin[1] ) )
203  + ( ( t_cos + ( axis[2] * axis[2] ) * ( 1. - t_cos ) ) * ( aInput[2] - trans[2] - origin[2] ) ) ) ) + origin[2] + 0.5 );
204  return p;
205  }

Field Documentation

template<typename TSpace >
RealVector DGtal::functors::BackwardRigidTransformation3D< TSpace >::axis
private
template<typename TSpace >
RealPoint DGtal::functors::BackwardRigidTransformation3D< TSpace >::origin
private
template<typename TSpace >
double DGtal::functors::BackwardRigidTransformation3D< TSpace >::t_cos
private
template<typename TSpace >
double DGtal::functors::BackwardRigidTransformation3D< TSpace >::t_sin
private
template<typename TSpace >
RealVector DGtal::functors::BackwardRigidTransformation3D< TSpace >::trans
private

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