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);
00078 
00080   typedef typename Superclass::ScalarType  ScalarType;
00081 
00083   typedef typename Superclass::ParametersType  ParametersType;
00084 
00086   typedef typename Superclass::JacobianType  JacobianType;
00087 
00089   typedef typename Superclass::MatrixType MatrixType;
00090 
00092   typedef typename Superclass::OffsetType OffsetType;
00093 
00095   typedef typename Superclass::InputVectorType InputVectorType;
00096   typedef typename Superclass::OutputVectorType OutputVectorType;
00097 
00099   typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
00100   typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
00101 
00103   typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00104   typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00105 
00107   typedef typename Superclass::InputPointType    InputPointType;
00108   typedef typename Superclass::OutputPointType    OutputPointType;
00109 
00122   virtual void SetMatrix( const MatrixType & matrix );
00123 
00129   virtual void SetRotationMatrix(const MatrixType &matrix)
00130     { this->SetMatrix( matrix ); }
00131    const MatrixType & GetRotationMatrix() const
00132     { return this->GetMatrix(); }
00134 
00135 
00143   void Translate(const OffsetType &offset, bool pre=false);
00144 
00153   inline InputPointType      BackTransform(const OutputPointType  &point ) const;
00154   inline InputVectorType     BackTransform(const OutputVectorType &vector) const;
00155   inline InputVnlVectorType  BackTransform(const OutputVnlVectorType &vector) const;
00157 
00158   inline InputCovariantVectorType BackTransform(
00159                                      const OutputCovariantVectorType &vector) const;
00160 
00162   void SetAngle(TScalarType angle);
00163   itkGetConstReferenceMacro( Angle, TScalarType );
00165 
00167   void SetAngleInDegrees(TScalarType angle);
00168 
00172   void SetRotation(TScalarType angle)
00173     { this->SetAngle(angle); }
00174   virtual const TScalarType & GetRotation() const
00175     { return m_Angle; }  
00177 
00186   void SetParameters( const ParametersType & parameters );
00187 
00196   const ParametersType & GetParameters( void ) const;
00197 
00202   const JacobianType & GetJacobian(const InputPointType  &point ) const;
00203 
00208   void CloneInverseTo( Pointer & newinverse ) const;
00209 
00214   void CloneTo( Pointer & clone ) const;
00215 
00217   virtual void SetIdentity(void);
00218 
00219 protected:
00220   Rigid2DTransform();
00221   Rigid2DTransform( unsigned int outputSpaceDimension, 
00222                     unsigned int parametersDimension);
00223  
00224  ~Rigid2DTransform();
00225  
00229   void PrintSelf(std::ostream &os, Indent indent) const;
00230 
00234   virtual void ComputeMatrix(void);
00235 
00240   virtual void ComputeMatrixParameters(void);
00241 
00243   void SetVarAngle( TScalarType angle )
00244     { m_Angle = angle; }
00245 
00246 private:
00247   Rigid2DTransform(const Self&); //purposely not implemented
00248   void operator=(const Self&); //purposely not implemented
00249   
00250   TScalarType         m_Angle; 
00251 
00252 }; //class Rigid2DTransform
00253 
00254 
00255 }  // namespace itk
00256 
00257 
00258 #ifndef ITK_MANUAL_INSTANTIATION
00259 #include "itkRigid2DTransform.txx"
00260 #endif
00261 
00262 #endif /* __itkRigid2DTransform_h */
00263 

Generated at Sat Sep 2 21:03:57 2006 for ITK by doxygen 1.4.7 written by Dimitri van Heesch, © 1997-2000