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

#include <DGtal/images/RigidTransformation3D.h>

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

Public Types

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

Public Member Functions

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

Protected Attributes

RealVector axis
 
RealPoint origin
 
double t_sin
 
double t_cos
 
RealVector trans
 

Private Member Functions

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

Detailed Description

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

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

Definition at line 70 of file RigidTransformation3D.h.

Member Typedef Documentation

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

Definition at line 78 of file RigidTransformation3D.h.

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

Definition at line 79 of file RigidTransformation3D.h.

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

Definition at line 80 of file RigidTransformation3D.h.

Constructor & Destructor Documentation

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

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

93  : axis(aAxis.getNormalized()), origin(aOrigin), trans(aTranslate)
94 
95 
96  {
97  if ( std::isnan( axis.norm() ) )
98  throw std::runtime_error ( "Axis of rotation can not be set as a vector of length 0!" );
99  t_sin = std::sin ( angle );
100  t_cos = std::cos ( angle );
101  }

Member Function Documentation

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

Checking concepts.

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

Operator

Returns
the transformed point.

Definition at line 109 of file RigidTransformation3D.h.

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

110  {
111  Point p;
112 
113  p[0] = std::floor ( ( ( ( ( t_cos + ( axis[0] * axis[0] ) * ( 1. - t_cos ) ) * ( aInput[0] - origin[0] ) )
114  + ( ( axis[0] * axis[1] * ( 1. - t_cos ) - axis[2] * t_sin ) * ( aInput[1] - origin[1] ) )
115  + ( ( axis[1] * t_sin + axis[0] * axis[2] * ( 1. - t_cos ) ) * ( aInput[2] - origin[2] ) ) ) + trans[0] ) + origin[0] + 0.5 );
116 
117  p[1] = std::floor ( ( ( ( ( axis[2] * t_sin + axis[0] * axis[1] * ( 1. - t_cos ) ) * ( aInput[0] - origin[0] ) )
118  + ( ( t_cos + ( axis[1] * axis[1] ) * ( 1. - t_cos ) ) * ( aInput[1] - origin[1] ) )
119  + ( ( -axis[0] * t_sin + axis[1] * axis[2] * ( 1. - t_cos ) ) * ( aInput[2] - origin[2] ) ) ) + trans[1] ) + origin[1] + 0.5 );
120 
121  p[2] = std::floor ( ( ( ( ( -axis[1] * t_sin + axis[0] * axis[2] * ( 1. - t_cos ) ) * ( aInput[0] - origin[0] ) )
122  + ( ( axis[0] * t_sin + axis[1] * axis[2] * ( 1. - t_cos ) ) * ( aInput[1] - origin[1] ) )
123  + ( ( t_cos + ( axis[2] * axis[2] ) * ( 1. - t_cos ) ) * ( aInput[2] - origin[2] ) ) ) + trans[2] ) + origin[2] + 0.5 );
124 
125  return p;
126  }

Field Documentation

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

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