00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkRigid3DTransform_h
00018 #define __itkRigid3DTransform_h
00019
00020 #include <iostream>
00021 #include "itkMatrixOffsetTransformBase.h"
00022 #include "itkExceptionObject.h"
00023 #include "itkMatrix.h"
00024 #include "itkVersor.h"
00025
00026 namespace itk
00027 {
00028
00049 template < class TScalarType=double >
00050 class ITK_EXPORT Rigid3DTransform :
00051 public MatrixOffsetTransformBase< TScalarType, 3, 3>
00052 {
00053 public:
00055 typedef Rigid3DTransform Self;
00056 typedef MatrixOffsetTransformBase< TScalarType, 3, 3 > Superclass;
00057 typedef SmartPointer<Self> Pointer;
00058 typedef SmartPointer<const Self> ConstPointer;
00059
00061 itkTypeMacro( Rigid3DTransform, MatrixOffsetTransformBase );
00062
00064 itkNewMacro( Self );
00065
00067 itkStaticConstMacro(SpaceDimension, unsigned int, 3);
00068 itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
00069 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
00070 itkStaticConstMacro(ParametersDimension, unsigned int, 12);
00072
00073 typedef typename Superclass::ParametersType ParametersType;
00074 typedef typename Superclass::JacobianType JacobianType;
00075 typedef typename Superclass::ScalarType ScalarType;
00076 typedef typename Superclass::InputVectorType InputVectorType;
00077 typedef typename Superclass::OutputVectorType OutputVectorType;
00078 typedef typename Superclass::InputCovariantVectorType
00079 InputCovariantVectorType;
00080 typedef typename Superclass::OutputCovariantVectorType
00081 OutputCovariantVectorType;
00082 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00083 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00084 typedef typename Superclass::InputPointType InputPointType;
00085 typedef typename Superclass::OutputPointType OutputPointType;
00086 typedef typename Superclass::MatrixType MatrixType;
00087 typedef typename Superclass::InverseMatrixType InverseMatrixType;
00088 typedef typename Superclass::CenterType CenterType;
00089 typedef typename Superclass::TranslationType TranslationType;
00090 typedef typename Superclass::OffsetType OffsetType;
00091
00094 typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
00095 typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
00096
00107 virtual void SetParameters( const ParametersType & parameters );
00108
00114 virtual void SetMatrix(const MatrixType &matrix);
00115
00124 const MatrixType & GetRotationMatrix()
00125 { return this->GetMatrix(); }
00126
00137 virtual void SetRotationMatrix(const MatrixType & matrix)
00138 { this->SetMatrix(matrix); }
00139
00147 void Translate(const OffsetType & offset, bool pre=false);
00148
00150 bool GetInverse(Self* inverse) const;
00151
00153 virtual InverseTransformBasePointer GetInverseTransform() const;
00154
00166 InputPointType BackTransform(const OutputPointType
00167 &point ) const;
00168 InputVectorType BackTransform(const OutputVectorType
00169 &vector) const;
00170 InputVnlVectorType BackTransform( const OutputVnlVectorType
00171 &vector) const;
00172 InputCovariantVectorType BackTransform(const OutputCovariantVectorType
00173 &vector) const;
00175
00180 bool MatrixIsOrthogonal( const MatrixType & matrix, double tol = 1e-10 );
00181
00182 protected:
00183 Rigid3DTransform(unsigned int spaceDim,
00184 unsigned int paramDim);
00185 Rigid3DTransform(const MatrixType & matrix,
00186 const OutputVectorType & offset);
00187 Rigid3DTransform();
00188 ~Rigid3DTransform();
00189
00193 void PrintSelf(std::ostream &os, Indent indent) const;
00194
00195 private:
00196 Rigid3DTransform(const Self&);
00197 void operator=(const Self&);
00198
00199 };
00200
00201
00202 }
00203
00204
00205 #define ITK_TEMPLATE_Rigid3DTransform(_, EXPORT, x, y) namespace itk { \
00206 _(1(class EXPORT Rigid3DTransform< ITK_TEMPLATE_1 x >)) \
00207 namespace Templates { typedef Rigid3DTransform< ITK_TEMPLATE_1 x > Rigid3DTransform##y; } \
00208 }
00209
00210 #if ITK_TEMPLATE_EXPLICIT
00211 # include "Templates/itkRigid3DTransform+-.h"
00212 #endif
00213
00214 #if ITK_TEMPLATE_TXX
00215 # include "itkRigid3DTransform.txx"
00216 #endif
00217
00218 #endif
00219