Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkVersorTransform_h
00019 #define __itkVersorTransform_h
00020
00021 #include <iostream>
00022 #include "itkRigid3DTransform.h"
00023 #include "vnl/vnl_quaternion.h"
00024 #include "itkVersor.h"
00025
00026 namespace itk
00027 {
00028
00048 template < class TScalarType=double >
00049 class ITK_EXPORT VersorTransform : public Rigid3DTransform< TScalarType >
00050 {
00051 public:
00052
00054 typedef VersorTransform Self;
00055 typedef Rigid3DTransform< TScalarType > Superclass;
00056 typedef SmartPointer<Self> Pointer;
00057 typedef SmartPointer<const Self> ConstPointer;
00058
00060 itkTypeMacro( VersorTransform, Rigid3DTransform );
00061
00063 itkNewMacro( Self );
00064
00066 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00067 itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00068 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00069 itkStaticConstMacro(ParametersDimension, unsigned int, 3);
00071
00073 typedef typename Superclass::ParametersType ParametersType;
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::InputVnlVectorType InputVnlVectorType;
00081 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00082 typedef typename Superclass::InputCovariantVectorType
00083 InputCovariantVectorType;
00084 typedef typename Superclass::OutputCovariantVectorType
00085 OutputCovariantVectorType;
00086 typedef typename Superclass::MatrixType MatrixType;
00087 typedef typename Superclass::InverseMatrixType InverseMatrixType;
00088 typedef typename Superclass::CenterType CenterType;
00089 typedef typename Superclass::OffsetType OffsetType;
00090
00092 typedef vnl_quaternion<TScalarType> VnlQuaternionType;
00093
00095 typedef Versor<TScalarType> VersorType;
00096 typedef typename VersorType::VectorType AxisType;
00097 typedef typename VersorType::ValueType AngleType;
00098 typedef typename AxisType::ValueType AxisValueType;
00099 typedef typename ParametersType::ValueType ParameterValueType;
00100
00109 void SetParameters( const ParametersType & parameters );
00110
00112 const ParametersType& GetParameters(void) const;
00113
00115 void SetRotation( const VersorType & versor );
00116 void SetRotation( const AxisType & axis, AngleType angle );
00117 itkGetConstReferenceMacro(Versor, VersorType);
00119
00121 virtual void SetIdentity(void);
00122
00128 const JacobianType & GetJacobian(const InputPointType &point ) const;
00129
00130 protected:
00131
00133 VersorTransform(const MatrixType &matrix,
00134 const OutputVectorType &offset);
00135 VersorTransform(unsigned int outputDims,
00136 unsigned int paramDims);
00137 VersorTransform();
00139
00141 ~VersorTransform(){};
00142
00145 virtual void SetRotationMatrix(const MatrixType & matrix)
00146 { this->Superclass::SetRotationMatrix( matrix ); }
00147
00148 void SetVarVersor(const VersorType & newVersor)
00149 { m_Versor = newVersor; }
00150
00152 void PrintSelf(std::ostream &os, Indent indent) const;
00153
00156 void ComputeMatrix(void);
00157 void ComputeMatrixParameters(void);
00159
00160 private:
00162 VersorTransform(const Self & other);
00163
00165 const Self & operator=( const Self & );
00166
00168 VersorType m_Versor;
00169
00170 };
00171
00172
00173 }
00174
00175
00176 #define ITK_TEMPLATE_VersorTransform(_, EXPORT, x, y) namespace itk { \
00177 _(1(class EXPORT VersorTransform< ITK_TEMPLATE_1 x >)) \
00178 namespace Templates { typedef VersorTransform< ITK_TEMPLATE_1 x > VersorTransform##y; } \
00179 }
00180
00181 #if ITK_TEMPLATE_EXPLICIT
00182 # include "Templates/itkVersorTransform+-.h"
00183 #endif
00184
00185 #if ITK_TEMPLATE_TXX
00186 # include "itkVersorTransform.txx"
00187 #endif
00188
00189 #endif
00190