00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkQuaternionRigidTransform_h
00018 #define __itkQuaternionRigidTransform_h
00019
00020 #include <iostream>
00021 #include "itkTransform.h"
00022 #include "vnl/vnl_quaternion.h"
00023 #include "itkPoint.h"
00024 #include "itkMatrix.h"
00025
00026 namespace itk
00027 {
00028
00035 template < class TScalarType=double >
00036 class ITK_EXPORT QuaternionRigidTransform :
00037 public Transform< TScalarType, 3, 3>
00038 {
00039 public:
00041 typedef QuaternionRigidTransform Self;
00042 typedef Transform< TScalarType, 3, 3> Superclass;
00043
00044 typedef SmartPointer<Self> Pointer;
00045 typedef SmartPointer<const Self> ConstPointer;
00046
00048 itkNewMacro( Self );
00049
00051 itkTypeMacro( QuaternionRigidTransform, Transform );
00052
00054 typedef typename Superclass::ScalarType ScalarType;
00055
00057 typedef typename Superclass::ParametersType ParametersType;
00058
00060 typedef typename Superclass::JacobianType JacobianType;
00061
00063 typedef vnl_quaternion<TScalarType> VnlQuaternionType;
00064
00066 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00067 itkStaticConstMacro(ParametersDimension, unsigned int, 7);
00068
00070 itkStaticConstMacro(InputSpaceDimension, unsigned int,
00071 Superclass::InputSpaceDimension);
00072 itkStaticConstMacro(OutputSpaceDimension, unsigned int,
00073 Superclass::OutputSpaceDimension);
00074
00076 typedef Matrix<ScalarType, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> MatrixType;
00077
00079 typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> OffsetType;
00080
00082 typedef typename Superclass::InputPointType InputPointType;
00083 typedef typename Superclass::OutputPointType OutputPointType;
00084
00088 const OffsetType & GetOffset(void) const
00089 { return m_Offset; }
00090
00094 const VnlQuaternionType & GetRotation(void) const
00095 { return m_Rotation; }
00096
00101 const MatrixType & GetRotationMatrix(void) const
00102 { return m_RotationMatrix; }
00103
00108 void SetOffset(const OffsetType &offset)
00109 { m_Offset = offset; return; }
00110
00114 void SetRotation(const VnlQuaternionType &rotation);
00115
00120 OutputPointType TransformPoint(const InputPointType &point ) const;
00121
00127 void SetParameters( const ParametersType & parameters );
00128
00134 const JacobianType & GetJacobian(const InputPointType &point ) const;
00135
00136 protected:
00137 QuaternionRigidTransform();
00138 ~QuaternionRigidTransform(){};
00139 void PrintSelf(std::ostream &os, Indent indent) const;
00140
00145 MatrixType m_RotationMatrix;
00146
00147 private:
00148 QuaternionRigidTransform(const Self&);
00149 void operator=(const Self&);
00150
00152 OffsetType m_Offset;
00153
00155 VnlQuaternionType m_Rotation;
00156
00157 };
00158
00159
00160 }
00161
00162
00163 #ifndef ITK_MANUAL_INSTANTIATION
00164 #include "itkQuaternionRigidTransform.txx"
00165 #endif
00166
00167 #endif