OTB  6.7.0
Orfeo Toolbox
otbListSampleToVariableDimensionHistogramGenerator.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbListSampleToVariableDimensionHistogramGenerator_h
23 #define otbListSampleToVariableDimensionHistogramGenerator_h
24 
25 #include "itkProcessObject.h"
26 #include "itkHistogram.h"
27 #include "itkStatisticsAlgorithm.h"
28 
29 namespace otb {
30 
48 template<class TListSample,
49  class THistogramMeasurement,
50  class TFrequencyContainer = itk::Statistics::DenseFrequencyContainer2>
52  public itk::ProcessObject
53 {
54 public:
60 
63 
65  itkNewMacro(Self);
66 
68  typedef TListSample ListSampleType;
69 
73 
75  TFrequencyContainer> HistogramType;
76 
79 
83 
84  // Set/Get the input list sample
85  void SetListSample(const ListSampleType* inputlist);
86  const ListSampleType* GetListSample() const;
87 
88  // Get the output histogram
89  const HistogramType* GetOutput();
90 
91  void SetMarginalScale(float scale)
92  { m_MarginalScale = scale; }
93 
95  { m_Sizes = sizes; }
96 
97  itkSetMacro(AutoMinMax, bool);
98  itkGetConstReferenceMacro(AutoMinMax, bool);
99 
100  void SetHistogramMin(const MeasurementVectorType& histogramMin)
101  {
102  m_HistogramMin = histogramMin;
103  m_AutoMinMax = false;
104  }
105 
106  void SetHistogramMax(const MeasurementVectorType& histogramMax)
107  {
108  m_HistogramMax = histogramMax;
109  m_AutoMinMax = false;
110  }
111 
112 protected:
115  void GenerateData() override;
116  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
117  DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override;
118  using Superclass::MakeOutput;
119 
120 private:
126 
127 }; // end of class
128 
129 } // end of namespace itk
130 
131 #ifndef OTB_MANUAL_INSTANTIATION
133 #endif
134 
135 #endif
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Superclass::MeasurementVectorType MeasurementVectorType
itk::NumericTraits< THistogramMeasurement >::RealType HistogramMeasurementRealType
itk::Statistics::Histogram< HistogramMeasurementRealType, TFrequencyContainer > HistogramType