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);
00056
00058 typedef typename Superclass::ParametersType ParametersType;
00059 typedef typename Superclass::JacobianType JacobianType;
00060 typedef typename Superclass::ScalarType ScalarType;
00061 typedef typename Superclass::InputPointType InputPointType;
00062 typedef typename Superclass::OutputPointType OutputPointType;
00063 typedef typename Superclass::InputVectorType InputVectorType;
00064 typedef typename Superclass::OutputVectorType OutputVectorType;
00065 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00066 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00067 typedef typename Superclass::InputCovariantVectorType
00068 InputCovariantVectorType;
00069 typedef typename Superclass::OutputCovariantVectorType
00070 OutputCovariantVectorType;
00071 typedef typename Superclass::MatrixType MatrixType;
00072 typedef typename Superclass::InverseMatrixType InverseMatrixType;
00073 typedef typename Superclass::CenterType CenterType;
00074 typedef typename Superclass::OffsetType OffsetType;
00075 typedef typename Superclass::TranslationType TranslationType;
00076
00077
00079 typedef vnl_quaternion<TScalarType> VnlQuaternionType;
00080
00086 void SetRotation(const VnlQuaternionType &rotation);
00087
00091 const VnlQuaternionType & GetRotation(void) const
00092 { return m_Rotation; }
00093
00095 virtual void SetIdentity(void);
00096
00102 void SetParameters( const ParametersType & parameters );
00103 virtual const ParametersType & GetParameters() const;
00105
00111 const JacobianType & GetJacobian(const InputPointType &point ) const;
00112
00113 protected:
00114 QuaternionRigidTransform(const MatrixType &matrix,
00115 const OutputVectorType &offset);
00116 QuaternionRigidTransform(unsigned int outputDims,
00117 unsigned int paramDims);
00118 QuaternionRigidTransform();
00119 ~QuaternionRigidTransform(){};
00120
00121 void ComputeMatrix();
00122
00123 void ComputeMatrixParameters();
00124
00125 void SetVarRotation(const VnlQuaternionType & rotation)
00126 { m_Rotation = rotation; };
00127
00128 const InverseMatrixType & GetInverseMatrix( void ) const;
00129
00130 void PrintSelf(std::ostream &os, Indent indent) const;
00131
00132 private:
00133 QuaternionRigidTransform(const Self&);
00134 void operator=(const Self&);
00135
00137 VnlQuaternionType m_Rotation;
00138
00139 };
00140
00141
00142 }
00143
00144
00145 #ifndef ITK_MANUAL_INSTANTIATION
00146 #include "itkQuaternionRigidTransform.txx"
00147 #endif
00148
00149 #endif
00150