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

itkAffineTransform.h

Go to the documentation of this file.
00001 /*
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkAffineTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/03/09 16:46:12 $
00007   Version:   $Revision: 1.60 $
00008 
00009   Copyright (c) Insight Software 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 
00018 #ifndef __itkAffineTransform_h
00019 #define __itkAffineTransform_h
00020 
00021 #include <iostream>
00022 
00023 #include "itkMatrix.h"
00024 #include "itkMatrixOffsetTransformBase.h"
00025 #include "itkExceptionObject.h"
00026 #include "itkMacro.h"
00027 
00028 namespace itk
00029 {
00030 
00031 
00104 template <
00105  class TScalarType=double,         // Data type for scalars 
00106                                    //    (e.g. float or double)
00107  unsigned int NDimensions=3>       // Number of dimensions in the input space
00108 class AffineTransform 
00109 : public MatrixOffsetTransformBase< TScalarType, NDimensions, NDimensions >
00110 {
00111 public:
00113   typedef AffineTransform                           Self;
00114   typedef MatrixOffsetTransformBase< TScalarType,
00115                                      NDimensions,
00116                                      NDimensions >  Superclass;
00117   typedef SmartPointer<Self>                        Pointer;
00118   typedef SmartPointer<const Self>                  ConstPointer;
00119   
00121   itkTypeMacro( AffineTransform, MatrixOffsetTransformBase );
00122 
00124   itkNewMacro( Self );
00125 
00127   itkStaticConstMacro(InputSpaceDimension, unsigned int, NDimensions);
00128   itkStaticConstMacro(OutputSpaceDimension, unsigned int, NDimensions);
00129   itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
00130   itkStaticConstMacro(ParametersDimension, unsigned int,
00131                                            NDimensions*(NDimensions+1));
00132 
00133   
00135   typedef typename Superclass::ParametersType         ParametersType;
00136   typedef typename Superclass::JacobianType           JacobianType;
00137   typedef typename Superclass::ScalarType             ScalarType;
00138   typedef typename Superclass::InputPointType         InputPointType;
00139   typedef typename Superclass::OutputPointType        OutputPointType;
00140   typedef typename Superclass::InputVectorType        InputVectorType;
00141   typedef typename Superclass::OutputVectorType       OutputVectorType;
00142   typedef typename Superclass::InputVnlVectorType     InputVnlVectorType;
00143   typedef typename Superclass::OutputVnlVectorType    OutputVnlVectorType;
00144   typedef typename Superclass::InputCovariantVectorType 
00145                                                       InputCovariantVectorType;
00146   typedef typename Superclass::OutputCovariantVectorType      
00147                                                       OutputCovariantVectorType;
00148   typedef typename Superclass::MatrixType             MatrixType;
00149   typedef typename Superclass::InverseMatrixType      InverseMatrixType;
00150   typedef typename Superclass::CenterType             CenterType;
00151   typedef typename Superclass::OffsetType             OffsetType;
00152   typedef typename Superclass::TranslationType        TranslationType;
00153 
00160   void Translate(const OutputVectorType &offset, bool pre=0);
00161 
00173   void Scale(const OutputVectorType &factor, bool pre=0);
00174   void Scale(const TScalarType &factor, bool pre=0);
00175 
00191   void Rotate(int axis1, int axis2, TScalarType angle, bool pre=0);
00192 
00206   void Rotate2D(TScalarType angle, bool pre=0);
00207 
00221   void Rotate3D(const OutputVectorType &axis, TScalarType angle, bool pre=0);
00222 
00234   void Shear(int axis1, int axis2, TScalarType coef, bool pre=0);
00235 
00244   inline InputPointType   BackTransform(const OutputPointType  &point ) const;
00245   inline InputVectorType  BackTransform(const OutputVectorType &vector) const;
00246   inline InputVnlVectorType BackTransform(
00247                                      const OutputVnlVectorType &vector) const;
00248   inline InputCovariantVectorType BackTransform(
00249                               const OutputCovariantVectorType &vector) const;
00250 
00260   InputPointType  BackTransformPoint(const OutputPointType  &point) const;
00261 
00273   ScalarType Metric(const Self * other) const;
00274 
00278   ScalarType Metric(void) const;
00279 
00280 protected:
00288   AffineTransform(const MatrixType &matrix,
00289                   const OutputVectorType &offset);
00290   AffineTransform(unsigned int outputDims,
00291                   unsigned int paramDims);
00292   AffineTransform();      
00293   
00295   virtual ~AffineTransform();
00296 
00298   void PrintSelf(std::ostream &s, Indent indent) const;
00299 
00300 private:
00301 
00302   AffineTransform(const Self & other);
00303   const Self & operator=( const Self & );
00304 
00305 }; //class AffineTransform
00306 
00307 }  // namespace itk
00308 
00309 
00310 #ifndef ITK_MANUAL_INSTANTIATION
00311 #include "itkAffineTransform.txx"
00312 #endif
00313 
00314 #endif /* __itkAffineTransform_h */
00315 
00316 
00317 
00318 
00319 

Generated at Wed May 24 22:45:36 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000