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: 2007-01-30 20:56:09 $
00007   Version:   $Revision: 1.30 $
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 
00077   typedef typename Superclass::JacobianType  JacobianType;
00078 
00080   typedef Matrix<TScalarType, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> MatrixType;
00081 
00083   typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> OffsetType;
00084 
00086   typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputVectorType;
00087   typedef Vector<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVectorType;
00089 
00091   typedef Point<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)>    InputPointType;
00092   typedef Point<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)>    OutputPointType;
00094 
00096   typedef vnl_quaternion<TScalarType>           VnlQuaternionType;
00097 
00099   typedef Versor<TScalarType>             VersorType;
00100   typedef typename VersorType::VectorType  AxisType;
00101   typedef typename VersorType::ValueType   AngleType;
00102 
00106   const OffsetType & GetOffset() const
00107     { return m_Offset; }
00108 
00112   const VersorType & GetRotation() const
00113     { return m_Versor; }
00114 
00119   void SetParameters( const ParametersType & parameters );
00120   const ParametersType & GetParameters() const;
00122 
00125   void SetOffset(const OffsetType &offset)
00126     { m_Offset = offset; return; }
00127 
00130   void SetRotation(const VersorType &rotation);
00131 
00136   void SetRotation(const Vector<TScalarType,3> &axis, double angle);
00137 
00141   void SetFocalDistance( TScalarType focalDistance )
00142     { m_FocalDistance = focalDistance; }
00143 
00145   double GetFocalDistance( void ) const
00146     { return m_FocalDistance; }
00147 
00151   OutputPointType  TransformPoint(const InputPointType  &point ) const;
00152 
00154   const MatrixType & GetRotationMatrix() const {return m_RotationMatrix;}
00155 
00157   void ComputeMatrix(void);
00158 
00160   virtual const JacobianType & GetJacobian(const InputPointType  &point ) const;
00161 
00163   itkGetConstReferenceMacro(FixedOffset,OffsetType);
00164   itkSetMacro(FixedOffset,OffsetType);
00166 
00168   itkSetMacro(CenterOfRotation,InputPointType);
00169   itkGetConstReferenceMacro(CenterOfRotation,InputPointType);
00171 
00172 
00173 protected:
00174     Rigid3DPerspectiveTransform();
00175     ~Rigid3DPerspectiveTransform();
00176     void PrintSelf(std::ostream &os, Indent indent) const;
00177 
00178 private:
00179   Rigid3DPerspectiveTransform(const Self&); //purposely not implemented
00180   void operator=(const Self&); //purposely not implemented
00181 
00183   OffsetType          m_Offset;   
00184 
00186   VersorType          m_Versor; 
00187 
00189   TScalarType         m_FocalDistance;  
00190 
00192   MatrixType          m_RotationMatrix;   
00193 
00194   
00196   OffsetType m_FixedOffset;
00197 
00199   InputPointType m_CenterOfRotation;
00200 
00201 
00202 }; //class Rigid3DPerspectiveTransform:
00203 
00204 
00205 
00206 }  // namespace itk
00207 
00208 // Define instantiation macro for this template.
00209 #define ITK_TEMPLATE_Rigid3DPerspectiveTransform(_, EXPORT, x, y) namespace itk { \
00210   _(1(class EXPORT Rigid3DPerspectiveTransform< ITK_TEMPLATE_1 x >)) \
00211   namespace Templates { typedef Rigid3DPerspectiveTransform< ITK_TEMPLATE_1 x > \
00212                                                   Rigid3DPerspectiveTransform##y; } \
00213   }
00214 
00215 #if ITK_TEMPLATE_EXPLICIT
00216 # include "Templates/itkRigid3DPerspectiveTransform+-.h"
00217 #endif
00218 
00219 #if ITK_TEMPLATE_TXX
00220 # include "itkRigid3DPerspectiveTransform.txx"
00221 #endif
00222 
00223 #endif /* __itkRigid3DPerspectiveTransform_h */
00224 

Generated at Sat Feb 28 13:27:32 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000