00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkRigid3DPerspectiveTransform_h
00019 #define __itkRigid3DPerspectiveTransform_h
00020
00021 #include "itkExceptionObject.h"
00022 #include "vnl/vnl_quaternion.h"
00023 #include <iostream>
00024 #include "itkMatrix.h"
00025 #include "itkTransform.h"
00026 #include "itkVersor.h"
00027
00028 namespace itk
00029 {
00030
00039 template <
00040 class TScalarType=double>
00041 class ITK_EXPORT Rigid3DPerspectiveTransform :
00042 public Transform< TScalarType, 3, 2 >
00043 {
00044 public:
00046 itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00047 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
00048
00050 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00051 itkStaticConstMacro(ParametersDimension, unsigned int, 6);
00052
00054 typedef Rigid3DPerspectiveTransform Self;
00055 typedef Transform< TScalarType,
00056 itkGetStaticConstMacro(InputSpaceDimension),
00057 itkGetStaticConstMacro(OutputSpaceDimension)> Superclass;
00058
00059 typedef SmartPointer<Self> Pointer;
00060 typedef SmartPointer<const Self> ConstPointer;
00061
00063 itkTypeMacro( Rigid3DPerspectiveTransform, Transform );
00064
00066 itkNewMacro( Self );
00067
00069 typedef typename Superclass::ScalarType ScalarType;
00070
00072 typedef typename Superclass::ParametersType ParametersType;
00073
00075 typedef typename Superclass::JacobianType JacobianType;
00076
00078 typedef Matrix<TScalarType, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> MatrixType;
00079
00081 typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> OffsetType;
00082
00084 typedef Vector<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputVectorType;
00085 typedef Vector<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputVectorType;
00086
00088 typedef Point<TScalarType, itkGetStaticConstMacro(InputSpaceDimension)> InputPointType;
00089 typedef Point<TScalarType, itkGetStaticConstMacro(OutputSpaceDimension)> OutputPointType;
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
00102 const OffsetType & GetOffset() const
00103 { return m_Offset; }
00104
00108 const VersorType & GetRotation() const
00109 { return m_Versor; }
00110
00115 void SetParameters( const ParametersType & parameters );
00116
00119 void SetOffset(const OffsetType &offset)
00120 { m_Offset = offset; return; }
00121
00124 void SetRotation(const VersorType &rotation);
00125
00130 void SetRotation(const Vector<TScalarType,3> &axis, double angle);
00131
00135 void SetFocalDistance( TScalarType focalDistance )
00136 { m_FocalDistance = focalDistance; }
00137
00143 void SetHeight( TScalarType height )
00144 { m_Height = height; }
00145
00151 void SetWidth( TScalarType width )
00152 { m_Width = width; }
00153
00157 OutputPointType TransformPoint(const InputPointType &point ) const;
00158
00160 void ComputeMatrix(void);
00161
00163 virtual const JacobianType & GetJacobian(const InputPointType &point ) const;
00164
00165 protected:
00166 Rigid3DPerspectiveTransform();
00167 ~Rigid3DPerspectiveTransform();
00168 void PrintSelf(std::ostream &os, Indent indent) const;
00169
00170 private:
00171 Rigid3DPerspectiveTransform(const Self&);
00172 void operator=(const Self&);
00173
00175 OffsetType m_Offset;
00176
00178 VersorType m_Versor;
00179
00181 TScalarType m_FocalDistance;
00182
00184 TScalarType m_Height;
00185
00187 TScalarType m_Width;
00188
00190 MatrixType m_RotationMatrix;
00191
00192 };
00193
00194
00195
00196 }
00197
00198
00199 #ifndef ITK_MANUAL_INSTANTIATION
00200 #include "itkRigid3DPerspectiveTransform.txx"
00201 #endif
00202
00203 #endif