00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkScaleTransform_h
00019 #define __itkScaleTransform_h
00020
00021 #include <iostream>
00022 #include "itkTransform.h"
00023 #include "itkExceptionObject.h"
00024 #include "itkMatrix.h"
00025
00026 namespace itk
00027 {
00028
00036 template <
00037 class TScalarType=float,
00038 unsigned int NDimensions=3 >
00039 class ScaleTransform : public Transform< TScalarType,
00040 NDimensions,
00041 NDimensions >
00042 {
00043 public:
00045 typedef ScaleTransform Self;
00046 typedef Transform< TScalarType, NDimensions, NDimensions > Superclass;
00047 typedef SmartPointer<Self> Pointer;
00048 typedef SmartPointer<const Self> ConstPointer;
00049
00051 itkNewMacro( Self );
00052
00054 itkTypeMacro( ScaleTransform, Transform );
00055
00057 itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
00058 itkStaticConstMacro(ParametersDimension, unsigned int, NDimensions);
00059
00061 typedef typename Superclass::ScalarType ScalarType;
00062
00064 typedef typename Superclass::ParametersType ParametersType;
00065
00067 typedef typename Superclass::JacobianType JacobianType;
00068
00070 typedef FixedArray<TScalarType, itkGetStaticConstMacro(SpaceDimension)> ScaleType;
00071
00073 typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVectorType;
00074 typedef Vector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVectorType;
00075
00077 typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputCovariantVectorType;
00078 typedef CovariantVector<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputCovariantVectorType;
00079
00081 typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputVnlVectorType;
00082 typedef vnl_vector_fixed<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputVnlVectorType;
00083
00085 typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> InputPointType;
00086 typedef Point<TScalarType, itkGetStaticConstMacro(SpaceDimension)> OutputPointType;
00087
00091 const ScaleType & GetScale( void ) const
00092 { return m_Scale; }
00093
00097 void SetParameters(const ParametersType & parameters);
00098
00104 const ParametersType & GetParameters( void ) const;
00105
00107 const JacobianType & GetJacobian( const InputPointType & point ) const;
00108
00114 void SetScale( const ScaleType & scale )
00115 { this->Modified(); m_Scale = scale; }
00116
00118 void Compose(const Self * other, bool pre=false);
00119
00124 void Scale(const ScaleType & scale, bool pre=false );
00125
00130 OutputPointType TransformPoint(const InputPointType &point ) const;
00131 OutputVectorType TransformVector(const InputVectorType &vector) const;
00132 OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const;
00133 OutputCovariantVectorType TransformCovariantVector(
00134 const InputCovariantVectorType &vector) const;
00135
00140 inline InputPointType BackTransform(const OutputPointType &point ) const;
00141 inline InputVectorType BackTransform(const OutputVectorType &vector) const;
00142 inline InputVnlVectorType BackTransform(const OutputVnlVectorType &vector) const;
00143 inline InputCovariantVectorType BackTransform(
00144 const OutputCovariantVectorType &vector) const;
00145
00150 ScaleTransform::Pointer Inverse(void) const;
00151
00155 void SetIdentity( void )
00156 { m_Scale.Fill( 1.0 ); }
00157
00158 protected:
00160 ScaleTransform();
00161
00163 ~ScaleTransform();
00164
00166 void PrintSelf(std::ostream &os, Indent indent) const;
00167
00168 private:
00169 ScaleTransform(const Self & other);
00170 const Self & operator=( const Self & );
00171
00172 ScaleType m_Scale;
00173
00174 };
00175
00176 }
00177
00178
00179 #ifndef ITK_MANUAL_INSTANTIATION
00180 #include "itkScaleTransform.txx"
00181 #endif
00182
00183 #endif