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: 2007/01/30 20:56:09 $
00007   Version:   $Revision: 1.29 $
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 
00046 template < class TScalarType=double >    // Data type for scalars (float or double)
00047 class ITK_EXPORT QuaternionRigidTransform :
00048         public Rigid3DTransform< TScalarType > 
00049 {
00050 public:
00052   typedef QuaternionRigidTransform            Self;
00053   typedef Rigid3DTransform< TScalarType >     Superclass;
00054   typedef SmartPointer<Self>                  Pointer;
00055   typedef SmartPointer<const Self>            ConstPointer;
00056 
00058   itkNewMacro( Self );
00059 
00061   itkTypeMacro( QuaternionRigidTransform, Rigid3DTransform );
00062 
00064   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00065   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00066   itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00067   itkStaticConstMacro(ParametersDimension, unsigned int, 7);
00069 
00071   typedef typename Superclass::ParametersType         ParametersType;
00072   typedef typename Superclass::JacobianType           JacobianType;
00073   typedef typename Superclass::ScalarType             ScalarType;
00074   typedef typename Superclass::InputPointType         InputPointType;
00075   typedef typename Superclass::OutputPointType        OutputPointType;
00076   typedef typename Superclass::InputVectorType        InputVectorType;
00077   typedef typename Superclass::OutputVectorType       OutputVectorType;
00078   typedef typename Superclass::InputVnlVectorType     InputVnlVectorType;
00079   typedef typename Superclass::OutputVnlVectorType    OutputVnlVectorType;
00080   typedef typename Superclass::InputCovariantVectorType 
00081                                                       InputCovariantVectorType;
00082   typedef typename Superclass::OutputCovariantVectorType      
00083                                                       OutputCovariantVectorType;
00084   typedef typename Superclass::MatrixType             MatrixType;
00085   typedef typename Superclass::InverseMatrixType      InverseMatrixType;
00086   typedef typename Superclass::CenterType             CenterType;
00087   typedef typename Superclass::OffsetType             OffsetType;
00088   typedef typename Superclass::TranslationType        TranslationType;
00089 
00090 
00092   typedef vnl_quaternion<TScalarType>           VnlQuaternionType;
00093 
00099   void SetRotation(const VnlQuaternionType &rotation);
00100 
00104   const VnlQuaternionType & GetRotation(void) const
00105     { return m_Rotation; }
00106 
00108   virtual void SetIdentity(void);
00109 
00115   void SetParameters( const ParametersType & parameters );
00116   virtual const ParametersType & GetParameters() const;
00118 
00124   const JacobianType & GetJacobian(const InputPointType  &point ) const;
00125 
00126 protected:
00127   QuaternionRigidTransform(const MatrixType &matrix,
00128                            const OutputVectorType &offset);
00129   QuaternionRigidTransform(unsigned int outputDims,
00130                            unsigned int paramDims);
00131   QuaternionRigidTransform();
00132   ~QuaternionRigidTransform(){};
00133 
00134   void ComputeMatrix();
00135 
00136   void ComputeMatrixParameters();
00137 
00138   void SetVarRotation(const VnlQuaternionType & rotation)
00139     { m_Rotation = rotation; };
00140 
00141   const InverseMatrixType & GetInverseMatrix( void ) const;
00142 
00143   void PrintSelf(std::ostream &os, Indent indent) const;
00144 
00145 private:
00146   QuaternionRigidTransform(const Self&); //purposely not implemented
00147   void operator=(const Self&); //purposely not implemented
00148 
00150   VnlQuaternionType   m_Rotation;
00151 
00152 }; //class QuaternionRigidTransform
00153 
00154 
00155 }  // namespace itk
00156 
00157 // Define instantiation macro for this template.
00158 #define ITK_TEMPLATE_QuaternionRigidTransform(_, EXPORT, x, y) namespace itk { \
00159   _(1(class EXPORT QuaternionRigidTransform< ITK_TEMPLATE_1 x >)) \
00160   namespace Templates { typedef QuaternionRigidTransform< ITK_TEMPLATE_1 x > \
00161                                                   QuaternionRigidTransform##y; } \
00162   }
00163 
00164 #if ITK_TEMPLATE_EXPLICIT
00165 # include "Templates/itkQuaternionRigidTransform+-.h"
00166 #endif
00167 
00168 #if ITK_TEMPLATE_TXX
00169 # include "itkQuaternionRigidTransform.txx"
00170 #endif
00171 
00172 #endif /* __itkQuaternionRigidTransform_h */
00173 

Generated at Wed Nov 5 23:46:23 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000