00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkRigid2DTransform_h
00018 #define __itkRigid2DTransform_h
00019
00020 #include <iostream>
00021 #include "itkTransform.h"
00022 #include "itkExceptionObject.h"
00023 #include "itkMatrix.h"
00024
00025 namespace itk
00026 {
00027
00034 template < class TScalarType=double >
00035 class ITK_EXPORT Rigid2DTransform :
00036 public Transform< TScalarType, 2, 2>
00037 {
00038 public:
00040 typedef Rigid2DTransform Self;
00041 typedef Transform< TScalarType, 2, 2 > Superclass;
00042 typedef SmartPointer<Self> Pointer;
00043 typedef SmartPointer<const Self> ConstPointer;
00044
00046 itkTypeMacro( Rigid2DTransform, Transform );
00047
00049 itkNewMacro( Self );
00050
00052 itkStaticConstMacro(InputSpaceDimension, unsigned int, 2);
00053 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
00054 itkStaticConstMacro(ParametersDimension, unsigned int, 4);
00055
00057 typedef typename Superclass::ScalarType ScalarType;
00058
00060 typedef typename Superclass::ParametersType ParametersType;
00061
00063 typedef typename Superclass::JacobianType JacobianType;
00064
00066 typedef Matrix<ScalarType, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> MatrixType;
00067
00069 typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> OffsetType;
00070
00072 typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputVectorType;
00073 typedef Vector<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVectorType;
00074
00076 typedef CovariantVector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputCovariantVectorType;
00077 typedef CovariantVector<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputCovariantVectorType;
00078
00080 typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputVnlVectorType;
00081 typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVnlVectorType;
00082
00084 typedef Point<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputPointType;
00085 typedef Point<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputPointType;
00086
00093 itkGetConstMacro( Offset, OffsetType );
00094
00101 itkGetConstMacro( RotationMatrix, MatrixType );
00102
00103
00110 itkSetMacro( Offset, OffsetType );
00111
00112
00122 void SetRotationMatrix(const MatrixType &matrix);
00123
00124
00129 void Compose(const Self *other, bool pre=false);
00130
00131
00139 void Translate(const OffsetType &offset, bool pre=false);
00140
00141
00149 OutputPointType TransformPoint(const InputPointType &point ) const;
00150 OutputVectorType TransformVector(const InputVectorType &vector) const;
00151 OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const;
00152
00153 OutputCovariantVectorType TransformCovariantVector(
00154 const InputCovariantVectorType &vector) const;
00155
00163 inline InputPointType BackTransform(const OutputPointType &point ) const;
00164 inline InputVectorType BackTransform(const OutputVectorType &vector) const;
00165 inline InputVnlVectorType BackTransform(const OutputVnlVectorType &vector) const;
00166
00167 inline InputCovariantVectorType BackTransform(
00168 const OutputCovariantVectorType &vector) const;
00169
00173 void PrintSelf(std::ostream &os, Indent indent) const;
00174
00182 Pointer Inverse( void ) const;
00183
00185 virtual void SetIdentity(void);
00186
00188 virtual const JacobianType & GetJacobian(const InputPointType &point ) const;
00189
00190 protected:
00191 Rigid2DTransform();
00192 ~Rigid2DTransform();
00193
00194 Rigid2DTransform(unsigned int outputSpaceDimension, unsigned int parametersDimension);
00195
00196
00197
00198
00199
00200
00201 MatrixType m_RotationMatrix;
00202
00203
00204 MatrixType m_InverseMatrix;
00205
00206 private:
00207 Rigid2DTransform(const Self&);
00208 void operator=(const Self&);
00209
00210
00211 OffsetType m_Offset;
00212
00213 };
00214
00215
00216 }
00217
00218
00219 #ifndef ITK_MANUAL_INSTANTIATION
00220 #include "itkRigid2DTransform.txx"
00221 #endif
00222
00223 #endif