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-11-24 02:27:28 $
00007   Version:   $Revision: 1.20 $
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   typedef typename AxisType::ValueType          AxisValueType;
00099   typedef typename ParametersType::ValueType    ParameterValueType;
00100 
00109   void SetParameters( const ParametersType & parameters );
00110 
00112   const ParametersType& GetParameters(void) const;
00113 
00115   void SetRotation( const VersorType & versor );
00116   void SetRotation( const AxisType & axis, AngleType angle );
00117   itkGetConstReferenceMacro(Versor, VersorType);
00119 
00121   virtual void SetIdentity(void);
00122 
00128   const JacobianType & GetJacobian(const InputPointType  &point ) const;
00129 
00130 protected:
00131 
00133   VersorTransform(const MatrixType &matrix,
00134                   const OutputVectorType &offset);
00135   VersorTransform(unsigned int outputDims,
00136                   unsigned int paramDims);
00137   VersorTransform();
00139 
00141   ~VersorTransform(){};
00142 
00145   virtual void SetRotationMatrix(const MatrixType & matrix)
00146     { this->Superclass::SetRotationMatrix( matrix ); }
00147 
00148   void SetVarVersor(const VersorType & newVersor)
00149     { m_Versor = newVersor; }
00150 
00152   void PrintSelf(std::ostream &os, Indent indent) const;
00153 
00156   void ComputeMatrix(void);
00157   void ComputeMatrixParameters(void);
00159 
00160 private:
00162   VersorTransform(const Self & other); // Not implemented
00163 
00165   const Self & operator=( const Self & ); // Not implemented
00166 
00168   VersorType    m_Versor;
00169 
00170 }; //class VersorTransform
00171 
00172 
00173 }  // namespace itk
00174 
00175 // Define instantiation macro for this template.
00176 #define ITK_TEMPLATE_VersorTransform(_, EXPORT, x, y) namespace itk { \
00177   _(1(class EXPORT VersorTransform< ITK_TEMPLATE_1 x >)) \
00178   namespace Templates { typedef VersorTransform< ITK_TEMPLATE_1 x > VersorTransform##y; } \
00179   }
00180 
00181 #if ITK_TEMPLATE_EXPLICIT
00182 # include "Templates/itkVersorTransform+-.h"
00183 #endif
00184 
00185 #if ITK_TEMPLATE_TXX
00186 # include "itkVersorTransform.txx"
00187 #endif
00188 
00189 #endif /* __itkVersorTransform_h */
00190 

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