ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkGaussianMembershipFunction.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 itkGaussianMembershipFunction_h
19#define itkGaussianMembershipFunction_h
20
21#include "itkMatrix.h"
23
24namespace itk::Statistics
25{
52
53template <typename TMeasurementVector>
54class ITK_TEMPLATE_EXPORT GaussianMembershipFunction : public MembershipFunctionBase<TMeasurementVector>
55{
56public:
57 ITK_DISALLOW_COPY_AND_MOVE(GaussianMembershipFunction);
58
64
67 itkOverrideGetNameOfClassMacro(GaussianMembershipFunction);
68 itkNewMacro(Self);
72
74 using MeasurementVectorType = TMeasurementVector;
75
78
83
86
89 void
90 SetMean(const MeanVectorType & mean);
91
94 itkGetConstReferenceMacro(Mean, MeanVectorType);
95
100 void
102
103 /* Get the covariance matrix. Covariance matrix is a
104 VariableSizeMatrix of doubles. */
105 itkGetConstReferenceMacro(Covariance, CovarianceMatrixType);
106
107 /* Get the inverse covariance matrix. Covariance matrix is a
108 VariableSizeMatrix of doubles. */
109 itkGetConstReferenceMacro(InverseCovariance, CovarianceMatrixType);
110
112 double
113 Evaluate(const MeasurementVectorType & measurement) const override;
114
118 [[nodiscard]] typename LightObject::Pointer
119 InternalClone() const override;
120
121protected:
123 ~GaussianMembershipFunction() override = default;
124 void
125 PrintSelf(std::ostream & os, Indent indent) const override;
126
127private:
129 CovarianceMatrixType m_Covariance{}; // covariance matrix
130
131 // inverse covariance matrix. automatically calculated
132 // when covariance matrix is set.
134
135 // pre_factor (normalization term). automatically calculated
136 // when covariance matrix is set.
137 double m_PreFactor{};
138
141};
142} // namespace itk::Statistics
143
144#ifndef ITK_MANUAL_INSTANTIATION
145# include "itkGaussianMembershipFunction.hxx"
146#endif
147
148#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
SmartPointer< Self > Pointer
Implements transparent reference counting.
double Evaluate(const MeasurementVectorType &measurement) const override
void SetCovariance(const CovarianceMatrixType &cov)
LightObject::Pointer InternalClone() const override
void SetMean(const MeanVectorType &mean)
typename itk::NumericTraits< MeasurementVectorType >::RealType MeasurementVectorRealType
void PrintSelf(std::ostream &os, Indent indent) const override
A templated class holding a M x N size Matrix.