00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkRigid2DTransform_h
00018 #define __itkRigid2DTransform_h
00019
00020 #include <iostream>
00021 #include "itkMatrixOffsetTransformBase.h"
00022 #include "itkExceptionObject.h"
00023
00024 namespace itk
00025 {
00026
00056 template < class TScalarType=double >
00057 class ITK_EXPORT Rigid2DTransform :
00058 public MatrixOffsetTransformBase< TScalarType, 2, 2>
00059 {
00060 public:
00062 typedef Rigid2DTransform Self;
00063 typedef MatrixOffsetTransformBase< TScalarType, 2, 2 > Superclass;
00064 typedef SmartPointer<Self> Pointer;
00065 typedef SmartPointer<const Self> ConstPointer;
00066
00068 itkTypeMacro( Rigid2DTransform, MatrixOffsetTransformBase );
00069
00071 itkNewMacro( Self );
00072
00074 itkStaticConstMacro(InputSpaceDimension, unsigned int, 2);
00075 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
00076 itkStaticConstMacro(ParametersDimension, unsigned int, 3);
00078
00080 typedef typename Superclass::ScalarType ScalarType;
00081
00083 typedef typename Superclass::ParametersType ParametersType;
00084
00086 typedef typename Superclass::JacobianType JacobianType;
00087
00089 typedef typename Superclass::MatrixType MatrixType;
00090
00092 typedef typename Superclass::OffsetType OffsetType;
00093
00095 typedef typename Superclass::InputVectorType InputVectorType;
00096 typedef typename Superclass::OutputVectorType OutputVectorType;
00097
00099 typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
00100 typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
00101
00103 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00104 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00105
00107 typedef typename Superclass::InputPointType InputPointType;
00108 typedef typename Superclass::OutputPointType OutputPointType;
00109
00122 virtual void SetMatrix( const MatrixType & matrix );
00123
00129 virtual void SetRotationMatrix(const MatrixType &matrix)
00130 { this->SetMatrix( matrix ); }
00131 const MatrixType & GetRotationMatrix() const
00132 { return this->GetMatrix(); }
00134
00135
00143 void Translate(const OffsetType &offset, bool pre=false);
00144
00153 inline InputPointType BackTransform(const OutputPointType &point ) const;
00154 inline InputVectorType BackTransform(const OutputVectorType &vector) const;
00155 inline InputVnlVectorType BackTransform(const OutputVnlVectorType &vector) const;
00157
00158 inline InputCovariantVectorType BackTransform(
00159 const OutputCovariantVectorType &vector) const;
00160
00162 void SetAngle(TScalarType angle);
00163 itkGetConstReferenceMacro( Angle, TScalarType );
00165
00167 void SetAngleInDegrees(TScalarType angle);
00168
00172 void SetRotation(TScalarType angle)
00173 { this->SetAngle(angle); }
00174 virtual const TScalarType & GetRotation() const
00175 { return m_Angle; }
00177
00186 void SetParameters( const ParametersType & parameters );
00187
00196 const ParametersType & GetParameters( void ) const;
00197
00202 const JacobianType & GetJacobian(const InputPointType &point ) const;
00203
00208 void CloneInverseTo( Pointer & newinverse ) const;
00209
00214 void CloneTo( Pointer & clone ) const;
00215
00217 virtual void SetIdentity(void);
00218
00219 protected:
00220 Rigid2DTransform();
00221 Rigid2DTransform( unsigned int outputSpaceDimension,
00222 unsigned int parametersDimension);
00223
00224 ~Rigid2DTransform();
00225
00229 void PrintSelf(std::ostream &os, Indent indent) const;
00230
00234 virtual void ComputeMatrix(void);
00235
00240 virtual void ComputeMatrixParameters(void);
00241
00243 void SetVarAngle( TScalarType angle )
00244 { m_Angle = angle; }
00245
00246 private:
00247 Rigid2DTransform(const Self&);
00248 void operator=(const Self&);
00249
00250 TScalarType m_Angle;
00251
00252 };
00253
00254
00255 }
00256
00257
00258 #ifndef ITK_MANUAL_INSTANTIATION
00259 #include "itkRigid2DTransform.txx"
00260 #endif
00261
00262 #endif
00263