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

itkRigid3DTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRigid3DTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/02/01 04:42:27 $
00007   Version:   $Revision: 1.25 $
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 __itkRigid3DTransform_h
00018 #define __itkRigid3DTransform_h
00019 
00020 #include <iostream>
00021 #include "itkTransform.h"
00022 #include "itkExceptionObject.h"
00023 #include "vnl/vnl_quaternion.h"
00024 #include "itkMatrix.h"
00025 #include "itkVersor.h"
00026 
00027 namespace itk
00028 {
00029 
00036 template < class TScalarType=double >    // Data type for scalars (float or double)
00037 class ITK_EXPORT Rigid3DTransform : 
00038         public Transform< TScalarType, 3, 3> // Dimensions of input and output spaces
00039 {
00040 public:
00042   typedef Rigid3DTransform Self;
00043   typedef Transform< TScalarType, 3, 3 > Superclass;
00044   typedef SmartPointer<Self>        Pointer;
00045   typedef SmartPointer<const Self>  ConstPointer;
00046   
00048   itkTypeMacro( Rigid3DTransform, Transform );
00049 
00051   itkNewMacro( Self );
00052 
00054   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00055   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00056   itkStaticConstMacro(ParametersDimension, unsigned int, 6);
00057 
00059   typedef typename Superclass::ScalarType  ScalarType;
00060 
00062   typedef typename Superclass::ParametersType  ParametersType;
00063 
00065   typedef typename Superclass::JacobianType  JacobianType;
00066 
00068   typedef Matrix<ScalarType, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> MatrixType;
00069 
00071   typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> OffsetType;
00072 
00074   typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputVectorType;
00075   typedef Vector<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVectorType;
00076 
00078   typedef CovariantVector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputCovariantVectorType;
00079   typedef CovariantVector<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputCovariantVectorType;
00080 
00082   typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputVnlVectorType;
00083   typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVnlVectorType;
00084 
00086   typedef Point<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)>    InputPointType;
00087   typedef Point<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)>    OutputPointType;
00088 
00090   typedef vnl_quaternion<TScalarType>           VnlQuaternionType;
00091 
00093   typedef Versor<TScalarType>           VersorType;
00094 
00095 
00102    itkGetConstMacro( Offset, OffsetType );
00103 
00110    itkGetConstMacro( RotationMatrix, MatrixType );
00111 
00112 
00119   itkSetMacro( Offset, OffsetType );
00120 
00121 
00131   void SetRotationMatrix(const MatrixType &matrix);
00132 
00133 
00138   void Compose(const Self *other, bool pre=false);
00139 
00140 
00148   void Translate(const OffsetType &offset, bool pre=false);
00149 
00150 
00158   OutputPointType     TransformPoint(const InputPointType  &point ) const;
00159   OutputVectorType    TransformVector(const InputVectorType &vector) const;
00160   OutputVnlVectorType    TransformVector(const InputVnlVectorType &vector) const;
00161 
00162   OutputCovariantVectorType TransformCovariantVector(
00163                                  const InputCovariantVectorType &vector) const;
00164 
00172   inline InputPointType      BackTransform(const OutputPointType  &point ) const;
00173   inline InputVectorType     BackTransform(const OutputVectorType &vector) const;
00174   inline InputVnlVectorType  BackTransform(const OutputVnlVectorType &vector) const;
00175 
00176   inline InputCovariantVectorType BackTransform(
00177                                      const OutputCovariantVectorType &vector) const;
00178 
00182   void PrintSelf(std::ostream &os, Indent indent) const;
00183 
00191   Pointer Inverse( void ) const;
00192 
00194   void SetIdentity(void);
00195 
00197   virtual const JacobianType & GetJacobian(const InputPointType  &point ) const;
00198 
00199 protected:
00200   Rigid3DTransform();
00201   ~Rigid3DTransform();
00202 
00203   Rigid3DTransform(unsigned int SpaceDimension, unsigned int ParametersDimension);
00204   // matrix representation of the rotation
00205   // Should be protected in order to be modified 
00206   // by derived classes that instantiate an interface
00207   // to rotation computation
00208   MatrixType          m_RotationMatrix;   
00209 
00210   // representation of the inverse rottion
00211   MatrixType          m_InverseMatrix; 
00212 
00213 private:
00214   Rigid3DTransform(const Self&); //purposely not implemented
00215   void operator=(const Self&); //purposely not implemented
00216 
00217   // Offset of the transformation
00218   OffsetType          m_Offset;   
00219 
00220 }; //class Rigid3DTransform
00221 
00222 
00223 }  // namespace itk
00224 
00225 
00226 #ifndef ITK_MANUAL_INSTANTIATION
00227 #include "itkRigid3DTransform.txx"
00228 #endif
00229 
00230 #endif /* __itkRigid3DTransform_h */

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