ITK  5.2.0
Insight Toolkit
itkMahalanobisDistanceMembershipFunction.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  * http://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 itkMahalanobisDistanceMembershipFunction_h
19 #define itkMahalanobisDistanceMembershipFunction_h
20 
21 #include "itkVariableSizeMatrix.h"
22 
24 
25 namespace itk
26 {
27 namespace Statistics
28 {
61 template <typename TVector>
62 class ITK_TEMPLATE_EXPORT MahalanobisDistanceMembershipFunction : public MembershipFunctionBase<TVector>
63 {
64 public:
70 
73  itkNewMacro(Self);
75 
78 
80  using MeasurementVectorType = TVector;
81 
83  using MeasurementVectorSizeType = typename Superclass::MeasurementVectorSizeType;
84 
89 
92 
95  void
96  SetMean(const MeanVectorType & mean);
97 
100  itkGetConstReferenceMacro(Mean, MeanVectorType);
101 
105  void
106  SetCovariance(const CovarianceMatrixType & cov);
107 
110  itkGetConstReferenceMacro(Covariance, CovarianceMatrixType);
111 
117  double
118  Evaluate(const MeasurementVectorType & measurement) const override;
119 
123  typename LightObject::Pointer
124  InternalClone() const override;
125 
126 protected:
128  ~MahalanobisDistanceMembershipFunction() override = default;
129  void
130  PrintSelf(std::ostream & os, Indent indent) const override;
131 
132 private:
134  CovarianceMatrixType m_Covariance; // covariance matrix
135 
136  // inverse covariance matrix. automatically calculated
137  // when covariance matirx is set.
139 
142 };
143 } // end of namespace Statistics
144 } // end namespace itk
145 
146 #ifndef ITK_MANUAL_INSTANTIATION
147 # include "itkMahalanobisDistanceMembershipFunction.hxx"
148 #endif
149 
150 #endif
itk::Statistics::MahalanobisDistanceMembershipFunction::MeasurementVectorRealType
typename itk::NumericTraits< MeasurementVectorType >::RealType MeasurementVectorRealType
Definition: itkMahalanobisDistanceMembershipFunction.h:87
itkVariableSizeMatrix.h
itk::Statistics::MahalanobisDistanceMembershipFunction::MeasurementVectorType
TVector MeasurementVectorType
Definition: itkMahalanobisDistanceMembershipFunction.h:80
itk::Statistics::MembershipFunctionBase
MembershipFunctionBase defines common interfaces for membership functions.
Definition: itkMembershipFunctionBase.h:58
itk::Statistics::MahalanobisDistanceMembershipFunction::MeasurementVectorSizeType
typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
Definition: itkMahalanobisDistanceMembershipFunction.h:83
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Statistics::MahalanobisDistanceMembershipFunction::MembershipFunctionPointer
typename Superclass::Pointer MembershipFunctionPointer
Definition: itkMahalanobisDistanceMembershipFunction.h:77
itk::VariableSizeMatrix< double >
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::Statistics::MahalanobisDistanceMembershipFunction::m_InverseCovariance
CovarianceMatrixType m_InverseCovariance
Definition: itkMahalanobisDistanceMembershipFunction.h:138
itkMembershipFunctionBase.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Statistics::MahalanobisDistanceMembershipFunction::m_Mean
MeanVectorType m_Mean
Definition: itkMahalanobisDistanceMembershipFunction.h:133
itk::Statistics::MahalanobisDistanceMembershipFunction::m_Covariance
CovarianceMatrixType m_Covariance
Definition: itkMahalanobisDistanceMembershipFunction.h:134
itk::Statistics::MahalanobisDistanceMembershipFunction::MeanVectorType
MeasurementVectorRealType MeanVectorType
Definition: itkMahalanobisDistanceMembershipFunction.h:88
itk::NumericTraits::RealType
double RealType
Definition: itkNumericTraits.h:84
itk::Statistics::MahalanobisDistanceMembershipFunction::m_CovarianceNonsingular
bool m_CovarianceNonsingular
Definition: itkMahalanobisDistanceMembershipFunction.h:141
itk::Statistics::MahalanobisDistanceMembershipFunction
MahalanobisDistanceMembershipFunction models class membership using Mahalanobis distance.
Definition: itkMahalanobisDistanceMembershipFunction.h:62