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: 2009-11-28 15:58:04 $
00007   Version:   $Revision: 1.43 $
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 
00049 template < class TScalarType=double >    // type for scalars (float or double)
00050 class ITK_EXPORT Rigid3DTransform :
00051    public MatrixOffsetTransformBase< TScalarType, 3, 3> 
00052 {
00053 public:
00055   typedef Rigid3DTransform                                 Self;
00056   typedef MatrixOffsetTransformBase< TScalarType, 3, 3 >   Superclass;
00057   typedef SmartPointer<Self>                               Pointer;
00058   typedef SmartPointer<const Self>                         ConstPointer;
00059 
00061   itkTypeMacro( Rigid3DTransform, MatrixOffsetTransformBase );
00062 
00064   itkNewMacro( Self );
00065 
00067   itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00068   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00069   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00070   itkStaticConstMacro(ParametersDimension, unsigned int, 12);
00072 
00073   typedef typename Superclass::ParametersType             ParametersType;
00074   typedef typename Superclass::ParametersValueType        ParametersValueType;
00075   typedef typename Superclass::JacobianType               JacobianType;
00076   typedef typename Superclass::ScalarType                 ScalarType;
00077   typedef typename Superclass::InputVectorType            InputVectorType;
00078   typedef typename Superclass::OutputVectorType           OutputVectorType;
00079   typedef typename Superclass::OutputVectorValueType      OutputVectorValueType;
00080   typedef typename Superclass::InputCovariantVectorType  
00081                                                           InputCovariantVectorType;
00082   typedef typename Superclass::OutputCovariantVectorType  
00083                                                           OutputCovariantVectorType;
00084   typedef typename Superclass::InputVnlVectorType         InputVnlVectorType;
00085   typedef typename Superclass::OutputVnlVectorType        OutputVnlVectorType;
00086   typedef typename Superclass::InputPointType             InputPointType;
00087   typedef typename Superclass::OutputPointType            OutputPointType;
00088   typedef typename Superclass::MatrixType                 MatrixType;
00089   typedef typename Superclass::InverseMatrixType          InverseMatrixType;
00090   typedef typename Superclass::MatrixValueType            MatrixValueType;
00091   typedef typename Superclass::CenterType                 CenterType;
00092   typedef typename Superclass::TranslationType            TranslationType;
00093   typedef typename Superclass::OffsetType                 OffsetType;
00094 
00097   typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
00098   typedef typename InverseTransformBaseType::Pointer    InverseTransformBasePointer;
00099 
00110    virtual void SetParameters( const ParametersType & parameters );
00111 
00117   virtual void SetMatrix(const MatrixType &matrix);
00118 
00127   const MatrixType & GetRotationMatrix()
00128     { return this->GetMatrix(); }
00129 
00140   virtual void SetRotationMatrix(const MatrixType & matrix)
00141       { this->SetMatrix(matrix); }
00142 
00150   void Translate(const OffsetType & offset, bool pre=false);
00151 
00153   bool GetInverse(Self* inverse) const;
00154 
00156   virtual InverseTransformBasePointer GetInverseTransform() const;
00157 
00169   InputPointType      BackTransform(const OutputPointType 
00170                                                    &point ) const;
00171   InputVectorType     BackTransform(const OutputVectorType 
00172                                                    &vector) const;
00173   InputVnlVectorType  BackTransform( const OutputVnlVectorType
00174                                                    &vector) const;
00175   InputCovariantVectorType BackTransform(const OutputCovariantVectorType
00176                                                    &vector) const;
00178 
00183   bool MatrixIsOrthogonal( const MatrixType & matrix, double tol = 1e-10 );
00184 
00185 protected:
00186   Rigid3DTransform(unsigned int spaceDim,
00187                    unsigned int paramDim);
00188   Rigid3DTransform(const MatrixType & matrix,
00189                    const OutputVectorType & offset);
00190   Rigid3DTransform();
00191   ~Rigid3DTransform();
00192   
00196   void PrintSelf(std::ostream &os, Indent indent) const;
00197 
00198 private:
00199   Rigid3DTransform(const Self&); //purposely not implemented
00200   void operator=(const Self&); //purposely not implemented
00201   
00202 }; //class Rigid3DTransform
00203 
00204 
00205 }  // namespace itk
00206 
00207 // Define instantiation macro for this template.
00208 #define ITK_TEMPLATE_Rigid3DTransform(_, EXPORT, x, y) namespace itk { \
00209   _(1(class EXPORT Rigid3DTransform< ITK_TEMPLATE_1 x >)) \
00210   namespace Templates { typedef Rigid3DTransform< ITK_TEMPLATE_1 x > Rigid3DTransform##y; } \
00211   }
00212 
00213 #if ITK_TEMPLATE_EXPLICIT
00214 # include "Templates/itkRigid3DTransform+-.h"
00215 #endif
00216 
00217 #if ITK_TEMPLATE_TXX
00218 # include "itkRigid3DTransform.txx"
00219 #endif
00220 
00221 #endif /* __itkRigid3DTransform_h */
00222 

Generated at Fri Apr 16 19:31:03 2010 for ITK by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2000