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 __itkAdvancedVersorTransform_h
00019 #define __itkAdvancedVersorTransform_h
00020
00021 #include <iostream>
00022 #include "itkAdvancedRigid3DTransform.h"
00023 #include "vnl/vnl_quaternion.h"
00024 #include "itkVersor.h"
00025
00026 namespace itk
00027 {
00028
00050 template < class TScalarType=double >
00051 class ITK_EXPORT AdvancedVersorTransform : public AdvancedRigid3DTransform< TScalarType >
00052 {
00053 public:
00054
00056 typedef AdvancedVersorTransform Self;
00057 typedef AdvancedRigid3DTransform< TScalarType > Superclass;
00058 typedef SmartPointer<Self> Pointer;
00059 typedef SmartPointer<const Self> ConstPointer;
00060
00062 itkTypeMacro( AdvancedVersorTransform, AdvancedRigid3DTransform );
00063
00065 itkNewMacro( Self );
00066
00068 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00069 itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00070 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00071 itkStaticConstMacro(ParametersDimension, unsigned int, 3);
00072
00074 typedef typename Superclass::ParametersType ParametersType;
00075 typedef typename Superclass::JacobianType JacobianType;
00076 typedef typename Superclass::ScalarType ScalarType;
00077 typedef typename Superclass::InputPointType InputPointType;
00078 typedef typename Superclass::OutputPointType OutputPointType;
00079 typedef typename Superclass::InputVectorType InputVectorType;
00080 typedef typename Superclass::OutputVectorType OutputVectorType;
00081 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00082 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00083 typedef typename Superclass::InputCovariantVectorType
00084 InputCovariantVectorType;
00085 typedef typename Superclass::OutputCovariantVectorType
00086 OutputCovariantVectorType;
00087 typedef typename Superclass::MatrixType MatrixType;
00088 typedef typename Superclass::InverseMatrixType InverseMatrixType;
00089 typedef typename Superclass::CenterType CenterType;
00090 typedef typename Superclass::OffsetType OffsetType;
00091
00092 typedef typename Superclass
00093 ::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
00094 typedef typename Superclass::SpatialJacobianType SpatialJacobianType;
00095 typedef typename Superclass
00096 ::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType;
00097 typedef typename Superclass::SpatialHessianType SpatialHessianType;
00098 typedef typename Superclass
00099 ::JacobianOfSpatialHessianType JacobianOfSpatialHessianType;
00100 typedef typename Superclass::InternalMatrixType InternalMatrixType;
00101
00103 typedef vnl_quaternion<TScalarType> VnlQuaternionType;
00104
00106 typedef Versor<TScalarType> VersorType;
00107 typedef typename VersorType::VectorType AxisType;
00108 typedef typename VersorType::ValueType AngleType;
00109
00118 void SetParameters( const ParametersType & parameters );
00119
00121 const ParametersType& GetParameters(void) const;
00122
00124 void SetRotation( const VersorType & versor );
00125 void SetRotation( const AxisType & axis, AngleType angle );
00126 itkGetConstReferenceMacro(Versor, VersorType);
00127
00129 virtual void SetIdentity(void);
00130
00132 virtual void GetJacobian(
00133 const InputPointType &,
00134 JacobianType &,
00135 NonZeroJacobianIndicesType & ) const;
00136
00137 protected:
00138
00140 AdvancedVersorTransform(const MatrixType &matrix,
00141 const OutputVectorType &offset);
00142 AdvancedVersorTransform(unsigned int outputDims,
00143 unsigned int paramDims);
00144 AdvancedVersorTransform();
00145
00147 ~AdvancedVersorTransform(){};
00148
00151 virtual void SetRotationMatrix(const MatrixType & matrix)
00152 { this->Superclass::SetRotationMatrix( matrix ); }
00153
00154 void SetVarVersor(const VersorType & newVersor)
00155 { m_Versor = newVersor; }
00156
00158 void PrintSelf(std::ostream &os, Indent indent) const;
00159
00162 void ComputeMatrix(void);
00163 void ComputeMatrixParameters(void);
00164
00165 private:
00167 AdvancedVersorTransform(const Self & other);
00168
00170 const Self & operator=( const Self & );
00171
00173 VersorType m_Versor;
00174
00175 };
00176
00177
00178 }
00179
00180
00181 #define ITK_TEMPLATE_AdvancedVersorTransform(_, EXPORT, x, y) namespace itk { \
00182 _(1(class EXPORT AdvancedVersorTransform< ITK_TEMPLATE_1 x >)) \
00183 namespace Templates { typedef AdvancedVersorTransform< ITK_TEMPLATE_1 x > AdvancedVersorTransform##y; } \
00184 }
00185
00186 #if ITK_TEMPLATE_EXPLICIT
00187 # include "Templates/itkAdvancedVersorTransform+-.h"
00188 #endif
00189
00190 #if ITK_TEMPLATE_TXX
00191 # include "itkAdvancedVersorTransform.txx"
00192 #endif
00193
00194 #endif