itkQuaternionRigidTransform.h
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::JacobianType JacobianType;
00074 typedef typename Superclass::ScalarType ScalarType;
00075 typedef typename Superclass::InputPointType InputPointType;
00076 typedef typename Superclass::OutputPointType OutputPointType;
00077 typedef typename Superclass::InputVectorType InputVectorType;
00078 typedef typename Superclass::OutputVectorType OutputVectorType;
00079 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00080 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00081 typedef typename Superclass::InputCovariantVectorType
00082 InputCovariantVectorType;
00083 typedef typename Superclass::OutputCovariantVectorType
00084 OutputCovariantVectorType;
00085 typedef typename Superclass::MatrixType MatrixType;
00086 typedef typename Superclass::InverseMatrixType InverseMatrixType;
00087 typedef typename Superclass::CenterType CenterType;
00088 typedef typename Superclass::OffsetType OffsetType;
00089 typedef typename Superclass::TranslationType TranslationType;
00090
00091
00093 typedef vnl_quaternion<TScalarType> VnlQuaternionType;
00094
00100 void SetRotation(const VnlQuaternionType &rotation);
00101
00105 const VnlQuaternionType & GetRotation(void) const
00106 { return m_Rotation; }
00107
00109 virtual void SetIdentity(void);
00110
00116 void SetParameters( const ParametersType & parameters );
00117 virtual const ParametersType & GetParameters() const;
00119
00125 const JacobianType & GetJacobian(const InputPointType &point ) const;
00126
00127 protected:
00128 QuaternionRigidTransform(const MatrixType &matrix,
00129 const OutputVectorType &offset);
00130 QuaternionRigidTransform(unsigned int outputDims,
00131 unsigned int paramDims);
00132 QuaternionRigidTransform();
00133 ~QuaternionRigidTransform(){};
00134
00135 void ComputeMatrix();
00136
00137 void ComputeMatrixParameters();
00138
00139 void SetVarRotation(const VnlQuaternionType & rotation)
00140 { m_Rotation = rotation; }
00141
00142 const InverseMatrixType & GetInverseMatrix( void ) const;
00143
00144 void PrintSelf(std::ostream &os, Indent indent) const;
00145
00146 private:
00147 QuaternionRigidTransform(const Self&);
00148 void operator=(const Self&);
00149
00151 VnlQuaternionType m_Rotation;
00152
00153 };
00154
00155
00156 }
00157
00158
00159 #define ITK_TEMPLATE_QuaternionRigidTransform(_, EXPORT, x, y) namespace itk { \
00160 _(1(class EXPORT QuaternionRigidTransform< ITK_TEMPLATE_1 x >)) \
00161 namespace Templates { typedef QuaternionRigidTransform< ITK_TEMPLATE_1 x > \
00162 QuaternionRigidTransform##y; } \
00163 }
00164
00165 #if ITK_TEMPLATE_EXPLICIT
00166 # include "Templates/itkQuaternionRigidTransform+-.h"
00167 #endif
00168
00169 #if ITK_TEMPLATE_TXX
00170 # include "itkQuaternionRigidTransform.txx"
00171 #endif
00172
00173 #endif
00174