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-03-03 15:08:23 $
00007   Version:   $Revision: 1.30 $
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::JacobianType           JacobianType;
00074   typedef typename Superclass::ScalarType             ScalarType;
00075   typedef typename Superclass::InputPointType         InputPointType;
00076   typedef typename Superclass::OutputPointType        OutputPointType;
00077   typedef typename Superclass::InputVectorType        InputVectorType;
00078   typedef typename Superclass::OutputVectorType       OutputVectorType;
00079   typedef typename Superclass::InputVnlVectorType     InputVnlVectorType;
00080   typedef typename Superclass::OutputVnlVectorType    OutputVnlVectorType;
00081   typedef typename Superclass::InputCovariantVectorType 
00082                                                       InputCovariantVectorType;
00083   typedef typename Superclass::OutputCovariantVectorType
00084                                                       OutputCovariantVectorType;
00085   typedef typename Superclass::MatrixType             MatrixType;
00086   typedef typename Superclass::InverseMatrixType      InverseMatrixType;
00087   typedef typename Superclass::CenterType             CenterType;
00088   typedef typename Superclass::OffsetType             OffsetType;
00089   typedef typename Superclass::TranslationType        TranslationType;
00090 
00091 
00093   typedef vnl_quaternion<TScalarType>           VnlQuaternionType;
00094 
00100   void SetRotation(const VnlQuaternionType &rotation);
00101 
00105   const VnlQuaternionType & GetRotation(void) const
00106     { return m_Rotation; }
00107 
00109   virtual void SetIdentity(void);
00110 
00116   void SetParameters( const ParametersType & parameters );
00117   virtual const ParametersType & GetParameters() const;
00119 
00125   const JacobianType & GetJacobian(const InputPointType  &point ) const;
00126 
00127 protected:
00128   QuaternionRigidTransform(const MatrixType &matrix,
00129                            const OutputVectorType &offset);
00130   QuaternionRigidTransform(unsigned int outputDims,
00131                            unsigned int paramDims);
00132   QuaternionRigidTransform();
00133   ~QuaternionRigidTransform(){};
00134 
00135   void ComputeMatrix();
00136 
00137   void ComputeMatrixParameters();
00138 
00139   void SetVarRotation(const VnlQuaternionType & rotation)
00140     { m_Rotation = rotation; }
00141 
00142   const InverseMatrixType & GetInverseMatrix( void ) const;
00143 
00144   void PrintSelf(std::ostream &os, Indent indent) const;
00145 
00146 private:
00147   QuaternionRigidTransform(const Self&); //purposely not implemented
00148   void operator=(const Self&); //purposely not implemented
00149 
00151   VnlQuaternionType   m_Rotation;
00152 
00153 }; //class QuaternionRigidTransform
00154 
00155 
00156 }  // namespace itk
00157 
00158 // Define instantiation macro for this template.
00159 #define ITK_TEMPLATE_QuaternionRigidTransform(_, EXPORT, x, y) namespace itk { \
00160   _(1(class EXPORT QuaternionRigidTransform< ITK_TEMPLATE_1 x >)) \
00161   namespace Templates { typedef QuaternionRigidTransform< ITK_TEMPLATE_1 x > \
00162                                                   QuaternionRigidTransform##y; } \
00163   }
00164 
00165 #if ITK_TEMPLATE_EXPLICIT
00166 # include "Templates/itkQuaternionRigidTransform+-.h"
00167 #endif
00168 
00169 #if ITK_TEMPLATE_TXX
00170 # include "itkQuaternionRigidTransform.txx"
00171 #endif
00172 
00173 #endif /* __itkQuaternionRigidTransform_h */
00174 

Generated at Tue Sep 15 04:30:09 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000