Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkRigid2DTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRigid2DTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/11 19:57:13 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkRigid2DTransform_h
00018 #define __itkRigid2DTransform_h
00019 
00020 #include <iostream>
00021 #include "itkTransform.h"
00022 #include "itkExceptionObject.h"
00023 #include "vnl/vnl_quaternion.h"
00024 #include "itkMatrix.h"
00025 
00026 namespace itk
00027 {
00028 
00035 template < class TScalarType=double >    // Data type for scalars (float or double)
00036 class ITK_EXPORT Rigid2DTransform : 
00037         public Transform< TScalarType, 2, 2> // Dimensions of input and output spaces
00038 {
00039 public:
00041   typedef Rigid2DTransform Self;
00042   typedef Transform< TScalarType, 2, 2 > Superclass;
00043   typedef SmartPointer<Self>        Pointer;
00044   typedef SmartPointer<const Self>  ConstPointer;
00045   
00047   itkTypeMacro( Rigid2DTransform, Transform );
00048 
00050   itkNewMacro( Self );
00051 
00053   itkStaticConstMacro(InputSpaceDimension, unsigned int, 2);
00054   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
00055   itkStaticConstMacro(ParametersDimension, unsigned int, 4);
00056 
00058   typedef typename Superclass::ScalarType  ScalarType;
00059 
00061   typedef typename Superclass::ParametersType  ParametersType;
00062 
00064   typedef typename Superclass::JacobianType  JacobianType;
00065 
00067   typedef Matrix<ScalarType, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> MatrixType;
00068 
00070   typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> OffsetType;
00071 
00073   typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputVectorType;
00074   typedef Vector<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVectorType;
00075 
00077   typedef CovariantVector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputCovariantVectorType;
00078   typedef CovariantVector<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputCovariantVectorType;
00079 
00081   typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputVnlVectorType;
00082   typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVnlVectorType;
00083 
00085   typedef Point<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)>    InputPointType;
00086   typedef Point<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)>    OutputPointType;
00087 
00094    itkGetConstMacro( Offset, OffsetType );
00095 
00102    itkGetConstMacro( RotationMatrix, MatrixType );
00103 
00104 
00111   itkSetMacro( Offset, OffsetType );
00112 
00113 
00123   void SetRotationMatrix(const MatrixType &matrix);
00124 
00125 
00130   void Compose(const Self *other, bool pre=false);
00131 
00132 
00140   void Translate(const OffsetType &offset, bool pre=false);
00141 
00142 
00150   OutputPointType     TransformPoint(const InputPointType  &point ) const;
00151   OutputVectorType    TransformVector(const InputVectorType &vector) const;
00152   OutputVnlVectorType    TransformVector(const InputVnlVectorType &vector) const;
00153 
00154   OutputCovariantVectorType TransformCovariantVector(
00155                                  const InputCovariantVectorType &vector) const;
00156 
00164   inline InputPointType      BackTransform(const OutputPointType  &point ) const;
00165   inline InputVectorType     BackTransform(const OutputVectorType &vector) const;
00166   inline InputVnlVectorType  BackTransform(const OutputVnlVectorType &vector) const;
00167 
00168   inline InputCovariantVectorType BackTransform(
00169                                      const OutputCovariantVectorType &vector) const;
00170 
00174   void PrintSelf(std::ostream &os, Indent indent) const;
00175 
00183   Pointer Inverse( void ) const;
00184 
00186   virtual void SetIdentity(void);
00187 
00189   virtual const JacobianType & GetJacobian(const InputPointType  &point ) const;
00190 
00191 protected:
00192   Rigid2DTransform();
00193   ~Rigid2DTransform();
00194 
00195   // matrix representation of the rotation
00196   // Should be protected in order to be modified 
00197   // by derived classes that instantiate an interface
00198   // to rotation computation
00199   MatrixType          m_RotationMatrix;   
00200 
00201   // representation of the inverse rottion
00202   MatrixType          m_InverseMatrix; 
00203 
00204 private:
00205   Rigid2DTransform(const Self&); //purposely not implemented
00206   void operator=(const Self&); //purposely not implemented
00207 
00208   // Offset of the transformation
00209   OffsetType          m_Offset;   
00210 
00211 }; //class Rigid2DTransform
00212 
00213 
00214 }  // namespace itk
00215 
00216 
00217 #ifndef ITK_MANUAL_INSTANTIATION
00218 #include "itkRigid2DTransform.txx"
00219 #endif
00220 
00221 #endif /* __itkRigid2DTransform_h */

Generated at Wed Mar 12 01:13:10 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000