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

itkQuaternionRigidTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkQuaternionRigidTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-11-29 01:38:00 $
00007   Version:   $Revision: 1.32 $
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 __itkQuaternionRigidTransform_h
00018 #define __itkQuaternionRigidTransform_h
00019 
00020 #include <iostream>
00021 #include "itkRigid3DTransform.h"
00022 #include "vnl/vnl_quaternion.h"
00023 
00024 namespace itk
00025 {
00026 
00047 template < class TScalarType=double >    // Data type for scalars (float or double)
00048 class ITK_EXPORT QuaternionRigidTransform :
00049         public Rigid3DTransform< TScalarType > 
00050 {
00051 public:
00053   typedef QuaternionRigidTransform            Self;
00054   typedef Rigid3DTransform< TScalarType >     Superclass;
00055   typedef SmartPointer<Self>                  Pointer;
00056   typedef SmartPointer<const Self>            ConstPointer;
00057 
00059   itkNewMacro( Self );
00060 
00062   itkTypeMacro( QuaternionRigidTransform, Rigid3DTransform );
00063 
00065   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00066   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00067   itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00068   itkStaticConstMacro(ParametersDimension, unsigned int, 7);
00070 
00072   typedef typename Superclass::ParametersType         ParametersType;
00073   typedef typename Superclass::ParametersValueType    ParametersValueType;
00074   typedef typename Superclass::JacobianType           JacobianType;
00075   typedef typename Superclass::ScalarType             ScalarType;
00076   typedef typename Superclass::InputPointType         InputPointType;
00077   typedef typename Superclass::OutputPointType        OutputPointType;
00078   typedef typename Superclass::InputVectorType        InputVectorType;
00079   typedef typename Superclass::OutputVectorType       OutputVectorType;
00080   typedef typename Superclass::OutputVectorValueType  OutputVectorValueType;
00081   typedef typename Superclass::InputVnlVectorType     InputVnlVectorType;
00082   typedef typename Superclass::OutputVnlVectorType    OutputVnlVectorType;
00083   typedef typename Superclass::InputCovariantVectorType 
00084                                                       InputCovariantVectorType;
00085   typedef typename Superclass::OutputCovariantVectorType
00086                                                       OutputCovariantVectorType;
00087   typedef typename Superclass::MatrixType             MatrixType;
00088   typedef typename Superclass::InverseMatrixType      InverseMatrixType;
00089   typedef typename Superclass::CenterType             CenterType;
00090   typedef typename Superclass::OffsetType             OffsetType;
00091   typedef typename Superclass::TranslationType        TranslationType;
00092 
00093 
00095   typedef vnl_quaternion<TScalarType>           VnlQuaternionType;
00096 
00102   void SetRotation(const VnlQuaternionType &rotation);
00103 
00107   const VnlQuaternionType & GetRotation(void) const
00108     { return m_Rotation; }
00109 
00111   virtual void SetIdentity(void);
00112 
00118   void SetParameters( const ParametersType & parameters );
00119   virtual const ParametersType & GetParameters() const;
00121 
00127   const JacobianType & GetJacobian(const InputPointType  &point ) const;
00128 
00129 protected:
00130   QuaternionRigidTransform(const MatrixType &matrix,
00131                            const OutputVectorType &offset);
00132   QuaternionRigidTransform(unsigned int outputDims,
00133                            unsigned int paramDims);
00134   QuaternionRigidTransform();
00135   ~QuaternionRigidTransform(){};
00136 
00137   void ComputeMatrix();
00138 
00139   void ComputeMatrixParameters();
00140 
00141   void SetVarRotation(const VnlQuaternionType & rotation)
00142     { m_Rotation = rotation; }
00143 
00144   const InverseMatrixType & GetInverseMatrix( void ) const;
00145 
00146   void PrintSelf(std::ostream &os, Indent indent) const;
00147 
00148 private:
00149   QuaternionRigidTransform(const Self&); //purposely not implemented
00150   void operator=(const Self&); //purposely not implemented
00151 
00153   VnlQuaternionType   m_Rotation;
00154 
00155 }; //class QuaternionRigidTransform
00156 
00157 
00158 }  // namespace itk
00159 
00160 // Define instantiation macro for this template.
00161 #define ITK_TEMPLATE_QuaternionRigidTransform(_, EXPORT, x, y) namespace itk { \
00162   _(1(class EXPORT QuaternionRigidTransform< ITK_TEMPLATE_1 x >)) \
00163   namespace Templates { typedef QuaternionRigidTransform< ITK_TEMPLATE_1 x > \
00164                                                   QuaternionRigidTransform##y; } \
00165   }
00166 
00167 #if ITK_TEMPLATE_EXPLICIT
00168 # include "Templates/itkQuaternionRigidTransform+-.h"
00169 #endif
00170 
00171 #if ITK_TEMPLATE_TXX
00172 # include "itkQuaternionRigidTransform.txx"
00173 #endif
00174 
00175 #endif /* __itkQuaternionRigidTransform_h */
00176 

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