Orfeo Toolbox  4.2
otbSarParametricMapFunction.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 __otbSarParametricMapFunction_h
19 #define __otbSarParametricMapFunction_h
20 
21 #include "itkNumericTraits.h"
22 #include "itkImageFunction.h"
23 #include "itkPointSet.h"
24 #include "itkPoint.h"
25 #include "itkVariableSizeMatrix.h"
26 
27 namespace otb
28 {
29 
39 template <class TInputImage, class TCoordRep = float>
40 class ITK_EXPORT SarParametricMapFunction :
41  public itk::ImageFunction<TInputImage, typename itk::NumericTraits<typename TInputImage::PixelType>::ScalarRealType,
42  TCoordRep>
43 {
44 public:
48  TCoordRep> Superclass;
51 
54 
56  itkNewMacro(Self);
57 
59  typedef TInputImage InputImageType;
60  typedef typename InputImageType::PixelType InputPixelType;
62  typedef typename Superclass::IndexType IndexType;
64 
65  itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);
66 
72 
74 
77 
79  virtual RealType Evaluate(const PointType& point) const;
80 
82  virtual RealType EvaluateAtIndex(const IndexType& index) const
83  {
84  PointType point;
85  point[0] = static_cast<typename PointType::ValueType>(index[0]);
86  point[1] = static_cast<typename PointType::ValueType>(index[1]);
87  return this->Evaluate(point);
88  }
89 
90  virtual RealType EvaluateAtContinuousIndex(
91  const ContinuousIndexType& cindex) const
92  {
93  IndexType index;
94  this->ConvertContinuousIndexToNearestIndex(cindex, index);
95  return this->EvaluateAtIndex(index);
96  }
97 
99  itkGetObjectMacro(PointSet, PointSetType);
100  itkGetConstObjectMacro(PointSet, PointSetType);
101  void SetPointSet(PointSetPointer val)
102  {
103  m_IsInitialize = false;
104  m_PointSet = val;
105  this->Modified();
106  }
107 
109  itkSetMacro(Coeff, MatrixType);
110  itkGetMacro(Coeff, MatrixType);
111  itkGetConstMacro(Coeff, MatrixType);
112 
114  itkGetConstReferenceMacro(IsInitialize, bool);
115 
117  void SetPolynomalSize(const IndexType PolynomalSize);
118 
120  void EvaluateParametricCoefficient();
121 
123  void SetConstantValue(const RealType& value);
124 
125 protected:
128  void PrintSelf(std::ostream& os, itk::Indent indent) const;
129 
130 private:
131  SarParametricMapFunction(const Self &); //purposely not implemented
132  void operator =(const Self&); //purposely not implemented
133 
134  double Horner(PointType point) const;
135 
139  double m_ProductWidth;
141 };
142 
143 } // end namespace otb
144 
145 #ifndef OTB_MANUAL_INSTANTIATION
147 #endif
148 
149 #endif

Generated at Sat Aug 30 2014 16:23:20 for Orfeo Toolbox with doxygen 1.8.3.1