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

itkScaleTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkScaleTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/11/04 20:40:41 $
00007   Version:   $Revision: 1.24 $
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 __itkScaleTransform_h
00019 #define __itkScaleTransform_h
00020 
00021 #include <iostream>
00022 #include "itkTransform.h"
00023 #include "itkExceptionObject.h"
00024 #include "itkMatrix.h"
00025 
00026 namespace itk
00027 {
00028 
00037 template <
00038     class TScalarType=float, // Type for cordinate representation type (float or double)
00039     unsigned int NDimensions=3  >  // Number of dimensions
00040 class ITK_EXPORT ScaleTransform : public Transform< TScalarType, 
00041                                          NDimensions,
00042                                          NDimensions >
00043 {
00044 public:
00046   typedef ScaleTransform Self;
00047   typedef Transform< TScalarType, NDimensions, NDimensions >  Superclass;
00048   typedef SmartPointer<Self>        Pointer;
00049   typedef SmartPointer<const Self>  ConstPointer;
00050 
00052   itkNewMacro( Self );
00053 
00055   itkTypeMacro( ScaleTransform, Transform );
00056 
00058   itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
00059   itkStaticConstMacro(ParametersDimension, unsigned int, NDimensions);
00061 
00063   typedef typename Superclass::ScalarType  ScalarType;
00064 
00066   typedef typename Superclass::ParametersType  ParametersType;
00067 
00069   typedef typename Superclass::JacobianType  JacobianType;
00070 
00072   typedef FixedArray<TScalarType, itkGetStaticConstMacro(SpaceDimension)> ScaleType;
00073 
00075   typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVectorType;
00076   typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVectorType;
00078 
00080   typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputCovariantVectorType;
00081   typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputCovariantVectorType;
00083 
00085   typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVnlVectorType;
00086   typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVnlVectorType;
00088 
00090   typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputPointType;
00091   typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputPointType;
00093 
00098   void SetParameters(const ParametersType & parameters);
00099 
00104   const ParametersType & GetParameters( void ) const;
00105 
00107   const JacobianType & GetJacobian( const InputPointType & point ) const;
00108 
00117   void SetScale( const ScaleType & scale )
00118     { this->Modified(); m_Scale = scale; }
00119 
00121   void Compose(const Self * other, bool pre=false);
00122 
00126   void Scale(const ScaleType & scale, bool pre=false );
00127 
00132   OutputPointType     TransformPoint(const InputPointType  &point ) const;
00133   OutputVectorType    TransformVector(const InputVectorType &vector) const;
00134   OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const;
00135   OutputCovariantVectorType TransformCovariantVector(
00136                                  const InputCovariantVectorType &vector) const;
00138 
00143   inline InputPointType     BackTransform(const OutputPointType  &point ) const;
00144   inline InputVectorType    BackTransform(const OutputVectorType &vector) const;
00145   inline InputVnlVectorType BackTransform(const OutputVnlVectorType &vector) const;
00146   inline InputCovariantVectorType BackTransform(
00147                                      const OutputCovariantVectorType &vector) const;
00149 
00154   bool GetInverse(Self* inverse) const;
00155 
00159   void SetIdentity( void )
00160     { m_Scale.Fill( 1.0 ); }
00161 
00162 
00164   itkSetMacro( Center, InputPointType );
00165   itkGetConstReferenceMacro( Center, InputPointType );
00167 
00168 
00170   itkGetConstReferenceMacro( Scale, ScaleType );
00171 
00172 
00173 protected:
00175   ScaleTransform();
00176 
00178   ~ScaleTransform();
00179 
00181   void PrintSelf(std::ostream &os, Indent indent) const;
00182 
00183   
00184 private:
00185   ScaleTransform(const Self & other); //purposely not implemented
00186   const Self & operator=( const Self & ); //purposely not implemented
00187 
00188   ScaleType   m_Scale;  // Scales of the transformation
00189 
00190   InputPointType   m_Center; // Scaling center
00191 
00192 }; //class ScaleTransform
00193 
00194 }  // namespace itk
00195 
00196 
00197 #ifndef ITK_MANUAL_INSTANTIATION
00198 #include "itkScaleTransform.txx"
00199 #endif
00200 
00201 #endif /* __itkScaleTransform_h */
00202 

Generated at Fri Sep 8 04:03:13 2006 for ITK by doxygen 1.4.7 written by Dimitri van Heesch, © 1997-2000