ITK  6.0.0
Insight Toolkit
itkDistanceToCentroidMembershipFunction.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 itkDistanceToCentroidMembershipFunction_h
19 #define itkDistanceToCentroidMembershipFunction_h
20 
22 #include "itkDistanceMetric.h"
23 
24 namespace itk
25 {
26 namespace Statistics
27 {
44 template <typename TVector>
45 class ITK_TEMPLATE_EXPORT DistanceToCentroidMembershipFunction : public MembershipFunctionBase<TVector>
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_MOVE(DistanceToCentroidMembershipFunction);
49 
55 
57  itkOverrideGetNameOfClassMacro(DistanceToCentroidMembershipFunction);
58  itkNewMacro(Self);
63 
65  using MeasurementVectorType = TVector;
66 
68  using typename Superclass::MeasurementVectorSizeType;
69 
71  void SetMeasurementVectorSize(MeasurementVectorSizeType) override;
72 
77 
79  itkSetObjectMacro(DistanceMetric, DistanceMetricType);
80 
82  itkGetModifiableObjectMacro(DistanceMetric, DistanceMetricType);
83 
89  void
90  SetCentroid(const CentroidType & centroid);
91 
93  const CentroidType &
94  GetCentroid() const;
95 
99  double
100  Evaluate(const MeasurementVectorType & measurement) const override;
101 
102 protected:
104  ~DistanceToCentroidMembershipFunction() override = default;
105  void
106  PrintSelf(std::ostream & os, Indent indent) const override;
107 
109  typename LightObject::Pointer
110  InternalClone() const override;
111 
112 private:
113  DistanceMetricPointer m_DistanceMetric{};
114 };
115 } // end of namespace Statistics
116 } // end namespace itk
117 
118 #ifndef ITK_MANUAL_INSTANTIATION
119 # include "itkDistanceToCentroidMembershipFunction.hxx"
120 #endif
121 
122 #endif
itk::Statistics::DistanceToCentroidMembershipFunction
DistanceToCentroidMembershipFunction models class membership using a distance metric.
Definition: itkDistanceToCentroidMembershipFunction.h:45
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itkDistanceMetric.h
itk::Statistics::DistanceMetric
this class declares common interfaces for distance functions.
Definition: itkDistanceMetric.h:48
itk::Statistics::DistanceToCentroidMembershipFunction::CentroidType
typename DistanceMetricType::OriginType CentroidType
Definition: itkDistanceToCentroidMembershipFunction.h:76
itk::Statistics::MembershipFunctionBase
MembershipFunctionBase defines common interfaces for membership functions.
Definition: itkMembershipFunctionBase.h:58
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::Statistics::DistanceToCentroidMembershipFunction::DistanceMetricPointer
typename DistanceMetricType::Pointer DistanceMetricPointer
Definition: itkDistanceToCentroidMembershipFunction.h:75
itkMembershipFunctionBase.h
itk::Statistics::DistanceToCentroidMembershipFunction::MeasurementVectorType
TVector MeasurementVectorType
Definition: itkDistanceToCentroidMembershipFunction.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Statistics::MembershipFunctionBase::MeasurementVectorSizeType
unsigned int MeasurementVectorSizeType
Definition: itkMembershipFunctionBase.h:76
itk::Array< double >
itk::Statistics::DistanceToCentroidMembershipFunction::MembershipFunctionPointer
typename Superclass::Pointer MembershipFunctionPointer
Definition: itkDistanceToCentroidMembershipFunction.h:62