00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkScalableAffineTransform_h
00019 #define __itkScalableAffineTransform_h
00020
00021 #include "itkAffineTransform.h"
00022
00023 namespace itk
00024 {
00025
00026
00038 template <
00039 class TScalarType=double,
00040 unsigned int NDimensions=3>
00041 class ITK_EXPORT ScalableAffineTransform
00042 : public AffineTransform< TScalarType, NDimensions >
00043 {
00044 public:
00046 typedef ScalableAffineTransform Self;
00047 typedef AffineTransform< TScalarType, NDimensions > Superclass;
00048 typedef SmartPointer<Self> Pointer;
00049 typedef SmartPointer<const Self> ConstPointer;
00050
00052 itkTypeMacro( ScalableAffineTransform, AffineTransform );
00053
00055 itkNewMacro( Self );
00056
00058 itkStaticConstMacro(InputSpaceDimension, unsigned int, NDimensions);
00059 itkStaticConstMacro(OutputSpaceDimension, unsigned int, NDimensions);
00060 itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
00061 itkStaticConstMacro(ParametersDimension, unsigned int,
00062 NDimensions*(NDimensions+1));
00064
00066 typedef typename Superclass::ParametersType ParametersType;
00067 typedef typename Superclass::JacobianType JacobianType;
00068 typedef typename Superclass::ScalarType ScalarType;
00069 typedef typename Superclass::InputVectorType InputVectorType;
00070 typedef typename Superclass::OutputVectorType OutputVectorType;
00071 typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
00072 typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
00073 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00074 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00075 typedef typename Superclass::InputPointType InputPointType;
00076 typedef typename Superclass::OutputPointType OutputPointType;
00077 typedef typename Superclass::MatrixType MatrixType;
00078 typedef typename Superclass::InverseMatrixType InverseMatrixType;
00079 typedef typename Superclass::CenterType CenterType;
00080 typedef typename Superclass::OffsetType OffsetType;
00081 typedef typename Superclass::TranslationType TranslationType;
00082
00085 typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
00086 typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
00087
00091 void SetIdentity( void );
00092
00094 virtual void SetScale( const InputVectorType & scale );
00095 virtual void SetScaleComponent( const InputVectorType & scale )
00096 { this->SetScale(scale); }
00098
00100 virtual void SetScale( const double scale[NDimensions] );
00101 virtual void SetScaleComponent( const double scale[NDimensions] )
00102 { this->SetScale(scale); }
00104
00106 virtual const double * GetScale() const
00107 { return m_Scale; }
00108 virtual const double * GetScaleComponent() const
00109 { return m_Scale; }
00111
00116 void SetMatrixComponent(const MatrixType &matrix)
00117 { this->SetMatrix( matrix ); }
00118
00122 const MatrixType & GetMatrixComponent() const
00123 { return this->GetMatrix(); }
00124
00128 void SetOffsetComponent(const OffsetType &offset)
00129 { this->SetTranslation( offset ); }
00130
00134 const OffsetType & GetOffsetComponent(void) const
00135 { return this->GetTranslation(); }
00136
00138 bool GetInverse(Self* inverse) const;
00139
00141 virtual InverseTransformBasePointer GetInverseTransform() const;
00142
00143
00144 protected:
00152 ScalableAffineTransform(const MatrixType &matrix,
00153 const OutputVectorType &offset);
00154 ScalableAffineTransform(unsigned int outputSpaceDimension,
00155 unsigned int parametersDimension);
00156 ScalableAffineTransform();
00158
00159 void ComputeMatrix();
00160
00162 virtual ~ScalableAffineTransform();
00163
00165 void PrintSelf(std::ostream &s, Indent indent) const;
00166
00167 void SetVarScale(const double * scale)
00168 { for(int i=0; i<InputSpaceDimension; i++) { m_Scale[i] = scale[i]; } }
00169
00170 private:
00171
00172 ScalableAffineTransform(const Self & other);
00173 const Self & operator=( const Self & );
00174
00175 double m_Scale[NDimensions];
00176 InputVectorType m_MatrixScale;
00177
00178 };
00179
00180 }
00181
00182
00183 #define ITK_TEMPLATE_ScalableAffineTransform(_, EXPORT, x, y) namespace itk { \
00184 _(2(class EXPORT ScalableAffineTransform< ITK_TEMPLATE_2 x >)) \
00185 namespace Templates { typedef ScalableAffineTransform< ITK_TEMPLATE_2 x > \
00186 ScalableAffineTransform##y; } \
00187 }
00188
00189 #if ITK_TEMPLATE_EXPLICIT
00190 # include "Templates/itkScalableAffineTransform+-.h"
00191 #endif
00192
00193 #if ITK_TEMPLATE_TXX
00194 # include "itkScalableAffineTransform.txx"
00195 #endif
00196
00197 #endif
00198