Go to the documentation of this file.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
00047 template < class TScalarType=double >
00048 class ITK_EXPORT QuaternionRigidTransform :
00049 public Rigid3DTransform< TScalarType >
00050 {
00051 public:
00053 typedef QuaternionRigidTransform Self;
00054 typedef Rigid3DTransform< TScalarType > Superclass;
00055 typedef SmartPointer<Self> Pointer;
00056 typedef SmartPointer<const Self> ConstPointer;
00057
00059 itkNewMacro( Self );
00060
00062 itkTypeMacro( QuaternionRigidTransform, Rigid3DTransform );
00063
00065 itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00066 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00067 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00068 itkStaticConstMacro(ParametersDimension, unsigned int, 7);
00070
00072 typedef typename Superclass::ParametersType ParametersType;
00073 typedef typename Superclass::ParametersValueType ParametersValueType;
00074 typedef typename Superclass::JacobianType JacobianType;
00075 typedef typename Superclass::ScalarType ScalarType;
00076 typedef typename Superclass::InputPointType InputPointType;
00077 typedef typename Superclass::OutputPointType OutputPointType;
00078 typedef typename Superclass::InputVectorType InputVectorType;
00079 typedef typename Superclass::OutputVectorType OutputVectorType;
00080 typedef typename Superclass::OutputVectorValueType OutputVectorValueType;
00081 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00082 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00083 typedef typename Superclass::InputCovariantVectorType
00084 InputCovariantVectorType;
00085 typedef typename Superclass::OutputCovariantVectorType
00086 OutputCovariantVectorType;
00087 typedef typename Superclass::MatrixType MatrixType;
00088 typedef typename Superclass::InverseMatrixType InverseMatrixType;
00089 typedef typename Superclass::CenterType CenterType;
00090 typedef typename Superclass::OffsetType OffsetType;
00091 typedef typename Superclass::TranslationType TranslationType;
00092
00093
00095 typedef vnl_quaternion<TScalarType> VnlQuaternionType;
00096
00102 void SetRotation(const VnlQuaternionType &rotation);
00103
00107 const VnlQuaternionType & GetRotation(void) const
00108 { return m_Rotation; }
00109
00111 virtual void SetIdentity(void);
00112
00118 void SetParameters( const ParametersType & parameters );
00119 virtual const ParametersType & GetParameters() const;
00121
00127 const JacobianType & GetJacobian(const InputPointType &point ) const;
00128
00129 protected:
00130 QuaternionRigidTransform(const MatrixType &matrix,
00131 const OutputVectorType &offset);
00132 QuaternionRigidTransform(unsigned int outputDims,
00133 unsigned int paramDims);
00134 QuaternionRigidTransform();
00135 ~QuaternionRigidTransform(){};
00136
00137 void ComputeMatrix();
00138
00139 void ComputeMatrixParameters();
00140
00141 void SetVarRotation(const VnlQuaternionType & rotation)
00142 { m_Rotation = rotation; }
00143
00144 const InverseMatrixType & GetInverseMatrix( void ) const;
00145
00146 void PrintSelf(std::ostream &os, Indent indent) const;
00147
00148 private:
00149 QuaternionRigidTransform(const Self&);
00150 void operator=(const Self&);
00151
00153 VnlQuaternionType m_Rotation;
00154
00155 };
00156
00157
00158 }
00159
00160
00161 #define ITK_TEMPLATE_QuaternionRigidTransform(_, EXPORT, x, y) namespace itk { \
00162 _(1(class EXPORT QuaternionRigidTransform< ITK_TEMPLATE_1 x >)) \
00163 namespace Templates { typedef QuaternionRigidTransform< ITK_TEMPLATE_1 x > \
00164 QuaternionRigidTransform##y; } \
00165 }
00166
00167 #if ITK_TEMPLATE_EXPLICIT
00168 # include "Templates/itkQuaternionRigidTransform+-.h"
00169 #endif
00170
00171 #if ITK_TEMPLATE_TXX
00172 # include "itkQuaternionRigidTransform.txx"
00173 #endif
00174
00175 #endif
00176