ITK  6.0.0
Insight Toolkit
itkMixtureModelComponentBase.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 itkMixtureModelComponentBase_h
19#define itkMixtureModelComponentBase_h
20
21#include "vnl/vnl_vector.h"
22#include "vnl/vnl_matrix.h"
23
24#include "itkArray.h"
25#include "itkObject.h"
27
28namespace itk
29{
30namespace Statistics
31{
56template <typename TSample>
57class ITK_TEMPLATE_EXPORT MixtureModelComponentBase : public Object
58{
59public:
65
67 itkOverrideGetNameOfClassMacro(MixtureModelComponentBase);
68
69 using MeasurementVectorType = typename TSample::MeasurementVectorType;
70 using MeasurementVectorSizeType = typename TSample::MeasurementVectorSizeType;
71
74
77
79
81 virtual void
82 SetSample(const TSample * sample);
83
85 const TSample *
86 GetSample() const;
87
94
95 void
97 {
98 m_MinimalParametersChange = change;
99 }
100
101 double
103 {
104 return m_MinimalParametersChange;
105 }
106
107 virtual void
108 SetParameters(const ParametersType & parameters);
109
110 virtual ParametersType
112 {
113 return m_Parameters;
114 }
115
118 void
120
122 bool
124
126 void
127 SetWeight(unsigned int index, double value);
128
130 double
131 GetWeight(unsigned int index) const;
132
134 double
136
138 itkGetConstReferenceMacro(Weights, WeightArrayType);
139
140 virtual void
142
143protected:
145 ~MixtureModelComponentBase() override = default;
146 void
147 PrintSelf(std::ostream & os, Indent indent) const override;
148
152 void
154
155 virtual void
157
158private:
160 const TSample * m_Sample{};
161
162 double m_MinimalParametersChange{};
163
164 ParametersType m_Parameters{};
165
167 MembershipFunctionType * m_MembershipFunction{};
168
170 WeightArrayType m_Weights{};
171
173 bool m_ParametersModified{};
174}; // end of class
175} // end of namespace Statistics
176} // end of namespace itk
177
178#ifndef ITK_MANUAL_INSTANTIATION
179# include "itkMixtureModelComponentBase.hxx"
180#endif
181
182#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
MembershipFunctionBase defines common interfaces for membership functions.
base class for distribution modules that supports analytical way to update the distribution parameter...
virtual void SetSample(const TSample *sample)
typename TSample::MeasurementVectorType MeasurementVectorType
double GetWeight(unsigned int index) const
virtual void SetParameters(const ParametersType &parameters)
MembershipFunctionType * GetMembershipFunction()
typename TSample::MeasurementVectorSizeType MeasurementVectorSizeType
void SetWeight(unsigned int index, double value)
void SetMembershipFunction(MembershipFunctionType *function)
double Evaluate(MeasurementVectorType &measurements)
void PrintSelf(std::ostream &os, Indent indent) const override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....