00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __igstkTransform_h
00019 #define __igstkTransform_h
00020
00021 #include "igstkTransformBase.h"
00022
00023 #include "itkVector.h"
00024 #include "itkVersor.h"
00025
00026 #include "vtkMatrix4x4.h"
00027
00028 #include "igstkTimeStamp.h"
00029 #include "igstkMacros.h"
00030
00031 namespace igstk
00032 {
00033
00057 class Transform : public TransformBase
00058 {
00059 public:
00060
00061 typedef ::itk::Vector<double, 3> VectorType;
00062 typedef ::itk::Point<double, 3> PointType;
00063 typedef ::itk::Versor<double> VersorType;
00064
00065 public:
00066
00068 Transform();
00069 Transform( const Transform & t );
00070 virtual ~Transform();
00071
00073 static Transform TransformCompose( Transform leftTransform,
00074 Transform rightTransform );
00075
00077 const Transform & operator=( const Transform & inputTransform );
00078
00083 void SetTranslationAndRotation(
00084 const VectorType & translation,
00085 const VersorType & rotation,
00086 TransformBase::ErrorType errorValue,
00087 TimeStamp::TimePeriodType millisecondsToExpiration );
00088
00089
00096 void SetRotation(
00097 const VersorType & rotation,
00098 ErrorType errorValue,
00099 TimePeriodType millisecondsToExpiration );
00100
00107 void SetTranslation(
00108 const VectorType & translation,
00109 ErrorType errorValue,
00110 TimePeriodType millisecondsToExpiration );
00111
00115 igstkGetMacro( Translation, VectorType );
00116
00117
00121 igstkGetMacro( Rotation, VersorType );
00122
00123
00129 void ExportTransform( vtkMatrix4x4 & matrix ) const;
00130
00133 void ImportTransform( vtkMatrix4x4 & matrix );
00134
00138 bool operator==( const Transform & inputTransform );
00139 bool operator!=( const Transform & inputTransform );
00140
00142 bool IsNumericallyEquivalent(
00143 const Transform& inputTransform, double tol = vnl_math::eps ) const;
00144
00146 bool IsIdentity( double tol = vnl_math::eps ) const;
00147
00149 void SetToIdentity( TimePeriodType validityPeriodInMilliseconds );
00150
00152 void Print( std::ostream& os, itk::Indent indent ) const;
00153
00155 Transform GetInverse() const;
00156
00157
00158 protected:
00159
00160 void PrintHeader( std::ostream& os, itk::Indent indent ) const;
00161
00162 void PrintTrailer( std::ostream& itkNotUsed(os),
00163 itk::Indent itkNotUsed(indent) ) const;
00164
00166 virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
00167
00168 private:
00169
00170 VectorType m_Translation;
00171 VersorType m_Rotation;
00172
00173 };
00174
00175 std::ostream& operator<<( std::ostream& os, const igstk::Transform& o );
00176 }
00177
00178 #endif