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

itkRigid2DTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRigid2DTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/08/11 16:44:08 $
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 __itkRigid2DTransform_h
00018 #define __itkRigid2DTransform_h
00019 
00020 #include <iostream>
00021 #include "itkMatrixOffsetTransformBase.h"
00022 #include "itkExceptionObject.h"
00023 
00024 namespace itk
00025 {
00026 
00056 template < class TScalarType=double >    // Data type for scalars (float or double)
00057 class ITK_EXPORT Rigid2DTransform : 
00058         public MatrixOffsetTransformBase< TScalarType, 2, 2> // Dimensions of input and output spaces
00059 {
00060 public:
00062   typedef Rigid2DTransform Self;
00063   typedef MatrixOffsetTransformBase< TScalarType, 2, 2 > Superclass;
00064   typedef SmartPointer<Self>        Pointer;
00065   typedef SmartPointer<const Self>  ConstPointer;
00066   
00068   itkTypeMacro( Rigid2DTransform, MatrixOffsetTransformBase );
00069 
00071   itkNewMacro( Self );
00072 
00074   itkStaticConstMacro(InputSpaceDimension, unsigned int, 2);
00075   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
00076   itkStaticConstMacro(ParametersDimension, unsigned int, 3);
00077 
00079   typedef typename Superclass::ScalarType  ScalarType;
00080 
00082   typedef typename Superclass::ParametersType  ParametersType;
00083 
00085   typedef typename Superclass::JacobianType  JacobianType;
00086 
00088   typedef typename Superclass::MatrixType MatrixType;
00089 
00091   typedef typename Superclass::OffsetType OffsetType;
00092 
00094   typedef typename Superclass::InputVectorType InputVectorType;
00095   typedef typename Superclass::OutputVectorType OutputVectorType;
00096 
00098   typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
00099   typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
00100 
00102   typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00103   typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00104 
00106   typedef typename Superclass::InputPointType    InputPointType;
00107   typedef typename Superclass::OutputPointType    OutputPointType;
00108 
00121   virtual void SetMatrix( const MatrixType & matrix );
00122 
00128   virtual void SetRotationMatrix(const MatrixType &matrix)
00129     { this->SetMatrix( matrix ); }
00130    const MatrixType & GetRotationMatrix() const
00131     { return this->GetMatrix(); }
00132 
00133 
00141   void Translate(const OffsetType &offset, bool pre=false);
00142 
00151   inline InputPointType      BackTransform(const OutputPointType  &point ) const;
00152   inline InputVectorType     BackTransform(const OutputVectorType &vector) const;
00153   inline InputVnlVectorType  BackTransform(const OutputVnlVectorType &vector) const;
00154 
00155   inline InputCovariantVectorType BackTransform(
00156                                      const OutputCovariantVectorType &vector) const;
00157 
00159   void SetAngle(TScalarType angle);
00160   itkGetConstReferenceMacro( Angle, TScalarType );
00161 
00163   void SetAngleInDegrees(TScalarType angle);
00164 
00168   void SetRotation(TScalarType angle)
00169     { this->SetAngle(angle); }
00170   virtual const TScalarType & GetRotation() const
00171     { return m_Angle; }  
00172 
00181   void SetParameters( const ParametersType & parameters );
00182 
00191   const ParametersType & GetParameters( void ) const;
00192   
00197   const JacobianType & GetJacobian(const InputPointType  &point ) const;
00198 
00203   void CloneInverseTo( Pointer & newinverse ) const;
00204 
00209   void CloneTo( Pointer & clone ) const;
00210 
00212   virtual void SetIdentity(void);
00213 
00214 protected:
00215   Rigid2DTransform();
00216   Rigid2DTransform( unsigned int outputSpaceDimension, 
00217                     unsigned int parametersDimension);
00218  
00219  ~Rigid2DTransform();
00220  
00224   void PrintSelf(std::ostream &os, Indent indent) const;
00225 
00229   virtual void ComputeMatrix(void);
00230 
00235   virtual void ComputeMatrixParameters(void);
00236 
00238   void SetVarAngle( TScalarType angle )
00239     { m_Angle = angle; }
00240 
00241 private:
00242   Rigid2DTransform(const Self&); //purposely not implemented
00243   void operator=(const Self&); //purposely not implemented
00244   
00245   TScalarType         m_Angle; 
00246 
00247 }; //class Rigid2DTransform
00248 
00249 
00250 }  // namespace itk
00251 
00252 
00253 #ifndef ITK_MANUAL_INSTANTIATION
00254 #include "itkRigid2DTransform.txx"
00255 #endif
00256 
00257 #endif /* __itkRigid2DTransform_h */

Generated at Wed May 24 23:58:57 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000