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

itkIdentityTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkIdentityTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/07/18 20:12:24 $
00007   Version:   $Revision: 1.15 $
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 #ifndef __itkIdentityTransform_h
00018 #define __itkIdentityTransform_h
00019 
00020 #include "itkObject.h"
00021 #include "itkPoint.h"
00022 #include "itkVector.h"
00023 #include "itkCovariantVector.h"
00024 #include "vnl/vnl_vector_fixed.h"
00025 #include "itkArray.h"
00026 #include "itkArray2D.h"
00027 #include "itkTransform.h"
00028 
00029 #include "itkObjectFactory.h"
00030 
00031 
00032 namespace itk
00033 {
00034   
00054 template <class TScalarType,
00055           unsigned int NDimensions=3>
00056 class ITK_EXPORT  IdentityTransform  : public Transform<TScalarType,NDimensions,NDimensions>
00057 {
00058 public:
00060   typedef IdentityTransform  Self;
00061   typedef Transform<TScalarType,NDimensions,NDimensions> Superclass;
00062   typedef SmartPointer< Self >   Pointer;
00063   typedef SmartPointer< const Self >  ConstPointer;
00064 
00066   itkNewMacro(Self);
00067 
00069   itkTypeMacro( IdentityTransform, Transform );
00070 
00072   itkStaticConstMacro(InputSpaceDimension, unsigned int, NDimensions);
00073   itkStaticConstMacro(OutputSpaceDimension, unsigned int, NDimensions);
00075 
00077   typedef  TScalarType     ScalarType;
00078 
00080   typedef  typename Superclass::ParametersType                 ParametersType;
00081 
00083   typedef  typename Superclass::JacobianType                   JacobianType;
00084 
00086   typedef Vector<TScalarType,
00087                 itkGetStaticConstMacro(InputSpaceDimension)>  InputVectorType;
00088   typedef Vector<TScalarType,
00089                 itkGetStaticConstMacro(OutputSpaceDimension)> OutputVectorType;
00091 
00093   typedef CovariantVector<TScalarType,
00094                           itkGetStaticConstMacro(InputSpaceDimension)>  InputCovariantVectorType;
00095   typedef CovariantVector<TScalarType,
00096                           itkGetStaticConstMacro(OutputSpaceDimension)> OutputCovariantVectorType;
00098 
00100   typedef vnl_vector_fixed<TScalarType,
00101                            itkGetStaticConstMacro(InputSpaceDimension)>  InputVnlVectorType;
00102   typedef vnl_vector_fixed<TScalarType,
00103                            itkGetStaticConstMacro(OutputSpaceDimension)> OutputVnlVectorType;
00105 
00107   typedef Point<TScalarType,
00108                 itkGetStaticConstMacro(InputSpaceDimension)> InputPointType;
00109   typedef Point<TScalarType,
00110                 itkGetStaticConstMacro(OutputSpaceDimension)> OutputPointType;
00112 
00114   virtual OutputPointType TransformPoint(const InputPointType  &point ) const
00115     { return point; }
00116 
00118   virtual OutputVectorType TransformVector(const InputVectorType &vector) const
00119     { return vector; }
00120 
00122   virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const
00123     { return vector; }
00124 
00126   virtual OutputCovariantVectorType TransformCovariantVector(
00127     const InputCovariantVectorType &vector) const
00128     { return vector; }
00129 
00134   void SetIdentity( void ) { }
00135 
00136 
00139   virtual void SetParameters(const ParametersType &) {};
00140 
00169   virtual const JacobianType & GetJacobian(const InputPointType  & ) const
00170     { 
00171     return this->m_Jacobian;
00172     }
00173 
00179   virtual bool IsLinear() const { return true; }
00180 
00181 protected:
00182   IdentityTransform():Transform<TScalarType,NDimensions,NDimensions>(NDimensions,1) 
00183    {
00184    // The Jacobian is constant, therefore it can be initialized in the constructor.
00185    this->m_Jacobian = JacobianType(NDimensions,1); 
00186    this->m_Jacobian.Fill(0.0); 
00187    }; 
00188   virtual ~IdentityTransform() {};
00189 
00190 
00191 private:
00192   IdentityTransform(const Self&); //purposely not implemented
00193   void operator=(const Self&); //purposely not implemented
00194 
00195 
00196 };
00197 
00198 } // end namespace itk
00199 
00200 
00201 #endif
00202 
00203 
00204 
00205 

Generated at Tue Jul 29 20:27:26 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000