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
00107 void SetParameters( const ParametersType & parameters );
00108
00110 const ParametersType& GetParameters(void) const;
00111
00113 void SetRotation( const VersorType & versor );
00114 void SetRotation( const AxisType & axis, AngleType angle );
00115 itkGetConstReferenceMacro(Versor, VersorType);
00117
00119 virtual void SetIdentity(void);
00120
00126 const JacobianType & GetJacobian(const InputPointType &point ) const;
00127
00128 protected:
00129
00131 VersorTransform(const MatrixType &matrix,
00132 const OutputVectorType &offset);
00133 VersorTransform(unsigned int outputDims,
00134 unsigned int paramDims);
00135 VersorTransform();
00137
00139 ~VersorTransform(){};
00140
00143 virtual void SetRotationMatrix(const MatrixType & matrix)
00144 { this->Superclass::SetRotationMatrix( matrix ); }
00145
00146 void SetVarVersor(const VersorType & newVersor)
00147 { m_Versor = newVersor; }
00148
00150 void PrintSelf(std::ostream &os, Indent indent) const;
00151
00154 void ComputeMatrix(void);
00155 void ComputeMatrixParameters(void);
00157
00158 private:
00160 VersorTransform(const Self & other);
00161
00163 const Self & operator=( const Self & );
00164
00166 VersorType m_Versor;
00167
00168 };
00169
00170
00171 }
00172
00173
00174 #define ITK_TEMPLATE_VersorTransform(_, EXPORT, x, y) namespace itk { \
00175 _(1(class EXPORT VersorTransform< ITK_TEMPLATE_1 x >)) \
00176 namespace Templates { typedef VersorTransform< ITK_TEMPLATE_1 x > VersorTransform##y; } \
00177 }
00178
00179 #if ITK_TEMPLATE_EXPLICIT
00180 # include "Templates/itkVersorTransform+-.h"
00181 #endif
00182
00183 #if ITK_TEMPLATE_TXX
00184 # include "itkVersorTransform.txx"
00185 #endif
00186
00187 #endif
00188