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

itkScalableAffineTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkScalableAffineTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/01/30 20:56:09 $
00007   Version:   $Revision: 1.3 $
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 __itkScalableAffineTransform_h
00019 #define __itkScalableAffineTransform_h
00020 
00021 #include "itkAffineTransform.h"
00022 
00023 namespace itk
00024 {
00025 
00026 
00038 template <
00039  class TScalarType=double,      // Data type for scalars (e.g. float or double)
00040  unsigned int NDimensions=3>    // Number of dimensions in the input space
00041 class ITK_EXPORT ScalableAffineTransform 
00042 : public AffineTransform< TScalarType, NDimensions >
00043 {
00044 public:
00046   typedef ScalableAffineTransform                      Self;
00047   typedef AffineTransform< TScalarType, NDimensions >  Superclass;
00048   typedef SmartPointer<Self>                           Pointer;
00049   typedef SmartPointer<const Self>                     ConstPointer;
00050 
00052   itkTypeMacro( ScalableAffineTransform, AffineTransform );
00053 
00055   itkNewMacro( Self );
00056 
00058   itkStaticConstMacro(InputSpaceDimension, unsigned int, NDimensions);
00059   itkStaticConstMacro(OutputSpaceDimension, unsigned int, NDimensions);
00060   itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
00061   itkStaticConstMacro(ParametersDimension, unsigned int,
00062                       NDimensions*(NDimensions+1));
00064 
00066   typedef typename Superclass::ParametersType            ParametersType;
00067   typedef typename Superclass::JacobianType              JacobianType;
00068   typedef typename Superclass::ScalarType                ScalarType;
00069   typedef typename Superclass::InputVectorType           InputVectorType;
00070   typedef typename Superclass::OutputVectorType          OutputVectorType;
00071   typedef typename Superclass::InputCovariantVectorType     
00072                                                      InputCovariantVectorType;
00073   typedef typename Superclass::OutputCovariantVectorType    
00074                                                      OutputCovariantVectorType;
00075   typedef typename Superclass::InputVnlVectorType        InputVnlVectorType;
00076   typedef typename Superclass::OutputVnlVectorType       OutputVnlVectorType;
00077   typedef typename Superclass::InputPointType            InputPointType;
00078   typedef typename Superclass::OutputPointType           OutputPointType;
00079   typedef typename Superclass::MatrixType                MatrixType;
00080   typedef typename Superclass::InverseMatrixType         InverseMatrixType;
00081   typedef typename Superclass::CenterType                CenterType;
00082   typedef typename Superclass::OffsetType                OffsetType;
00083   typedef typename Superclass::TranslationType           TranslationType;
00084 
00088   void SetIdentity( void );
00089 
00091   virtual void SetScale( const InputVectorType & scale );
00092   virtual void SetScaleComponent( const InputVectorType & scale )
00093     { this->SetScale(scale); };
00095 
00097   virtual void SetScale( const double scale[NDimensions] );
00098   virtual void SetScaleComponent( const double scale[NDimensions] )
00099     { this->SetScale(scale); };
00101 
00103   virtual const double * GetScale() const 
00104     { return m_Scale; };
00105   virtual const double * GetScaleComponent() const 
00106     { return m_Scale; };
00108 
00113   void SetMatrixComponent(const MatrixType &matrix)
00114     { this->SetMatrix( matrix ); };
00115 
00119   const MatrixType & GetMatrixComponent() const 
00120     { return this->GetMatrix(); }
00121 
00125   void SetOffsetComponent(const OffsetType &offset)
00126     { this->SetTranslation( offset ); };
00127 
00131   const OffsetType & GetOffsetComponent(void) const 
00132     { return this->GetTranslation(); }
00133 
00134 
00135 protected:
00143   ScalableAffineTransform(const MatrixType &matrix,
00144                           const OutputVectorType &offset);
00145   ScalableAffineTransform(unsigned int outputSpaceDimension,
00146                           unsigned int parametersDimension);
00147   ScalableAffineTransform();      
00149 
00150   void ComputeMatrix();
00151 
00153   virtual ~ScalableAffineTransform();
00154 
00156   void PrintSelf(std::ostream &s, Indent indent) const;
00157 
00158   void SetVarScale(const double * scale)
00159     { for(int i=0; i<InputSpaceDimension; i++) { m_Scale[i] = scale[i]; } };
00160 
00161 private:
00162 
00163   ScalableAffineTransform(const Self & other);
00164   const Self & operator=( const Self & );
00165   
00166   double               m_Scale[NDimensions];
00167   InputVectorType      m_MatrixScale;
00168 
00169 }; //class ScalableAffineTransform
00170   
00171 }  // namespace itk
00172 
00173 // Define instantiation macro for this template.
00174 #define ITK_TEMPLATE_ScalableAffineTransform(_, EXPORT, x, y) namespace itk { \
00175   _(2(class EXPORT ScalableAffineTransform< ITK_TEMPLATE_2 x >)) \
00176   namespace Templates { typedef ScalableAffineTransform< ITK_TEMPLATE_2 x > \
00177                                                   ScalableAffineTransform##y; } \
00178   }
00179 
00180 #if ITK_TEMPLATE_EXPLICIT
00181 # include "Templates/itkScalableAffineTransform+-.h"
00182 #endif
00183 
00184 #if ITK_TEMPLATE_TXX
00185 # include "itkScalableAffineTransform.txx"
00186 #endif
00187 
00188 #endif /* __itkScalableAffineTransform_h */
00189 
00190 

Generated at Tue Jul 29 22:06:24 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000