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
00046 template < class TScalarType=double >
00047 class ITK_EXPORT QuaternionRigidTransform :
00048 public Rigid3DTransform< TScalarType >
00049 {
00050 public:
00052 typedef QuaternionRigidTransform Self;
00053 typedef Rigid3DTransform< TScalarType > Superclass;
00054 typedef SmartPointer<Self> Pointer;
00055 typedef SmartPointer<const Self> ConstPointer;
00056
00058 itkNewMacro( Self );
00059
00061 itkTypeMacro( QuaternionRigidTransform, Rigid3DTransform );
00062
00064 itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00065 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00066 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00067 itkStaticConstMacro(ParametersDimension, unsigned int, 7);
00069
00071 typedef typename Superclass::ParametersType ParametersType;
00072 typedef typename Superclass::JacobianType JacobianType;
00073 typedef typename Superclass::ScalarType ScalarType;
00074 typedef typename Superclass::InputPointType InputPointType;
00075 typedef typename Superclass::OutputPointType OutputPointType;
00076 typedef typename Superclass::InputVectorType InputVectorType;
00077 typedef typename Superclass::OutputVectorType OutputVectorType;
00078 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00079 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00080 typedef typename Superclass::InputCovariantVectorType
00081 InputCovariantVectorType;
00082 typedef typename Superclass::OutputCovariantVectorType
00083 OutputCovariantVectorType;
00084 typedef typename Superclass::MatrixType MatrixType;
00085 typedef typename Superclass::InverseMatrixType InverseMatrixType;
00086 typedef typename Superclass::CenterType CenterType;
00087 typedef typename Superclass::OffsetType OffsetType;
00088 typedef typename Superclass::TranslationType TranslationType;
00089
00090
00092 typedef vnl_quaternion<TScalarType> VnlQuaternionType;
00093
00099 void SetRotation(const VnlQuaternionType &rotation);
00100
00104 const VnlQuaternionType & GetRotation(void) const
00105 { return m_Rotation; }
00106
00108 virtual void SetIdentity(void);
00109
00115 void SetParameters( const ParametersType & parameters );
00116 virtual const ParametersType & GetParameters() const;
00118
00124 const JacobianType & GetJacobian(const InputPointType &point ) const;
00125
00126 protected:
00127 QuaternionRigidTransform(const MatrixType &matrix,
00128 const OutputVectorType &offset);
00129 QuaternionRigidTransform(unsigned int outputDims,
00130 unsigned int paramDims);
00131 QuaternionRigidTransform();
00132 ~QuaternionRigidTransform(){};
00133
00134 void ComputeMatrix();
00135
00136 void ComputeMatrixParameters();
00137
00138 void SetVarRotation(const VnlQuaternionType & rotation)
00139 { m_Rotation = rotation; };
00140
00141 const InverseMatrixType & GetInverseMatrix( void ) const;
00142
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
00152 };
00153
00154
00155 }
00156
00157
00158 #define ITK_TEMPLATE_QuaternionRigidTransform(_, EXPORT, x, y) namespace itk { \
00159 _(1(class EXPORT QuaternionRigidTransform< ITK_TEMPLATE_1 x >)) \
00160 namespace Templates { typedef QuaternionRigidTransform< ITK_TEMPLATE_1 x > \
00161 QuaternionRigidTransform##y; } \
00162 }
00163
00164 #if ITK_TEMPLATE_EXPLICIT
00165 # include "Templates/itkQuaternionRigidTransform+-.h"
00166 #endif
00167
00168 #if ITK_TEMPLATE_TXX
00169 # include "itkQuaternionRigidTransform.txx"
00170 #endif
00171
00172 #endif
00173