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 : public Rigid3DTransform< TScalarType >
00040 {
00041 public:
00042
00044 typedef VersorTransform Self;
00045 typedef Rigid3DTransform< TScalarType > Superclass;
00046 typedef SmartPointer<Self> Pointer;
00047 typedef SmartPointer<const Self> ConstPointer;
00048
00050 itkTypeMacro( VersorTransform, Rigid3DTransform );
00051
00053 itkNewMacro( Self );
00054
00056 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00057 itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00058 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00059 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
00082 typedef vnl_quaternion<TScalarType> VnlQuaternionType;
00083
00085 typedef Versor<TScalarType> VersorType;
00086 typedef typename VersorType::VectorType AxisType;
00087 typedef typename VersorType::ValueType AngleType;
00088
00097 void SetParameters( const ParametersType & parameters );
00098
00100 const ParametersType& GetParameters(void) const;
00101
00103 void SetRotation( const VersorType & versor );
00104 void SetRotation( const AxisType & axis, AngleType angle );
00105 itkGetConstReferenceMacro(Versor, VersorType);
00107
00109 virtual void SetIdentity(void);
00110
00116 const JacobianType & GetJacobian(const InputPointType &point ) const;
00117
00118 protected:
00119
00121 VersorTransform(const MatrixType &matrix,
00122 const OutputVectorType &offset);
00123 VersorTransform(unsigned int outputDims,
00124 unsigned int paramDims);
00125 VersorTransform();
00127
00129 ~VersorTransform(){};
00130
00133 virtual void SetRotationMatrix(const MatrixType & matrix)
00134 { this->Superclass::SetRotationMatrix( matrix ); }
00135
00136 void SetVarVersor(const VersorType & newVersor)
00137 { m_Versor = newVersor; }
00138
00140 void PrintSelf(std::ostream &os, Indent indent) const;
00141
00144 void ComputeMatrix(void);
00145 void ComputeMatrixParameters(void);
00147
00148 private:
00150 VersorTransform(const Self & other);
00151
00153 const Self & operator=( const Self & );
00154
00156 VersorType m_Versor;
00157
00158 };
00159
00160
00161 }
00162
00163
00164 #ifndef ITK_MANUAL_INSTANTIATION
00165 #include "itkVersorTransform.txx"
00166 #endif
00167
00168 #endif
00169