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: 2003/09/10 14:29:25 $
00007   Version:   $Revision: 1.20 $
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 
00036 template <
00037     class TScalarType=float, // Type for cordinate representation type (float or double)
00038     unsigned int NDimensions=3  >  // Number of dimensions
00039 class ITK_EXPORT ScaleTransform : public Transform< TScalarType, 
00040                                          NDimensions,
00041                                          NDimensions >
00042 {
00043 public:
00045   typedef ScaleTransform Self;
00046   typedef Transform< TScalarType, NDimensions, NDimensions >  Superclass;
00047   typedef SmartPointer<Self>        Pointer;
00048   typedef SmartPointer<const Self>  ConstPointer;
00049   
00051   itkNewMacro( Self );
00052 
00054   itkTypeMacro( ScaleTransform, Transform );
00055 
00057   itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
00058   itkStaticConstMacro(ParametersDimension, unsigned int, NDimensions);
00059 
00061   typedef typename Superclass::ScalarType  ScalarType;
00062 
00064   typedef typename Superclass::ParametersType  ParametersType;
00065 
00067   typedef typename Superclass::JacobianType  JacobianType;
00068 
00070   typedef FixedArray<TScalarType, itkGetStaticConstMacro(SpaceDimension)> ScaleType;
00071 
00073   typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVectorType;
00074   typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVectorType;
00075   
00077   typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputCovariantVectorType;
00078   typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputCovariantVectorType;
00079   
00081   typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVnlVectorType;
00082   typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVnlVectorType;
00083   
00085   typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputPointType;
00086   typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputPointType;
00087   
00091   void SetParameters(const ParametersType & parameters);
00092 
00095   const ParametersType & GetParameters( void ) const;
00096 
00098   const JacobianType & GetJacobian( const InputPointType & point ) const;
00099 
00105   void SetScale( const ScaleType & scale )
00106     { this->Modified(); m_Scale = scale; }
00107 
00109   void Compose(const Self * other, bool pre=false);
00110 
00115   void Scale(const ScaleType & scale, bool pre=false );
00116 
00121   OutputPointType     TransformPoint(const InputPointType  &point ) const;
00122   OutputVectorType    TransformVector(const InputVectorType &vector) const;
00123   OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const;
00124   OutputCovariantVectorType TransformCovariantVector(
00125                                  const InputCovariantVectorType &vector) const;
00126   
00131   inline InputPointType     BackTransform(const OutputPointType  &point ) const;
00132   inline InputVectorType    BackTransform(const OutputVectorType &vector) const;
00133   inline InputVnlVectorType BackTransform(const OutputVnlVectorType &vector) const;
00134   inline InputCovariantVectorType BackTransform(
00135                                      const OutputCovariantVectorType &vector) const;
00136     
00141   typename ScaleTransform::Pointer Inverse(void) const;
00142 
00146   void SetIdentity( void )
00147     { m_Scale.Fill( 1.0 ); }
00148 
00149 
00151   itkSetMacro( Center, InputPointType );
00152   itkGetConstMacro( Center, InputPointType );
00153 
00154 
00156   itkGetConstMacro( Scale, ScaleType );
00157 
00158 
00159 protected:
00161   ScaleTransform();
00162 
00164   ~ScaleTransform();
00165 
00167   void PrintSelf(std::ostream &os, Indent indent) const;
00168 
00169   
00170 private:
00171   ScaleTransform(const Self & other); //purposely not implemented
00172   const Self & operator=( const Self & ); //purposely not implemented
00173 
00174   ScaleType   m_Scale;  // Scales of the transformation
00175 
00176   InputPointType   m_Center; // Scaling center
00177 
00178 }; //class ScaleTransform
00179 
00180 }  // namespace itk
00181 
00182 
00183 #ifndef ITK_MANUAL_INSTANTIATION
00184 #include "itkScaleTransform.txx"
00185 #endif
00186 
00187 #endif /* __itkScaleTransform_h */

Generated at Tue Sep 16 11:32:08 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000