OTB  10.0.0
Orfeo Toolbox
otbGaussianModelComponent.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
3  * Copyright (C) 2007-2012 Institut Mines Telecom / Telecom Bretagne
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 otbGaussianModelComponent_h
23 #define otbGaussianModelComponent_h
24 
25 #include "itkCovarianceSampleFilter.h"
26 #include "itkGaussianMembershipFunction.h"
27 
28 #include "otbModelComponentBase.h"
29 
30 namespace otb
31 {
32 namespace Statistics
33 {
34 
47 template <class TSample>
48 class ITK_EXPORT GaussianModelComponent : public ModelComponentBase<TSample>
49 {
50 public:
54  typedef itk::SmartPointer<Self> Pointer;
55  typedef itk::SmartPointer<const Self> ConstPointer;
56 
58  itkNewMacro(Self);
61 
63  typedef typename Superclass::MeasurementVectorType MeasurementVectorType;
64  typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType;
65  typedef typename Superclass::MembershipFunctionType MembershipFunctionType;
66  typedef typename Superclass::ParametersType ParametersType;
67 
69  typedef itk::Statistics::GaussianMembershipFunction<MeasurementVectorType> NativeMembershipFunctionType;
70  typedef typename NativeMembershipFunctionType::MeanVectorType MeanVectorType;
71 
74  typedef itk::Statistics::CovarianceSampleFilter<TSample> CovarianceEstimatorType;
75 
78  typedef typename CovarianceEstimatorType::MatrixType CovarianceType;
79 
81  void SetSample(const TSample* sample) override;
82 
85  void SetParameters(const ParametersType& parameters);
86 
88  void ShowParameters(std::ostream& os, itk::Indent indent) const override;
89 
90 protected:
93  {
94  }
95  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
96 
97  void GenerateData() override;
98 
99 private:
100  GaussianModelComponent(const Self&) = delete;
101  void operator=(const Self&) = delete;
102 
103  typename NativeMembershipFunctionType::Pointer m_GaussianMembershipFunction;
104  // TODO add a m_GaussianCumulativeFunction
105  typename CovarianceEstimatorType::Pointer m_CovarianceEstimator;
106 
109 
110 }; // end of class
111 
112 } // end of namespace Statistics
113 } // end of namespace otb
114 
115 #ifndef OTB_MANUAL_INSTANTIATION
117 #endif
118 
119 #endif
is a component (derived from ModelComponentBase) for Gaussian class. This class is used in SEMClassif...
void operator=(const Self &)=delete
Superclass::MeasurementVectorType MeasurementVectorType
itk::Statistics::GaussianMembershipFunction< MeasurementVectorType > NativeMembershipFunctionType
NativeMembershipFunctionType::MeanVectorType MeanVectorType
itk::SmartPointer< const Self > ConstPointer
itk::Statistics::CovarianceSampleFilter< TSample > CovarianceEstimatorType
Superclass::MembershipFunctionType MembershipFunctionType
CovarianceEstimatorType::MatrixType CovarianceType
Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
NativeMembershipFunctionType::Pointer m_GaussianMembershipFunction
CovarianceEstimatorType::Pointer m_CovarianceEstimator
GaussianModelComponent(const Self &)=delete
base class for distribution representation that supports analytical way to update the distribution pa...
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.