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 typedef SmartPointer<Self> Pointer;
00042 typedef SmartPointer<const Self> ConstPointer;
00043
00045 itkNewMacro( Self );
00046
00048 itkTypeMacro( QuaternionRigidTransform, Rigid3DTransform );
00049
00051 itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00052 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00053 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00054 itkStaticConstMacro(ParametersDimension, unsigned int, 7);
00055
00057 typedef typename Superclass::ParametersType ParametersType;
00058 typedef typename Superclass::JacobianType JacobianType;
00059 typedef typename Superclass::ScalarType ScalarType;
00060 typedef typename Superclass::InputPointType InputPointType;
00061 typedef typename Superclass::OutputPointType OutputPointType;
00062 typedef typename Superclass::InputVectorType InputVectorType;
00063 typedef typename Superclass::OutputVectorType OutputVectorType;
00064 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00065 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00066 typedef typename Superclass::InputCovariantVectorType
00067 InputCovariantVectorType;
00068 typedef typename Superclass::OutputCovariantVectorType
00069 OutputCovariantVectorType;
00070 typedef typename Superclass::MatrixType MatrixType;
00071 typedef typename Superclass::InverseMatrixType InverseMatrixType;
00072 typedef typename Superclass::CenterType CenterType;
00073 typedef typename Superclass::OffsetType OffsetType;
00074 typedef typename Superclass::TranslationType TranslationType;
00075
00076
00078 typedef vnl_quaternion<TScalarType> VnlQuaternionType;
00079
00084 void SetRotation(const VnlQuaternionType &rotation);
00085
00089 const VnlQuaternionType & GetRotation(void) const
00090 { return m_Rotation; }
00091
00093 virtual void SetIdentity(void);
00094
00100 void SetParameters( const ParametersType & parameters );
00101 virtual const ParametersType & GetParameters() const;
00102
00108 const JacobianType & GetJacobian(const InputPointType &point ) const;
00109
00110 protected:
00111 QuaternionRigidTransform(const MatrixType &matrix,
00112 const OutputVectorType &offset);
00113 QuaternionRigidTransform(unsigned int outputDims,
00114 unsigned int paramDims);
00115 QuaternionRigidTransform();
00116 ~QuaternionRigidTransform(){};
00117
00118 void ComputeMatrix();
00119
00120 void ComputeMatrixParameters();
00121
00122 void SetVarRotation(const VnlQuaternionType & rotation)
00123 { m_Rotation = rotation; };
00124
00125 const InverseMatrixType & GetInverseMatrix( void ) const;
00126
00127 void PrintSelf(std::ostream &os, Indent indent) const;
00128
00129 private:
00130 QuaternionRigidTransform(const Self&);
00131 void operator=(const Self&);
00132
00134 VnlQuaternionType m_Rotation;
00135
00136 };
00137
00138
00139 }
00140
00141
00142 #ifndef ITK_MANUAL_INSTANTIATION
00143 #include "itkQuaternionRigidTransform.txx"
00144 #endif
00145
00146 #endif