Orfeo Toolbox  4.0
otbHistogramStatisticsFunction.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 
19 #ifndef __otbHistogramStatisticsFunction_h
20 #define __otbHistogramStatisticsFunction_h
21 
23 
24 namespace otb
25 {
26 
37 template<class TInputHistogram, class TOutput>
39  public itk::HistogramAlgorithmBase<TInputHistogram>
40 {
41 public:
47 
48  typedef typename TInputHistogram::MeasurementType MeasurementType;
49  typedef typename TInputHistogram::AbsoluteFrequencyType FrequencyType; //FIXME several possibilities in the new framework
51 
53  itkTypeMacro(HistogramStatisticsFunction, HistogramAlgorithmsBase);
54  itkNewMacro(Self);
55 
57  typedef std::vector<TOutput> OutputType;
58 
61 
64 
67 
69  void SetInputHistogram(const TInputHistogram * histogram)
70  {
71  if (m_InputHistogram != histogram)
72  {
73  m_InputHistogram = histogram;
74  this->Modified();
75  m_IsModified = true;
76  }
77  }
78 
80  void Compute()
81  {
82  this->GenerateData();
83  }
84 
85 protected:
86 
89  void PrintSelf(std::ostream& os, itk::Indent indent) const;
90 
92  void GenerateData();
93 
95  void CalculateEntropy();
96 
98  void CalculateMean();
99 
101  void CalculateCovariance();
102 
103 
104 
105 private:
106 
111 
113  typename TInputHistogram::ConstPointer m_InputHistogram;
114 
115 }; // end of class
116 
117 } // end of namespace otb
118 
119 #ifndef OTB_MANUAL_INSTANTIATION
121 #endif
122 
123 #endif

Generated at Sat Mar 8 2014 15:57:48 for Orfeo Toolbox with doxygen 1.8.3.1