OTB  9.0.0
Orfeo Toolbox
otbGaussianModelComponent.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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
otbModelComponentBase.h
otbGaussianModelComponent.hxx
otb::Statistics::GaussianModelComponent
is a component (derived from ModelComponentBase) for Gaussian class. This class is used in SEMClassif...
Definition: otbGaussianModelComponent.h:48
otb::Statistics::GaussianModelComponent::MeanVectorType
NativeMembershipFunctionType::MeanVectorType MeanVectorType
Definition: otbGaussianModelComponent.h:70
otb::Statistics::GaussianModelComponent::m_Covariance
CovarianceType m_Covariance
Definition: otbGaussianModelComponent.h:108
otb::Statistics::ModelComponentBase
base class for distribution representation that supports analytical way to update the distribution pa...
Definition: otbModelComponentBase.h:65
otb::Statistics::ModelComponentBase::ParametersType
itk::Array< double > ParametersType
Definition: otbModelComponentBase.h:85
otb::Statistics::GaussianModelComponent::m_CovarianceEstimator
CovarianceEstimatorType::Pointer m_CovarianceEstimator
Definition: otbGaussianModelComponent.h:105
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Statistics::GaussianModelComponent::MeasurementVectorSizeType
Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
Definition: otbGaussianModelComponent.h:64
otb::Statistics::GaussianModelComponent::MembershipFunctionType
Superclass::MembershipFunctionType MembershipFunctionType
Definition: otbGaussianModelComponent.h:65
otb::Statistics::GaussianModelComponent::CovarianceType
CovarianceEstimatorType::MatrixType CovarianceType
Definition: otbGaussianModelComponent.h:78
otb::Statistics::GaussianModelComponent::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbGaussianModelComponent.h:54
otb::Statistics::GaussianModelComponent::~GaussianModelComponent
~GaussianModelComponent() override
Definition: otbGaussianModelComponent.h:92
otb::Statistics::GaussianModelComponent::MeasurementVectorType
Superclass::MeasurementVectorType MeasurementVectorType
Definition: otbGaussianModelComponent.h:59
otb::Statistics::GaussianModelComponent::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbGaussianModelComponent.h:55
otb::Statistics::GaussianModelComponent::NativeMembershipFunctionType
itk::Statistics::GaussianMembershipFunction< MeasurementVectorType > NativeMembershipFunctionType
Definition: otbGaussianModelComponent.h:69
otb::Statistics::GaussianModelComponent::CovarianceEstimatorType
itk::Statistics::CovarianceSampleFilter< TSample > CovarianceEstimatorType
Definition: otbGaussianModelComponent.h:74
otb::Statistics::GaussianModelComponent::Superclass
ModelComponentBase< TSample > Superclass
Definition: otbGaussianModelComponent.h:53
otb::Statistics::GaussianModelComponent::Self
GaussianModelComponent Self
Definition: otbGaussianModelComponent.h:52
otb::Statistics::GaussianModelComponent::m_Mean
MeanVectorType m_Mean
Definition: otbGaussianModelComponent.h:107
otb::Statistics::GaussianModelComponent::m_GaussianMembershipFunction
NativeMembershipFunctionType::Pointer m_GaussianMembershipFunction
Definition: otbGaussianModelComponent.h:103
otb::Statistics::GaussianModelComponent::ParametersType
Superclass::ParametersType ParametersType
Definition: otbGaussianModelComponent.h:66