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

itkVersorTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkVersorTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-06-14 12:30:09 $
00007   Version:   $Revision: 1.19 $
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 
00018 #ifndef __itkVersorTransform_h
00019 #define __itkVersorTransform_h
00020 
00021 #include <iostream>
00022 #include "itkRigid3DTransform.h"
00023 #include "vnl/vnl_quaternion.h"
00024 #include "itkVersor.h"
00025 
00026 namespace itk
00027 {
00028 
00048 template < class TScalarType=double >//Data type for scalars (float or double)
00049 class ITK_EXPORT VersorTransform : public Rigid3DTransform< TScalarType > 
00050 {
00051 public:
00052 
00054   typedef VersorTransform                   Self;
00055   typedef Rigid3DTransform< TScalarType >   Superclass;
00056   typedef SmartPointer<Self>                Pointer;
00057   typedef SmartPointer<const Self>          ConstPointer;
00058 
00060   itkTypeMacro( VersorTransform, Rigid3DTransform );
00061 
00063   itkNewMacro( Self );
00064 
00066   itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00067   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00068   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00069   itkStaticConstMacro(ParametersDimension, unsigned int, 3);
00071 
00073   typedef typename Superclass::ParametersType         ParametersType;
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::InputVnlVectorType     InputVnlVectorType;
00081   typedef typename Superclass::OutputVnlVectorType    OutputVnlVectorType;
00082   typedef typename Superclass::InputCovariantVectorType 
00083                                                       InputCovariantVectorType;
00084   typedef typename Superclass::OutputCovariantVectorType
00085                                                       OutputCovariantVectorType;
00086   typedef typename Superclass::MatrixType             MatrixType;
00087   typedef typename Superclass::InverseMatrixType      InverseMatrixType;
00088   typedef typename Superclass::CenterType             CenterType;
00089   typedef typename Superclass::OffsetType             OffsetType;
00090 
00092   typedef vnl_quaternion<TScalarType>                 VnlQuaternionType;
00093 
00095   typedef Versor<TScalarType>                   VersorType;
00096   typedef typename VersorType::VectorType       AxisType;
00097   typedef typename VersorType::ValueType        AngleType;
00098 
00107   void SetParameters( const ParametersType & parameters );
00108 
00110   const ParametersType& GetParameters(void) const;
00111 
00113   void SetRotation( const VersorType & versor );
00114   void SetRotation( const AxisType & axis, AngleType angle );
00115   itkGetConstReferenceMacro(Versor, VersorType);
00117 
00119   virtual void SetIdentity(void);
00120 
00126   const JacobianType & GetJacobian(const InputPointType  &point ) const;
00127 
00128 protected:
00129 
00131   VersorTransform(const MatrixType &matrix,
00132                   const OutputVectorType &offset);
00133   VersorTransform(unsigned int outputDims,
00134                   unsigned int paramDims);
00135   VersorTransform();
00137 
00139   ~VersorTransform(){};
00140 
00143   virtual void SetRotationMatrix(const MatrixType & matrix)
00144     { this->Superclass::SetRotationMatrix( matrix ); }
00145 
00146   void SetVarVersor(const VersorType & newVersor)
00147     { m_Versor = newVersor; }
00148 
00150   void PrintSelf(std::ostream &os, Indent indent) const;
00151 
00154   void ComputeMatrix(void);
00155   void ComputeMatrixParameters(void);
00157 
00158 private:
00160   VersorTransform(const Self & other); // Not implemented
00161 
00163   const Self & operator=( const Self & ); // Not implemented
00164 
00166   VersorType    m_Versor;
00167 
00168 }; //class VersorTransform
00169 
00170 
00171 }  // namespace itk
00172 
00173 // Define instantiation macro for this template.
00174 #define ITK_TEMPLATE_VersorTransform(_, EXPORT, x, y) namespace itk { \
00175   _(1(class EXPORT VersorTransform< ITK_TEMPLATE_1 x >)) \
00176   namespace Templates { typedef VersorTransform< ITK_TEMPLATE_1 x > VersorTransform##y; } \
00177   }
00178 
00179 #if ITK_TEMPLATE_EXPLICIT
00180 # include "Templates/itkVersorTransform+-.h"
00181 #endif
00182 
00183 #if ITK_TEMPLATE_TXX
00184 # include "itkVersorTransform.txx"
00185 #endif
00186 
00187 #endif /* __itkVersorTransform_h */
00188 

Generated at Tue Sep 15 05:24:19 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000