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: 2009-04-09 09:23:21 $
00007   Version:   $Revision: 1.18 $
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 
00115   typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
00116   typedef typename InverseTransformBaseType::Pointer    InverseTransformBasePointer;
00117 
00119   virtual OutputPointType TransformPoint(const InputPointType  &point ) const
00120     { return point; }
00121 
00123   virtual OutputVectorType TransformVector(const InputVectorType &vector) const
00124     { return vector; }
00125 
00127   virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const
00128     { return vector; }
00129 
00131   virtual OutputCovariantVectorType TransformCovariantVector(
00132     const InputCovariantVectorType &vector) const
00133     { return vector; }
00134 
00139   void SetIdentity( void ) { }
00140 
00141 
00144   virtual void SetParameters(const ParametersType &) {};
00145 
00174   virtual const JacobianType & GetJacobian(const InputPointType  & ) const
00175     { 
00176     return this->m_Jacobian;
00177     }
00178 
00180   virtual InverseTransformBasePointer GetInverseTransform() const
00181     {
00182     return this->New().GetPointer();
00183     }
00184 
00190   virtual bool IsLinear() const { return true; }
00191 
00192 protected:
00193   IdentityTransform():Transform<TScalarType,NDimensions,NDimensions>(NDimensions,1) 
00194     {
00195     // The Jacobian is constant, therefore it can be initialized in the constructor.
00196     this->m_Jacobian = JacobianType(NDimensions,1); 
00197     this->m_Jacobian.Fill(0.0); 
00198     } 
00199   virtual ~IdentityTransform() {}
00200 
00201 private:
00202   IdentityTransform(const Self&); //purposely not implemented
00203   void operator=(const Self&); //purposely not implemented
00204 };
00205 
00206 } // end namespace itk
00207 
00208 #endif
00209 

Generated at Thu May 28 10:14:46 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000