ITK  5.4.0
Insight Toolkit
itkLabeledPointSetToPointSetMetricv4.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 itkLabeledPointSetToPointSetMetricv4_h
19 #define itkLabeledPointSetToPointSetMetricv4_h
20 
22 
23 #include <vector>
24 
25 namespace itk
26 {
52 template <typename TFixedPointSet,
53  typename TMovingPointSet = TFixedPointSet,
54  class TInternalComputationValueType = double>
55 class ITK_TEMPLATE_EXPORT LabeledPointSetToPointSetMetricv4
56  : public PointSetToPointSetMetricv4<TFixedPointSet, TMovingPointSet, TInternalComputationValueType>
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_MOVE(LabeledPointSetToPointSetMetricv4);
60 
66 
68  itkNewMacro(Self);
69 
71  itkOverrideGetNameOfClassMacro(LabeledPointSetToPointSetMetricv4);
72 
73  using FixedPointSetType = TFixedPointSet;
75  using MovingPointSetType = TMovingPointSet;
77 
79  using typename Superclass::MeasureType;
80  using typename Superclass::DerivativeType;
81  using typename Superclass::LocalDerivativeType;
82  using typename Superclass::PointType;
83  using typename Superclass::PointIdentifier;
84 
85  using LabelType = typename Superclass::PixelType;
86  using LabelSetType = std::vector<LabelType>;
87 
90 
95  void
96  Initialize() override;
97 
103  GetLocalNeighborhoodValue(const PointType &, const LabelType &) const override;
104 
109  void
110  GetLocalNeighborhoodValueAndDerivative(const PointType &,
111  MeasureType &,
113  const LabelType &) const override;
114 
119  itkSetObjectMacro(PointSetMetric, PointSetMetricType);
120  itkGetModifiableObjectMacro(PointSetMetric, PointSetMetricType);
126  itkConceptMacro(LabelTypeIsInteger, (Concept::IsInteger<LabelType>));
127 
128 protected:
130  ~LabeledPointSetToPointSetMetricv4() override = default;
131 
133  void
134  PrintSelf(std::ostream & os, Indent indent) const override;
135 
136 private:
141  void
142  DetermineCommonPointSetLabels();
143 
149  GetLabeledFixedPointSet(const LabelType) const;
150 
156  GetLabeledMovingPointSet(const LabelType) const;
157 
158  PointSetMetricPointer m_PointSetMetric{};
159  std::vector<PointSetMetricPointer> m_PointSetMetricClones{};
160 
161  LabelSetType m_FixedPointSetLabels{};
162  LabelSetType m_MovingPointSetLabels{};
163  LabelSetType m_CommonPointSetLabels{};
164 };
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 # include "itkLabeledPointSetToPointSetMetricv4.hxx"
169 #endif
170 
171 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::LabeledPointSetToPointSetMetricv4::FixedPointSetPointer
typename FixedPointSetType::Pointer FixedPointSetPointer
Definition: itkLabeledPointSetToPointSetMetricv4.h:74
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::LabeledPointSetToPointSetMetricv4
Computes the distance metric and gradient between two labeled point sets.
Definition: itkLabeledPointSetToPointSetMetricv4.h:55
itk::LabeledPointSetToPointSetMetricv4::PointSetMetricPointer
typename PointSetMetricType::Pointer PointSetMetricPointer
Definition: itkLabeledPointSetToPointSetMetricv4.h:89
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Concept::IsInteger
Definition: itkConceptChecking.h:875
itk::SingleValuedCostFunctionv4Template::MeasureType
TInternalComputationValueType MeasureType
Definition: itkSingleValuedCostFunctionv4.h:67
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::LabeledPointSetToPointSetMetricv4::MovingPointSetPointer
typename MovingPointSetType::Pointer MovingPointSetPointer
Definition: itkLabeledPointSetToPointSetMetricv4.h:76
itkPointSetToPointSetMetricv4.h
itk::FixedArray
Simulate a standard C array with copy semantics.
Definition: itkFixedArray.h:53
itk::LabeledPointSetToPointSetMetricv4::LabelSetType
std::vector< LabelType > LabelSetType
Definition: itkLabeledPointSetToPointSetMetricv4.h:86
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::LabeledPointSetToPointSetMetricv4::MovingPointSetType
TMovingPointSet MovingPointSetType
Definition: itkLabeledPointSetToPointSetMetricv4.h:75
itk::LabeledPointSetToPointSetMetricv4::FixedPointSetType
TFixedPointSet FixedPointSetType
Definition: itkLabeledPointSetToPointSetMetricv4.h:73
Superclass
BinaryGeneratorImageFilter< TInputImage1, TInputImage2, TOutputImage > Superclass
Definition: itkAddImageFilter.h:90
itk::PointSetToPointSetMetricWithIndexv4::PointType
FixedPointType PointType
Definition: itkPointSetToPointSetMetricWithIndexv4.h:152
itk::LabeledPointSetToPointSetMetricv4::LabelType
typename Superclass::PixelType LabelType
Definition: itkLabeledPointSetToPointSetMetricv4.h:85
itk::PointSetToPointSetMetricv4
Computes similarity between two point sets.
Definition: itkPointSetToPointSetMetricv4.h:68