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 "itkRigid3DTransform.h"
00022 #include "vnl/vnl_quaternion.h"
00023
00024 namespace itk
00025 {
00026
00033 template < class TScalarType=double >
00034 class ITK_EXPORT QuaternionRigidTransform :
00035 public Rigid3DTransform< TScalarType >
00036 {
00037 public:
00039 typedef QuaternionRigidTransform Self;
00040 typedef Rigid3DTransform< TScalarType > Superclass;
00041
00042 typedef SmartPointer<Self> Pointer;
00043 typedef SmartPointer<const Self> ConstPointer;
00044
00046 itkNewMacro( Self );
00047
00049 itkTypeMacro( QuaternionRigidTransform, Rigid3DTransform );
00050
00052 typedef typename Superclass::ScalarType ScalarType;
00053
00055 typedef typename Superclass::InputVectorType InputVectorType;
00056 typedef typename Superclass::OutputVectorType OutputVectorType;
00057 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00058 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00059 typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
00060 typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
00061
00063 typedef typename Superclass::ParametersType ParametersType;
00064
00066 typedef typename Superclass::JacobianType JacobianType;
00067
00069 typedef vnl_quaternion<TScalarType> VnlQuaternionType;
00070
00072 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00073 itkStaticConstMacro(ParametersDimension, unsigned int, 7);
00074
00076 itkStaticConstMacro(InputSpaceDimension, unsigned int,
00077 Superclass::InputSpaceDimension);
00078 itkStaticConstMacro(OutputSpaceDimension, unsigned int,
00079 Superclass::OutputSpaceDimension);
00080
00082 typedef typename Superclass::MatrixType MatrixType;
00083
00085 typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> OffsetType;
00086
00088 typedef typename Superclass::InputPointType InputPointType;
00089 typedef typename Superclass::OutputPointType OutputPointType;
00090
00091
00095 const VnlQuaternionType & GetRotation(void) const
00096 { return m_Rotation; }
00097
00098
00100 virtual void SetIdentity(void);
00101
00106 void SetRotation(const VnlQuaternionType &rotation);
00107
00108
00110 void SetCenter( const InputPointType & center );
00111 itkGetConstReferenceMacro( Center, InputPointType );
00112
00114 void SetTranslation( const OutputVectorType & translation );
00115 itkGetConstReferenceMacro( Translation, OutputVectorType );
00116
00120 virtual void ComputeOffset(void);
00121
00127 void SetParameters( const ParametersType & parameters );
00128 virtual const ParametersType & GetParameters() const;
00129
00135 const JacobianType & GetJacobian(const InputPointType &point ) const;
00136
00138 virtual MatrixType GetInverseMatrix() const;
00139
00140 protected:
00141 QuaternionRigidTransform();
00142 ~QuaternionRigidTransform(){};
00143 void PrintSelf(std::ostream &os, Indent indent) const;
00144
00145 private:
00146 QuaternionRigidTransform(const Self&);
00147 void operator=(const Self&);
00148
00150 VnlQuaternionType m_Rotation;
00151
00153 InputPointType m_Center;
00154
00156 OutputVectorType m_Translation;
00157
00158
00159 };
00160
00161
00162 }
00163
00164
00165 #ifndef ITK_MANUAL_INSTANTIATION
00166 #include "itkQuaternionRigidTransform.txx"
00167 #endif
00168
00169 #endif