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
00038 template < class TScalarType=double >
00039 class ITK_EXPORT VersorTransform :
00040 public Rigid3DTransform< TScalarType >
00041 {
00042 public:
00043
00045 typedef VersorTransform Self;
00046 typedef Rigid3DTransform< TScalarType > Superclass;
00047 typedef SmartPointer<Self> Pointer;
00048 typedef SmartPointer<const Self> ConstPointer;
00049
00051 itkTypeMacro( VersorTransform, Rigid3DTransform );
00052
00054 itkNewMacro( Self );
00055
00057 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00058 itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00059 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00060 itkStaticConstMacro(ParametersDimension, unsigned int, 3);
00061
00063 typedef typename Superclass::ParametersType ParametersType;
00064 typedef typename Superclass::JacobianType JacobianType;
00065 typedef typename Superclass::ScalarType ScalarType;
00066 typedef typename Superclass::InputPointType InputPointType;
00067 typedef typename Superclass::OutputPointType OutputPointType;
00068 typedef typename Superclass::InputVectorType InputVectorType;
00069 typedef typename Superclass::OutputVectorType OutputVectorType;
00070 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00071 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00072 typedef typename Superclass::InputCovariantVectorType
00073 InputCovariantVectorType;
00074 typedef typename Superclass::OutputCovariantVectorType
00075 OutputCovariantVectorType;
00076 typedef typename Superclass::MatrixType MatrixType;
00077 typedef typename Superclass::InverseMatrixType InverseMatrixType;
00078 typedef typename Superclass::CenterType CenterType;
00079 typedef typename Superclass::OffsetType OffsetType;
00080
00084 typedef vnl_quaternion<TScalarType> VnlQuaternionType;
00085
00089 typedef Versor<TScalarType> VersorType;
00090 typedef typename VersorType::VectorType AxisType;
00091 typedef typename VersorType::ValueType AngleType;
00092
00093
00094
00105 void SetParameters( const ParametersType & parameters );
00106
00108 const ParametersType& GetParameters(void) const;
00109
00113 void SetRotation( const VersorType & versor );
00114 void SetRotation( const AxisType & axis, AngleType angle );
00115 itkGetConstReferenceMacro(Versor, VersorType);
00116
00118 virtual void SetIdentity(void);
00119
00128 const JacobianType & GetJacobian(const InputPointType &point ) const;
00129
00130 protected:
00135 VersorTransform(const MatrixType &matrix,
00136 const OutputVectorType &offset);
00137 VersorTransform(unsigned int outputDims,
00138 unsigned int paramDims);
00139 VersorTransform();
00140
00144 ~VersorTransform(){};
00145
00148 virtual void SetRotationMatrix(const MatrixType & matrix)
00149 { this->Superclass::SetRotationMatrix( matrix ); }
00150
00151 void SetVarVersor(const VersorType & newVersor)
00152 { m_Versor = newVersor; }
00153
00157 void PrintSelf(std::ostream &os, Indent indent) const;
00158
00159
00164 void ComputeMatrix(void);
00165 void ComputeMatrixParameters(void);
00166
00167 private:
00171 VersorTransform(const Self & other);
00172
00176 const Self & operator=( const Self & );
00177
00181 VersorType m_Versor;
00182
00183 };
00184
00185
00186 }
00187
00188
00189 #ifndef ITK_MANUAL_INSTANTIATION
00190 #include "itkVersorTransform.txx"
00191 #endif
00192
00193 #endif