ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkExpectationMaximizationMixtureModelEstimator.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkExpectationMaximizationMixtureModelEstimator_h
19#define itkExpectationMaximizationMixtureModelEstimator_h
20
21#include "ITKStatisticsExport.h"
25
26namespace itk::Statistics
27{
33{
34public:
38 enum class TERMINATION_CODE : uint8_t
39 {
42 };
43};
44// Define how to print enumeration
45extern ITKStatistics_EXPORT std::ostream &
47
81template <typename TSample>
82class ITK_TEMPLATE_EXPORT ExpectationMaximizationMixtureModelEstimator : public Object
83{
84public:
90
93 itkOverrideGetNameOfClassMacro(ExpectationMaximizationMixtureModelEstimator);
94 itkNewMacro(Self);
97 using SampleType = TSample;
98 using MeasurementType = typename TSample::MeasurementType;
99 using MeasurementVectorType = typename TSample::MeasurementVectorType;
100
104
106
109 using MembershipFunctionVectorType = std::vector<MembershipFunctionPointer>;
112
115
117 using ComponentVectorType = std::vector<ComponentType *>;
118
121
124
126 void
127 SetSample(const TSample * sample);
128
130 const TSample *
131 GetSample() const;
132
135 void
137
140
144
148
152
157 void
158 SetMaximumIteration(int numberOfIterations);
159
160 int
162
164 int
166 {
167 return m_CurrentIteration;
168 }
169
171 int
173
175 unsigned int
177
179 void
181
183#if !defined(ITK_LEGACY_REMOVE)
185 static constexpr TERMINATION_CODE_ENUM CONVERGED = TERMINATION_CODE_ENUM::CONVERGED;
186 static constexpr TERMINATION_CODE_ENUM NOT_CONVERGED = TERMINATION_CODE_ENUM::NOT_CONVERGED;
187#endif
188
192
196 GetComponentMembershipFunction(int componentIndex) const;
197
201 GetOutput() const;
202
203protected:
206 void
207 PrintSelf(std::ostream & os, Indent indent) const override;
208
209 bool
211
212 double
214
215 bool
217
218 bool
220
222 void
224
225private:
227 const TSample * m_Sample{};
228
229 int m_MaxIteration{ 100 };
231
232 TERMINATION_CODE_ENUM m_TerminationCode{ TERMINATION_CODE_ENUM::NOT_CONVERGED };
236
239}; // end of class
240} // namespace itk::Statistics
241
242#ifndef ITK_MANUAL_INSTANTIATION
243# include "itkExpectationMaximizationMixtureModelEstimator.hxx"
244#endif
245
246#endif
Array class with size defined at construction time.
Definition itkArray.h:48
Control indentation during Print() invocation.
Definition itkIndent.h:50
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Implements transparent reference counting.
Contains all enum classes used by ExpectationMaximizationMixtureModelEstimator class.
SimpleDataObjectDecorator< MembershipFunctionVectorType > MembershipFunctionVectorObjectType
void SetInitialProportions(ProportionVectorType &proportions)
const MembershipFunctionVectorObjectType * GetOutput() const
ExpectationMaximizationMixtureModelEstimatorEnums::TERMINATION_CODE TERMINATION_CODE_ENUM
void PrintSelf(std::ostream &os, Indent indent) const override
const MembershipFunctionsWeightsArrayObjectType * GetMembershipFunctionsWeightsArray() const
const ProportionVectorType & GetInitialProportions() const
typename MembershipFunctionsWeightsArrayObjectType::Pointer MembershipFunctionsWeightsArrayPointer
ComponentMembershipFunctionType * GetComponentMembershipFunction(int componentIndex) const
GaussianMembershipFunction models class membership through a multivariate Gaussian function.
MembershipFunctionBase defines common interfaces for membership functions.
base class for distribution modules that supports analytical way to update the distribution parameter...
ITKStatistics_EXPORT std::ostream & operator<<(std::ostream &out, const ExpectationMaximizationMixtureModelEstimatorEnums::TERMINATION_CODE value)