Orfeo Toolbox  3.16
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::FrequencyType FrequencyType;
50  typedef typename itk::NumericTraits<MeasurementType>::RealType RealType;
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 
79 protected:
80 
83  void PrintSelf(std::ostream& os, itk::Indent indent) const;
84 
86  void GenerateData();
87 
89  void CalculateEntropy();
90 
92  void CalculateMean();
93 
95  void CalculateCovariance();
96 
97 private:
98 
103 
105  typename TInputHistogram::ConstPointer m_InputHistogram;
106 
107 }; // end of class
108 
109 } // end of namespace otb
110 
111 #ifndef OTB_MANUAL_INSTANTIATION
113 #endif
114 
115 #endif

Generated at Sun Feb 3 2013 00:25:29 for Orfeo Toolbox with doxygen 1.8.1.1