go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedVersorTransform.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkAdvancedVersorTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006-08-09 04:35:32 $
00007   Version:   $Revision: 1.17 $
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 __itkAdvancedVersorTransform_h
00019 #define __itkAdvancedVersorTransform_h
00020 
00021 #include <iostream>
00022 #include "itkAdvancedRigid3DTransform.h"
00023 #include "vnl/vnl_quaternion.h"
00024 #include "itkVersor.h"
00025 
00026 namespace itk
00027 {
00028 
00050 template < class TScalarType=double >//Data type for scalars (float or double)
00051 class ITK_EXPORT AdvancedVersorTransform : public AdvancedRigid3DTransform< TScalarType >
00052 {
00053 public:
00054 
00056   typedef AdvancedVersorTransform                   Self;
00057   typedef AdvancedRigid3DTransform< TScalarType >   Superclass;
00058   typedef SmartPointer<Self>                Pointer;
00059   typedef SmartPointer<const Self>          ConstPointer;
00060 
00062   itkTypeMacro( AdvancedVersorTransform, AdvancedRigid3DTransform );
00063 
00065   itkNewMacro( Self );
00066 
00068   itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00069   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00070   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00071   itkStaticConstMacro(ParametersDimension, unsigned int, 3);
00072 
00074   typedef typename Superclass::ParametersType         ParametersType;
00075   typedef typename Superclass::JacobianType           JacobianType;
00076   typedef typename Superclass::ScalarType             ScalarType;
00077   typedef typename Superclass::InputPointType         InputPointType;
00078   typedef typename Superclass::OutputPointType        OutputPointType;
00079   typedef typename Superclass::InputVectorType        InputVectorType;
00080   typedef typename Superclass::OutputVectorType       OutputVectorType;
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 
00092   typedef typename Superclass
00093     ::NonZeroJacobianIndicesType                    NonZeroJacobianIndicesType;
00094   typedef typename Superclass::SpatialJacobianType  SpatialJacobianType;
00095   typedef typename Superclass
00096     ::JacobianOfSpatialJacobianType                 JacobianOfSpatialJacobianType;
00097   typedef typename Superclass::SpatialHessianType   SpatialHessianType;
00098   typedef typename Superclass
00099     ::JacobianOfSpatialHessianType                  JacobianOfSpatialHessianType;
00100   typedef typename Superclass::InternalMatrixType   InternalMatrixType;
00101 
00103   typedef vnl_quaternion<TScalarType>                 VnlQuaternionType;
00104 
00106   typedef Versor<TScalarType>                   VersorType;
00107   typedef typename VersorType::VectorType       AxisType;
00108   typedef typename VersorType::ValueType        AngleType;
00109 
00118   void SetParameters( const ParametersType & parameters );
00119 
00121   const ParametersType& GetParameters(void) const;
00122 
00124   void SetRotation( const VersorType & versor );
00125   void SetRotation( const AxisType & axis, AngleType angle );
00126   itkGetConstReferenceMacro(Versor, VersorType);
00127 
00129   virtual void SetIdentity(void);
00130 
00132   virtual void GetJacobian(
00133     const InputPointType &,
00134     JacobianType &,
00135     NonZeroJacobianIndicesType & ) const;
00136 
00137 protected:
00138 
00140   AdvancedVersorTransform(const MatrixType &matrix,
00141                   const OutputVectorType &offset);
00142   AdvancedVersorTransform(unsigned int outputDims,
00143                   unsigned int paramDims);
00144   AdvancedVersorTransform();
00145 
00147   ~AdvancedVersorTransform(){};
00148 
00151   virtual void SetRotationMatrix(const MatrixType & matrix)
00152     { this->Superclass::SetRotationMatrix( matrix ); }
00153 
00154   void SetVarVersor(const VersorType & newVersor)
00155     { m_Versor = newVersor; }
00156 
00158   void PrintSelf(std::ostream &os, Indent indent) const;
00159 
00162   void ComputeMatrix(void);
00163   void ComputeMatrixParameters(void);
00164 
00165 private:
00167   AdvancedVersorTransform(const Self & other); // Not implemented
00168 
00170   const Self & operator=( const Self & ); // Not implemented
00171 
00173   VersorType    m_Versor;
00174 
00175 }; //class AdvancedVersorTransform
00176 
00177 
00178 }  // namespace itk
00179 
00180 // Define instantiation macro for this template.
00181 #define ITK_TEMPLATE_AdvancedVersorTransform(_, EXPORT, x, y) namespace itk { \
00182   _(1(class EXPORT AdvancedVersorTransform< ITK_TEMPLATE_1 x >)) \
00183   namespace Templates { typedef AdvancedVersorTransform< ITK_TEMPLATE_1 x > AdvancedVersorTransform##y; } \
00184   }
00185 
00186 #if ITK_TEMPLATE_EXPLICIT
00187 # include "Templates/itkAdvancedVersorTransform+-.h"
00188 #endif
00189 
00190 #if ITK_TEMPLATE_TXX
00191 # include "itkAdvancedVersorTransform.txx"
00192 #endif
00193 
00194 #endif /* __itkAdvancedVersorTransform_h */


Generated on 24-10-2011 for elastix by doxygen 1.7.4 elastix logo