00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkSimilarity2DTransform_h
00019 #define __itkSimilarity2DTransform_h
00020
00021 #include <iostream>
00022 #include "itkRigid2DTransform.h"
00023
00024 namespace itk
00025 {
00026
00062 template < class TScalarType=double >
00063 class ITK_EXPORT Similarity2DTransform :
00064 public Rigid2DTransform< TScalarType >
00065 {
00066 public:
00068 typedef Similarity2DTransform Self;
00069 typedef Rigid2DTransform< TScalarType > Superclass;
00070 typedef SmartPointer<Self> Pointer;
00071 typedef SmartPointer<const Self> ConstPointer;
00072
00074 itkNewMacro( Self );
00075
00077 itkTypeMacro( Similarity2DTransform, Rigid2DTransform );
00078
00080 itkStaticConstMacro(SpaceDimension, unsigned int, 2);
00081 itkStaticConstMacro(InputSpaceDimension, unsigned int, 2);
00082 itkStaticConstMacro(OutputSpaceDimension, unsigned int, 2);
00083 itkStaticConstMacro(ParametersDimension, unsigned int, 4);
00085
00087 typedef typename Superclass::ScalarType ScalarType;
00088 typedef TScalarType ScaleType;
00089
00091 typedef typename Superclass::ParametersType ParametersType;
00092
00094 typedef typename Superclass::JacobianType JacobianType;
00095
00097 typedef typename Superclass::OffsetType OffsetType;
00098
00100 typedef typename Superclass::MatrixType MatrixType;
00101
00103 typedef typename Superclass::InputPointType InputPointType;
00104 typedef typename Superclass::OutputPointType OutputPointType;
00105
00107 typedef typename Superclass::InputVectorType InputVectorType;
00108 typedef typename Superclass::OutputVectorType OutputVectorType;
00109
00111 typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
00112 typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
00113
00115 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00116 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00117
00120 typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
00121 typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
00122
00124 void SetScale( ScaleType scale );
00125 itkGetConstReferenceMacro( Scale, ScaleType );
00127
00137 void SetParameters( const ParametersType & parameters );
00138
00148 const ParametersType & GetParameters( void ) const;
00149
00154 const JacobianType & GetJacobian(const InputPointType &point ) const;
00155
00157 virtual void SetIdentity( void );
00158
00163 void CloneInverseTo( Pointer & newinverse ) const;
00164
00166 bool GetInverse(Self* inverse) const;
00167
00169 virtual InverseTransformBasePointer GetInverseTransform() const;
00170
00175 void CloneTo( Pointer & clone ) const;
00176
00190 virtual void SetMatrix( const MatrixType & matrix );
00191
00192 protected:
00193 Similarity2DTransform();
00194 Similarity2DTransform( unsigned int spaceDimension,
00195 unsigned int parametersDimension);
00196
00197 ~Similarity2DTransform(){};
00198 void PrintSelf(std::ostream &os, Indent indent) const;
00199
00203 virtual void ComputeMatrix(void);
00204
00209 virtual void ComputeMatrixParameters(void);
00210
00212 void SetVarScale( ScaleType scale )
00213 { m_Scale = scale; }
00214
00215 private:
00216 Similarity2DTransform(const Self&);
00217 void operator=(const Self&);
00218
00219 ScaleType m_Scale;
00220
00221 };
00222
00223
00224 }
00225
00226
00227 #define ITK_TEMPLATE_Similarity2DTransform(_, EXPORT, x, y) namespace itk { \
00228 _(1(class EXPORT Similarity2DTransform< ITK_TEMPLATE_1 x >)) \
00229 namespace Templates { typedef Similarity2DTransform< ITK_TEMPLATE_1 x > Similarity2DTransform##y; } \
00230 }
00231
00232 #if ITK_TEMPLATE_EXPLICIT
00233 # include "Templates/itkSimilarity2DTransform+-.h"
00234 #endif
00235
00236 #if ITK_TEMPLATE_TXX
00237 # include "itkSimilarity2DTransform.txx"
00238 #endif
00239
00240 #endif
00241