00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkTransform_h
00018 #define __itkTransform_h
00019
00020 #include "itkTransformBase.h"
00021 #include "itkPoint.h"
00022 #include "itkVector.h"
00023 #include "itkCovariantVector.h"
00024 #include "vnl/vnl_vector_fixed.h"
00025 #include "itkArray.h"
00026 #include "itkArray2D.h"
00027
00028 #include "itkObjectFactory.h"
00029
00030
00031 namespace itk
00032 {
00033
00063 template <class TScalarType,
00064 unsigned int NInputDimensions=3,
00065 unsigned int NOutputDimensions=3>
00066 class ITK_EXPORT Transform : public TransformBase
00067 {
00068 public:
00070 typedef Transform Self;
00071 typedef TransformBase Superclass;
00072 typedef SmartPointer< Self > Pointer;
00073 typedef SmartPointer< const Self > ConstPointer;
00074
00076 itkNewMacro(Self);
00077
00079 itkTypeMacro( Transform, TransformBase );
00080
00082 itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions);
00083 itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions);
00084
00086 unsigned int GetInputSpaceDimension(void) const {return NInputDimensions;}
00087
00089 unsigned int GetOutputSpaceDimension(void) const {return NOutputDimensions;}
00090
00092 typedef TScalarType ScalarType;
00093
00095 typedef typename Superclass::ParametersType ParametersType;
00096
00098 typedef Array2D< double > JacobianType;
00099
00101 typedef Vector<TScalarType, NInputDimensions> InputVectorType;
00102 typedef Vector<TScalarType, NOutputDimensions> OutputVectorType;
00103
00105 typedef CovariantVector<TScalarType, NInputDimensions> InputCovariantVectorType;
00106 typedef CovariantVector<TScalarType, NOutputDimensions> OutputCovariantVectorType;
00107
00109 typedef vnl_vector_fixed<TScalarType, NInputDimensions> InputVnlVectorType;
00110 typedef vnl_vector_fixed<TScalarType, NOutputDimensions> OutputVnlVectorType;
00111
00113 typedef Point<TScalarType, NInputDimensions> InputPointType;
00114 typedef Point<TScalarType, NOutputDimensions> OutputPointType;
00115
00117 virtual OutputPointType TransformPoint(const InputPointType & ) const
00118 { return OutputPointType(); }
00119
00121 virtual OutputVectorType TransformVector(const InputVectorType &) const
00122 { return OutputVectorType(); }
00123
00125 virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &) const
00126 { return OutputVnlVectorType(); }
00127
00129 virtual OutputCovariantVectorType TransformCovariantVector(
00130 const InputCovariantVectorType &) const
00131 { return OutputCovariantVectorType(); }
00132
00140 virtual void SetParameters( const ParametersType & )
00141 { itkExceptionMacro( << "Subclasses should override this method" ) };
00142
00150 virtual void SetParametersByValue ( const ParametersType & p )
00151 { this->SetParameters ( p ); };
00152
00154 virtual const ParametersType& GetParameters(void) const
00155 { itkExceptionMacro( << "Subclasses should override this method" );
00156 return m_Parameters; };
00157
00159 virtual void SetFixedParameters( const ParametersType & )
00160 { itkExceptionMacro( << "Subclasses should override this method" ) };
00161
00163 virtual const ParametersType& GetFixedParameters(void) const
00164 { itkExceptionMacro( << "Subclasses should override this method" );
00165 return m_Parameters; };
00166
00194 virtual const JacobianType & GetJacobian(const InputPointType &) const
00195 { itkExceptionMacro( << "Subclass should override this method" );
00196 return m_Jacobian; };
00197
00198
00200 virtual unsigned int GetNumberOfParameters(void) const
00201 { return m_Parameters.Size(); }
00202
00205 bool GetInverse(Self*) const {return false;}
00206
00208 virtual std::string GetTransformTypeAsString() const;
00209
00210 protected:
00211 Transform();
00212 Transform(unsigned int Dimension, unsigned int NumberOfParameters);
00213 virtual ~Transform() {};
00214
00215
00216 mutable ParametersType m_Parameters;
00217 mutable ParametersType m_FixedParameters;
00218 mutable JacobianType m_Jacobian;
00219
00220 private:
00221 Transform(const Self&);
00222 void operator=(const Self&);
00223
00224
00225 };
00226
00227 }
00228
00229 #ifndef ITK_MANUAL_INSTANTIATION
00230 #include "itkTransform.txx"
00231 #endif
00232
00233 #endif
00234
00235
00236