Orfeo Toolbox  4.0
otbTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbTransform_h
19 #define __otbTransform_h
20 
21 #include "itkTransform.h"
22 #include "itkVector.h"
23 #include "vnl/vnl_vector_fixed.h"
24 
25 
26 namespace otb
27 {
33 template< class TScalarType,
34  unsigned int NInputDimensions = 3,
35  unsigned int NOutputDimensions = 3 >
36 class ITK_EXPORT Transform : public itk::Transform<TScalarType, // Data type for scalars
37  NInputDimensions, // Number of dimensions in the input space
38  NOutputDimensions> // Number of dimensions in the output space
39 {
40 public:
42  typedef Transform Self;
43  typedef itk::Transform<TScalarType,
44  NInputDimensions,
45  NOutputDimensions> Superclass;
48 
50  itkTypeMacro(Transform, itk::Transform);
51 
53  itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions);
54  itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions);
55 
57  unsigned int GetInputSpaceDimension(void) const { return NInputDimensions; }
58 
60  unsigned int GetOutputSpaceDimension(void) const { return NOutputDimensions; }
61 
63  typedef TScalarType ScalarType;
64 
66  typedef typename Superclass::ParametersType ParametersType;
67  typedef typename Superclass::ParametersValueType ParametersValueType;
68  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
69 
72 
76 
80 
82  typedef vnl_vector_fixed< TScalarType, NInputDimensions > InputVnlVectorType;
83  typedef vnl_vector_fixed< TScalarType, NOutputDimensions > OutputVnlVectorType;
84 
88 
91  typedef typename Superclass::InverseTransformBaseType InverseTransformBaseType;
92 
93  typedef typename Superclass::InverseTransformBasePointer InverseTransformBasePointer;
94 
96  virtual OutputPointType TransformPoint(const InputPointType & ) const
97  { return OutputPointType(); }
98 
100  virtual OutputVectorType TransformVector(const InputVectorType &) const
101  { return OutputVectorType(); }
102 
104  virtual OutputVnlVectorType TransformVector(const InputVnlVectorType &) const
105  { return OutputVnlVectorType(); }
106 
108  virtual OutputCovariantVectorType TransformCovariantVector(
109  const InputCovariantVectorType &) const
110  { return OutputCovariantVectorType(); }
111 
119  virtual void SetParameters( const ParametersType & )
120  { itkExceptionMacro( << "Subclasses should override this method (SetParameters)" ) }
121 
129  virtual void SetParametersByValue(const ParametersType & p)
130  { this->SetParameters (p); }
131 
133  virtual const ParametersType & GetParameters(void) const
134  {
135  return m_Parameters;
136  }
137 
139  virtual void SetFixedParameters( const ParametersType & )
140  { itkExceptionMacro( << "Subclasses should override this method (SetFixedParameters)" ) }
141 
143  virtual const ParametersType& GetFixedParameters(void) const
144  {
145  itkExceptionMacro( << "Subclasses should override this method (GetFixedParameters)" );
146  // Next line is needed to avoid errors due to:
147  // "function must return a value".
148  return this->m_FixedParameters;
149  }
150 
178  virtual const JacobianType & GetJacobian(const InputPointType &) const
179  {
180  itkExceptionMacro( << "Subclass should override this method (GetJacobian)" );
181  // Next line is needed to avoid errors due to:
182  // "function must return a value" .
183  return this->m_Jacobian;
184  }
185 
187  virtual NumberOfParametersType GetNumberOfParameters(void) const
188  { return this->m_Parameters.Size(); }
189 
190 protected:
192  {}
193 
194  Transform(NumberOfParametersType numberOfParameters)
195  : Superclass::Transform(numberOfParameters)
196  {}
197 
198  virtual ~Transform() {}
199 
200  void PrintSelf(std::ostream& os, itk::Indent indent) const
201  {
202  Superclass::PrintSelf(os, indent);
203 #if 0
204  os << indent << "Parameters : " << m_Parameters << std::endl;
205  os << indent << "FixedParameters : " << m_FixedParameters << std::endl;
206  os << indent << "Jacobian : " << m_Jacobian << std::endl;
207 #endif
208  }
209 
210 
213 
215 private:
216  Transform(const Self &); //purposely not implemented
217  void operator=(const Self &); //purposely not implemented
218 };
219 } // end namespace otb
220 
221 #endif

Generated at Sat Mar 8 2014 16:22:48 for Orfeo Toolbox with doxygen 1.8.3.1