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

itkRigid3DPerspectiveTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRigid3DPerspectiveTransform.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-11-28 15:53:15 $
00007   Version:   $Revision: 1.32 $
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 __itkRigid3DPerspectiveTransform_h
00018 #define __itkRigid3DPerspectiveTransform_h
00019 
00020 #include "itkExceptionObject.h"
00021 #include "vnl/vnl_quaternion.h"
00022 #include <iostream>
00023 #include "itkMatrix.h"
00024 #include "itkTransform.h"
00025 #include "itkVersor.h"
00026 
00027 namespace itk
00028 {
00029 
00038 template <
00039     class TScalarType=double>    // Data type for scalars (float or double)
00040 class ITK_EXPORT Rigid3DPerspectiveTransform : 
00041         public Transform<  TScalarType, 3, 2 > 
00042 {
00043 public:
00045   itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00046   itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
00048 
00050   itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00051   itkStaticConstMacro(ParametersDimension, unsigned int, 6);
00053 
00055   typedef Rigid3DPerspectiveTransform Self;
00056   typedef Transform<  TScalarType, 
00057                       itkGetStaticConstMacro(InputSpaceDimension),
00058                       itkGetStaticConstMacro(OutputSpaceDimension)> Superclass;
00060 
00061   typedef SmartPointer<Self>        Pointer;
00062   typedef SmartPointer<const Self>  ConstPointer;
00063   
00065   itkTypeMacro( Rigid3DPerspectiveTransform, Transform );
00066 
00068   itkNewMacro( Self );
00069 
00071   typedef typename Superclass::ScalarType  ScalarType;
00072 
00074   typedef typename Superclass::ParametersType  ParametersType;
00075   typedef typename ParametersType::ValueType   ParameterValueType;
00076 
00078   typedef typename Superclass::JacobianType  JacobianType;
00079 
00081   typedef Matrix<TScalarType, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> MatrixType;
00082 
00084   typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> OffsetType;
00085   typedef typename OffsetType::ValueType                                   OffsetValueType;
00086 
00088   typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)>    InputVectorType;
00089   typedef Vector<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)>   OutputVectorType;
00091 
00093   typedef Point<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)>     InputPointType;
00094   typedef Point<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)>    OutputPointType;
00096 
00098   typedef vnl_quaternion<TScalarType>           VnlQuaternionType;
00099 
00101   typedef Versor<TScalarType>              VersorType;
00102   typedef typename VersorType::VectorType  AxisType;
00103   typedef typename VersorType::ValueType   AngleType;
00104   typedef typename AxisType::ValueType     AxisValueType;
00105 
00109   const OffsetType & GetOffset() const
00110     { return m_Offset; }
00111 
00115   const VersorType & GetRotation() const
00116     { return m_Versor; }
00117 
00122   void SetParameters( const ParametersType & parameters );
00123   const ParametersType & GetParameters() const;
00125 
00128   void SetOffset(const OffsetType &offset)
00129     { m_Offset = offset; return; }
00130 
00133   void SetRotation(const VersorType &rotation);
00134 
00139   void SetRotation(const Vector<TScalarType,3> &axis, double angle);
00140 
00144   void SetFocalDistance( TScalarType focalDistance )
00145     { m_FocalDistance = focalDistance; }
00146 
00148   double GetFocalDistance( void ) const
00149     { return m_FocalDistance; }
00150 
00154   OutputPointType  TransformPoint(const InputPointType  &point ) const;
00155 
00157   const MatrixType & GetRotationMatrix() const {return m_RotationMatrix;}
00158 
00160   void ComputeMatrix(void);
00161 
00163   virtual const JacobianType & GetJacobian(const InputPointType  &point ) const;
00164 
00166   itkGetConstReferenceMacro(FixedOffset,OffsetType);
00167   itkSetMacro(FixedOffset,OffsetType);
00169 
00171   itkSetMacro(CenterOfRotation,InputPointType);
00172   itkGetConstReferenceMacro(CenterOfRotation,InputPointType);
00174 
00175 
00176 protected:
00177     Rigid3DPerspectiveTransform();
00178     ~Rigid3DPerspectiveTransform();
00179     void PrintSelf(std::ostream &os, Indent indent) const;
00180 
00181 private:
00182   Rigid3DPerspectiveTransform(const Self&); //purposely not implemented
00183   void operator=(const Self&); //purposely not implemented
00184 
00186   OffsetType          m_Offset;   
00187 
00189   VersorType          m_Versor; 
00190 
00192   TScalarType         m_FocalDistance;  
00193 
00195   MatrixType          m_RotationMatrix;   
00196 
00198   OffsetType m_FixedOffset;
00199 
00201   InputPointType m_CenterOfRotation;
00202 
00203 }; //class Rigid3DPerspectiveTransform:
00204 
00205 }  // namespace itk
00206 
00207 // Define instantiation macro for this template.
00208 #define ITK_TEMPLATE_Rigid3DPerspectiveTransform(_, EXPORT, x, y) namespace itk { \
00209   _(1(class EXPORT Rigid3DPerspectiveTransform< ITK_TEMPLATE_1 x >)) \
00210   namespace Templates { typedef Rigid3DPerspectiveTransform< ITK_TEMPLATE_1 x > \
00211                                                   Rigid3DPerspectiveTransform##y; } \
00212   }
00213 
00214 #if ITK_TEMPLATE_EXPLICIT
00215 # include "Templates/itkRigid3DPerspectiveTransform+-.h"
00216 #endif
00217 
00218 #if ITK_TEMPLATE_TXX
00219 # include "itkRigid3DPerspectiveTransform.txx"
00220 #endif
00221 
00222 #endif /* __itkRigid3DPerspectiveTransform_h */
00223 

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