itkIdentityTransform.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 #ifndef __itkIdentityTransform_h
00018 #define __itkIdentityTransform_h
00019
00020 #include "itkObject.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 #include "itkTransform.h"
00028
00029 #include "itkObjectFactory.h"
00030
00031
00032 namespace itk
00033 {
00034
00054 template <class TScalarType,
00055 unsigned int NDimensions=3>
00056 class ITK_EXPORT IdentityTransform : public Transform<TScalarType,NDimensions,NDimensions>
00057 {
00058 public:
00060 typedef IdentityTransform Self;
00061 typedef Transform<TScalarType,NDimensions,NDimensions> Superclass;
00062 typedef SmartPointer< Self > Pointer;
00063 typedef SmartPointer< const Self > ConstPointer;
00064
00066 itkNewMacro(Self);
00067
00069 itkTypeMacro( IdentityTransform, Transform );
00070
00072 itkStaticConstMacro(InputSpaceDimension, unsigned int, NDimensions);
00073 itkStaticConstMacro(OutputSpaceDimension, unsigned int, NDimensions);
00075
00077 typedef TScalarType ScalarType;
00078
00080 typedef typename Superclass::ParametersType ParametersType;
00081
00083 typedef typename Superclass::JacobianType JacobianType;
00084
00086 typedef Vector<TScalarType,
00087 itkGetStaticConstMacro(InputSpaceDimension)> InputVectorType;
00088 typedef Vector<TScalarType,
00089 itkGetStaticConstMacro(OutputSpaceDimension)> OutputVectorType;
00091
00093 typedef CovariantVector<TScalarType,
00094 itkGetStaticConstMacro(InputSpaceDimension)> InputCovariantVectorType;
00095 typedef CovariantVector<TScalarType,
00096 itkGetStaticConstMacro(OutputSpaceDimension)> OutputCovariantVectorType;
00098
00100 typedef vnl_vector_fixed<TScalarType,
00101 itkGetStaticConstMacro(InputSpaceDimension)> InputVnlVectorType;
00102 typedef vnl_vector_fixed<TScalarType,
00103 itkGetStaticConstMacro(OutputSpaceDimension)> OutputVnlVectorType;
00105
00107 typedef Point<TScalarType,
00108 itkGetStaticConstMacro(InputSpaceDimension)> InputPointType;
00109 typedef Point<TScalarType,
00110 itkGetStaticConstMacro(OutputSpaceDimension)> OutputPointType;
00112
00115 typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
00116 typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
00117
00119 virtual OutputPointType TransformPoint(const InputPointType &point ) const
00120 { return point; }
00121
00123 virtual OutputVectorType TransformVector(const InputVectorType &vector) const
00124 { return vector; }
00125
00127 virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const
00128 { return vector; }
00129
00131 virtual OutputCovariantVectorType TransformCovariantVector(
00132 const InputCovariantVectorType &vector) const
00133 { return vector; }
00134
00139 void SetIdentity( void ) { }
00140
00169 virtual const JacobianType & GetJacobian(const InputPointType & ) const
00170 {
00171 return this->m_Jacobian;
00172 }
00173
00175 virtual InverseTransformBasePointer GetInverseTransform() const
00176 {
00177 return this->New().GetPointer();
00178 }
00179
00185 virtual bool IsLinear() const { return true; }
00186
00188 virtual const ParametersType& GetFixedParameters(void) const
00189 {
00190 return this->m_FixedParameters;
00191 }
00192
00194 virtual void SetFixedParameters( const ParametersType & ) {}
00195
00197 virtual const ParametersType& GetParameters(void) const
00198 {
00199 return this->m_Parameters;
00200 }
00201
00203 virtual void SetParameters( const ParametersType & ) {}
00204
00205
00206 protected:
00207 IdentityTransform():Transform<TScalarType,NDimensions,NDimensions>(NDimensions,1)
00208 {
00209
00210 this->m_Jacobian = JacobianType(NDimensions,1);
00211 this->m_Jacobian.Fill(0.0);
00212 }
00213 virtual ~IdentityTransform() {}
00214
00215 private:
00216 IdentityTransform(const Self&);
00217 void operator=(const Self&);
00218 };
00219
00220 }
00221
00222 #endif
00223