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: 2003/01/13 20:32:44 $
00007   Version:   $Revision: 1.5 $
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 "itkMatrix.h"
00024 
00025 namespace itk
00026 {
00027 
00034 template < class TScalarType=double >    // Data type for scalars (float or double)
00035 class ITK_EXPORT Rigid2DTransform : 
00036         public Transform< TScalarType, 2, 2> // Dimensions of input and output spaces
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   // matrix representation of the rotation
00198   // Should be protected in order to be modified 
00199   // by derived classes that instantiate an interface
00200   // to rotation computation
00201   MatrixType          m_RotationMatrix;   
00202 
00203   // representation of the inverse rottion
00204   MatrixType          m_InverseMatrix; 
00205 
00206 private:
00207   Rigid2DTransform(const Self&); //purposely not implemented
00208   void operator=(const Self&); //purposely not implemented
00209 
00210   // Offset of the transformation
00211   OffsetType          m_Offset;   
00212 
00213 }; //class Rigid2DTransform
00214 
00215 
00216 }  // namespace itk
00217 
00218 
00219 #ifndef ITK_MANUAL_INSTANTIATION
00220 #include "itkRigid2DTransform.txx"
00221 #endif
00222 
00223 #endif /* __itkRigid2DTransform_h */

Generated at Fri May 21 01:15:16 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000