IGSTK
igstkTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkTransform.h,v $
5  Language: C++
6  Date: $Date: 2009-01-30 18:24:31 $
7  Version: $Revision: 1.25 $
8 
9  Copyright (c) ISC Insight Software Consortium. All rights reserved.
10  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __igstkTransform_h
19 #define __igstkTransform_h
20 
21 #include "igstkTransformBase.h"
22 
23 #include "itkVector.h"
24 #include "itkVersor.h"
25 
26 #include "vtkMatrix4x4.h"
27 
28 #include "igstkTimeStamp.h"
29 #include "igstkMacros.h"
30 
31 namespace igstk
32 {
33 
57  class Transform : public TransformBase
58 {
59 public:
60 
61  typedef ::itk::Vector<double, 3> VectorType;
62  typedef ::itk::Point<double, 3> PointType;
63  typedef ::itk::Versor<double> VersorType;
64 
65 public:
66 
68  Transform();
69  Transform( const Transform & t );
70  virtual ~Transform();
71 
73  static Transform TransformCompose( Transform leftTransform,
74  Transform rightTransform );
75 
77  const Transform & operator=( const Transform & inputTransform );
78 
84  const VectorType & translation,
85  const VersorType & rotation,
86  TransformBase::ErrorType errorValue,
87  TimeStamp::TimePeriodType millisecondsToExpiration );
88 
89 
96  void SetRotation(
97  const VersorType & rotation,
98  ErrorType errorValue,
99  TimePeriodType millisecondsToExpiration );
100 
107  void SetTranslation(
108  const VectorType & translation,
109  ErrorType errorValue,
110  TimePeriodType millisecondsToExpiration );
111 
115  igstkGetMacro( Translation, VectorType );
116 
117 
121  igstkGetMacro( Rotation, VersorType );
122 
123 
129  void ExportTransform( vtkMatrix4x4 & matrix ) const;
130 
133  void ImportTransform( vtkMatrix4x4 & matrix );
134 
138  bool operator==( const Transform & inputTransform );
139  bool operator!=( const Transform & inputTransform );
140 
143  const Transform& inputTransform, double tol = vnl_math::eps ) const;
144 
146  bool IsIdentity( double tol = vnl_math::eps ) const;
147 
149  void SetToIdentity( TimePeriodType validityPeriodInMilliseconds );
150 
152  void Print( std::ostream& os, itk::Indent indent ) const;
153 
155  Transform GetInverse() const;
156 
157 
158 protected:
159 
160  void PrintHeader( std::ostream& os, itk::Indent indent ) const;
161 
162  void PrintTrailer( std::ostream& itkNotUsed(os),
163  itk::Indent itkNotUsed(indent) ) const;
164 
166  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
167 
168 private:
169 
170  VectorType m_Translation;
171  VersorType m_Rotation;
172 
173 };
174 
175 std::ostream& operator<<( std::ostream& os, const igstk::Transform& o );
176 }
177 
178 #endif
::itk::Versor< double > VersorType
Transform GetInverse() const
Returns the Inverse Transform of the current one.
void PrintTrailer(std::ostream &itkNotUsed(os), itk::Indent itkNotUsed(indent)) const
#define igstkGetMacro(name, type)
Get built-in type.
Definition: igstkMacros.h:105
::itk::Point< double, 3 > PointType
void ImportTransform(vtkMatrix4x4 &matrix)
Set the content of the transformation from a vtkMatrix4x4.
static Transform TransformCompose(Transform leftTransform, Transform rightTransform)
Transform composition method.
void SetRotation(const VersorType &rotation, ErrorType errorValue, TimePeriodType millisecondsToExpiration)
Set only Rotation.
std::ostream & operator<<(std::ostream &os, const igstk::AffineTransform &o)
bool IsNumericallyEquivalent(const Transform &inputTransform, double tol=vnl_math::eps) const
Compare two transforms for equivalence.
void ExportTransform(vtkMatrix4x4 &matrix) const
Export the content of the transformation in the format of a vtkMatrix4x4.
void SetTranslationAndRotation(const VectorType &translation, const VersorType &rotation, TransformBase::ErrorType errorValue, TimeStamp::TimePeriodType millisecondsToExpiration)
Set Translation and Rotation simultaneously.
bool operator==(const Transform &inputTransform)
Compare two transforms for equivalence, in the sense that these are the same objects in memory...
defines standard system-wide macros, constants, and other common parameters in the IGSTK Library...
Transform()
Constructor and destructor.
The abstract base class for all of the IGSTK transform types.
void SetToIdentity(TimePeriodType validityPeriodInMilliseconds)
Resets the Transform to an Identity Transform.
TimeStamp::TimePeriodType TimePeriodType
const Transform & operator=(const Transform &inputTransform)
Assign the values of one transform to another.
virtual ~Transform()
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const
Print the object information in a stream.
A class representing a 3D Rigid transform.
void PrintHeader(std::ostream &os, itk::Indent indent) const
bool operator!=(const Transform &inputTransform)
bool IsIdentity(double tol=vnl_math::eps) const
Evaluate if the Transform is an Identity upto a given tolerance.
void Print(std::ostream &os, itk::Indent indent) const
Method for printing the member variables of this class to an ostream.
void SetTranslation(const VectorType &translation, ErrorType errorValue, TimePeriodType millisecondsToExpiration)
Set only Translation.
::itk::Vector< double, 3 > VectorType