itkScalableAffineTransform.h
Go to the documentation of this file.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::ParametersValueType ParametersValueType;
00068 typedef typename Superclass::JacobianType JacobianType;
00069 typedef typename Superclass::ScalarType ScalarType;
00070 typedef typename Superclass::InputVectorType InputVectorType;
00071 typedef typename Superclass::OutputVectorType OutputVectorType;
00072 typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
00073 typedef typename Superclass::OutputCovariantVectorType OutputCovariantVectorType;
00074 typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
00075 typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
00076 typedef typename Superclass::InputPointType InputPointType;
00077 typedef typename Superclass::OutputPointType OutputPointType;
00078 typedef typename Superclass::MatrixType MatrixType;
00079 typedef typename Superclass::MatrixValueType MatrixValueType;
00080 typedef typename Superclass::InverseMatrixType InverseMatrixType;
00081 typedef typename Superclass::CenterType CenterType;
00082 typedef typename Superclass::OffsetType OffsetType;
00083 typedef typename Superclass::TranslationType TranslationType;
00084
00087 typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
00088 typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
00089
00093 void SetIdentity( void );
00094
00096 virtual void SetScale( const InputVectorType & scale );
00097 virtual void SetScaleComponent( const InputVectorType & scale )
00098 { this->SetScale(scale); }
00100
00102 virtual void SetScale( const double scale[NDimensions] );
00103 virtual void SetScaleComponent( const double scale[NDimensions] )
00104 { this->SetScale(scale); }
00106
00108 virtual const double * GetScale() const
00109 { return m_Scale; }
00110 virtual const double * GetScaleComponent() const
00111 { return m_Scale; }
00113
00118 void SetMatrixComponent(const MatrixType &matrix)
00119 { this->SetMatrix( matrix ); }
00120
00124 const MatrixType & GetMatrixComponent() const
00125 { return this->GetMatrix(); }
00126
00130 void SetOffsetComponent(const OffsetType &offset)
00131 { this->SetTranslation( offset ); }
00132
00136 const OffsetType & GetOffsetComponent(void) const
00137 { return this->GetTranslation(); }
00138
00140 bool GetInverse(Self* inverse) const;
00141
00143 virtual InverseTransformBasePointer GetInverseTransform() const;
00144
00145
00146 protected:
00154 ScalableAffineTransform(const MatrixType &matrix,
00155 const OutputVectorType &offset);
00156 ScalableAffineTransform(unsigned int outputSpaceDimension,
00157 unsigned int parametersDimension);
00158 ScalableAffineTransform();
00160
00161 void ComputeMatrix();
00162
00164 virtual ~ScalableAffineTransform();
00165
00167 void PrintSelf(std::ostream &s, Indent indent) const;
00168
00169 void SetVarScale(const double * scale)
00170 { for(int i=0; i<InputSpaceDimension; i++) { m_Scale[i] = scale[i]; } }
00171
00172 private:
00173
00174 ScalableAffineTransform(const Self & other);
00175 const Self & operator=( const Self & );
00176
00177 double m_Scale[NDimensions];
00178 InputVectorType m_MatrixScale;
00179
00180 };
00181
00182 }
00183
00184
00185 #define ITK_TEMPLATE_ScalableAffineTransform(_, EXPORT, x, y) namespace itk { \
00186 _(2(class EXPORT ScalableAffineTransform< ITK_TEMPLATE_2 x >)) \
00187 namespace Templates { typedef ScalableAffineTransform< ITK_TEMPLATE_2 x > \
00188 ScalableAffineTransform##y; } \
00189 }
00190
00191 #if ITK_TEMPLATE_EXPLICIT
00192 # include "Templates/itkScalableAffineTransform+-.h"
00193 #endif
00194
00195 #if ITK_TEMPLATE_TXX
00196 # include "itkScalableAffineTransform.txx"
00197 #endif
00198
00199 #endif
00200