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-04-09 09:23:21 $
00007   Version:   $Revision: 1.40 $
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::JacobianType               JacobianType;
00075   typedef typename Superclass::ScalarType                 ScalarType;
00076   typedef typename Superclass::InputVectorType            InputVectorType;
00077   typedef typename Superclass::OutputVectorType           OutputVectorType;
00078   typedef typename Superclass::InputCovariantVectorType  
00079                                                           InputCovariantVectorType;
00080   typedef typename Superclass::OutputCovariantVectorType  
00081                                                           OutputCovariantVectorType;
00082   typedef typename Superclass::InputVnlVectorType         InputVnlVectorType;
00083   typedef typename Superclass::OutputVnlVectorType        OutputVnlVectorType;
00084   typedef typename Superclass::InputPointType             InputPointType;
00085   typedef typename Superclass::OutputPointType            OutputPointType;
00086   typedef typename Superclass::MatrixType                 MatrixType;
00087   typedef typename Superclass::InverseMatrixType          InverseMatrixType;
00088   typedef typename Superclass::CenterType                 CenterType;
00089   typedef typename Superclass::TranslationType            TranslationType;
00090   typedef typename Superclass::OffsetType                 OffsetType;
00091 
00094   typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
00095   typedef typename InverseTransformBaseType::Pointer    InverseTransformBasePointer;
00096 
00107    virtual void SetParameters( const ParametersType & parameters );
00108 
00114   virtual void SetMatrix(const MatrixType &matrix);
00115 
00124   const MatrixType & GetRotationMatrix()
00125     { return this->GetMatrix(); }
00126 
00137   virtual void SetRotationMatrix(const MatrixType & matrix)
00138       { this->SetMatrix(matrix); }
00139 
00147   void Translate(const OffsetType & offset, bool pre=false);
00148 
00150   bool GetInverse(Self* inverse) const;
00151 
00153   virtual InverseTransformBasePointer GetInverseTransform() const;
00154 
00166   InputPointType      BackTransform(const OutputPointType 
00167                                                    &point ) const;
00168   InputVectorType     BackTransform(const OutputVectorType 
00169                                                    &vector) const;
00170   InputVnlVectorType  BackTransform( const OutputVnlVectorType
00171                                                    &vector) const;
00172   InputCovariantVectorType BackTransform(const OutputCovariantVectorType
00173                                                    &vector) const;
00175 
00180   bool MatrixIsOrthogonal( const MatrixType & matrix, double tol = 1e-10 );
00181 
00182 protected:
00183   Rigid3DTransform(unsigned int spaceDim,
00184                    unsigned int paramDim);
00185   Rigid3DTransform(const MatrixType & matrix,
00186                    const OutputVectorType & offset);
00187   Rigid3DTransform();
00188   ~Rigid3DTransform();
00189   
00193   void PrintSelf(std::ostream &os, Indent indent) const;
00194 
00195 private:
00196   Rigid3DTransform(const Self&); //purposely not implemented
00197   void operator=(const Self&); //purposely not implemented
00198   
00199 }; //class Rigid3DTransform
00200 
00201 
00202 }  // namespace itk
00203 
00204 // Define instantiation macro for this template.
00205 #define ITK_TEMPLATE_Rigid3DTransform(_, EXPORT, x, y) namespace itk { \
00206   _(1(class EXPORT Rigid3DTransform< ITK_TEMPLATE_1 x >)) \
00207   namespace Templates { typedef Rigid3DTransform< ITK_TEMPLATE_1 x > Rigid3DTransform##y; } \
00208   }
00209 
00210 #if ITK_TEMPLATE_EXPLICIT
00211 # include "Templates/itkRigid3DTransform+-.h"
00212 #endif
00213 
00214 #if ITK_TEMPLATE_TXX
00215 # include "itkRigid3DTransform.txx"
00216 #endif
00217 
00218 #endif /* __itkRigid3DTransform_h */
00219 

Generated at Thu May 28 11:26:03 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000