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

itkRigid3DTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRigid3DTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/02/13 21:46:04 $
00007   Version:   $Revision: 1.38 $
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 __itkRigid3DTransform_h
00018 #define __itkRigid3DTransform_h
00019 
00020 #include <iostream>
00021 #include "itkMatrixOffsetTransformBase.h"
00022 #include "itkExceptionObject.h"
00023 #include "itkMatrix.h"
00024 #include "itkVersor.h"
00025 
00026 namespace itk
00027 {
00028 
00048 template < class TScalarType=double >    // type for scalars (float or double)
00049 class ITK_EXPORT Rigid3DTransform :
00050    public MatrixOffsetTransformBase< TScalarType, 3, 3> 
00051 {
00052 public:
00054   typedef Rigid3DTransform                                 Self;
00055   typedef MatrixOffsetTransformBase< TScalarType, 3, 3 >   Superclass;
00056   typedef SmartPointer<Self>                               Pointer;
00057   typedef SmartPointer<const Self>                         ConstPointer;
00058 
00060   itkTypeMacro( Rigid3DTransform, MatrixOffsetTransformBase );
00061 
00063   itkNewMacro( Self );
00064 
00066   itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00067   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00068   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00069   itkStaticConstMacro(ParametersDimension, unsigned int, 12);
00071 
00072   typedef typename Superclass::ParametersType             ParametersType;
00073   typedef typename Superclass::JacobianType               JacobianType;
00074   typedef typename Superclass::ScalarType                 ScalarType;
00075   typedef typename Superclass::InputVectorType            InputVectorType;
00076   typedef typename Superclass::OutputVectorType           OutputVectorType;
00077   typedef typename Superclass::InputCovariantVectorType  
00078                                                      InputCovariantVectorType;
00079   typedef typename Superclass::OutputCovariantVectorType  
00080                                                      OutputCovariantVectorType;
00081   typedef typename Superclass::InputVnlVectorType         InputVnlVectorType;
00082   typedef typename Superclass::OutputVnlVectorType        OutputVnlVectorType;
00083   typedef typename Superclass::InputPointType             InputPointType;
00084   typedef typename Superclass::OutputPointType            OutputPointType;
00085   typedef typename Superclass::MatrixType                 MatrixType;
00086   typedef typename Superclass::InverseMatrixType          InverseMatrixType;
00087   typedef typename Superclass::CenterType                 CenterType;
00088   typedef typename Superclass::TranslationType            TranslationType;
00089   typedef typename Superclass::OffsetType                 OffsetType;
00090 
00101    virtual void SetParameters( const ParametersType & parameters );
00102 
00108   virtual void SetMatrix(const MatrixType &matrix);
00109 
00118    const MatrixType & GetRotationMatrix()
00119      { return this->GetMatrix(); }
00120 
00131   virtual void SetRotationMatrix(const MatrixType & matrix)
00132       { this->SetMatrix(matrix); }
00133 
00141   void Translate(const OffsetType & offset, bool pre=false);
00142 
00154   InputPointType      BackTransform(const OutputPointType 
00155                                                    &point ) const;
00156   InputVectorType     BackTransform(const OutputVectorType 
00157                                                    &vector) const;
00158   InputVnlVectorType  BackTransform( const OutputVnlVectorType
00159                                                    &vector) const;
00160   InputCovariantVectorType BackTransform(const OutputCovariantVectorType
00161                                                    &vector) const;
00163 
00168   bool MatrixIsOrthogonal( const MatrixType & matrix, double tol = 1e-10 );
00169 
00170 protected:
00171   Rigid3DTransform(unsigned int spaceDim,
00172                    unsigned int paramDim);
00173   Rigid3DTransform(const MatrixType & matrix,
00174                    const OutputVectorType & offset);
00175   Rigid3DTransform();
00176   ~Rigid3DTransform();
00177   
00181   void PrintSelf(std::ostream &os, Indent indent) const;
00182 
00183 private:
00184   Rigid3DTransform(const Self&); //purposely not implemented
00185   void operator=(const Self&); //purposely not implemented
00186   
00187 }; //class Rigid3DTransform
00188 
00189 
00190 }  // namespace itk
00191 
00192 // Define instantiation macro for this template.
00193 #define ITK_TEMPLATE_Rigid3DTransform(_, EXPORT, x, y) namespace itk { \
00194   _(1(class EXPORT Rigid3DTransform< ITK_TEMPLATE_1 x >)) \
00195   namespace Templates { typedef Rigid3DTransform< ITK_TEMPLATE_1 x > Rigid3DTransform##y; } \
00196   }
00197 
00198 #if ITK_TEMPLATE_EXPLICIT
00199 # include "Templates/itkRigid3DTransform+-.h"
00200 #endif
00201 
00202 #if ITK_TEMPLATE_TXX
00203 # include "itkRigid3DTransform.txx"
00204 #endif
00205 
00206 #endif /* __itkRigid3DTransform_h */
00207 

Generated at Sun Sep 23 14:08:34 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000