ITK  5.2.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  * 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 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 
72 
73  using FixedPointSetType = TFixedPointSet;
74  using FixedPointSetPointer = typename FixedPointSetType::Pointer;
75  using MovingPointSetType = TMovingPointSet;
76  using MovingPointSetPointer = typename MovingPointSetType::Pointer;
77 
79  using MeasureType = typename Superclass::MeasureType;
80  using DerivativeType = typename Superclass::DerivativeType;
81  using LocalDerivativeType = typename Superclass::LocalDerivativeType;
82  using PointType = typename Superclass::PointType;
83  using PointIdentifier = 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);
122 
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 
159  std::vector<PointSetMetricPointer> m_PointSetMetricClones;
160 
164 };
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 # include "itkLabeledPointSetToPointSetMetricv4.hxx"
169 #endif
170 
171 #endif
itk::LabeledPointSetToPointSetMetricv4::FixedPointSetPointer
typename FixedPointSetType::Pointer FixedPointSetPointer
Definition: itkLabeledPointSetToPointSetMetricv4.h:74
itk::LabeledPointSetToPointSetMetricv4::LocalDerivativeType
typename Superclass::LocalDerivativeType LocalDerivativeType
Definition: itkLabeledPointSetToPointSetMetricv4.h:81
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::LabeledPointSetToPointSetMetricv4::m_FixedPointSetLabels
LabelSetType m_FixedPointSetLabels
Definition: itkLabeledPointSetToPointSetMetricv4.h:161
itk::Concept::IsInteger
Definition: itkConceptChecking.h:874
itk::LabeledPointSetToPointSetMetricv4::m_CommonPointSetLabels
LabelSetType m_CommonPointSetLabels
Definition: itkLabeledPointSetToPointSetMetricv4.h:163
itk::LabeledPointSetToPointSetMetricv4::m_PointSetMetricClones
std::vector< PointSetMetricPointer > m_PointSetMetricClones
Definition: itkLabeledPointSetToPointSetMetricv4.h:159
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::LabeledPointSetToPointSetMetricv4::MovingPointSetPointer
typename MovingPointSetType::Pointer MovingPointSetPointer
Definition: itkLabeledPointSetToPointSetMetricv4.h:76
itkPointSetToPointSetMetricv4.h
itk::LabeledPointSetToPointSetMetricv4::PointIdentifier
typename Superclass::PointIdentifier PointIdentifier
Definition: itkLabeledPointSetToPointSetMetricv4.h:83
itk::LabeledPointSetToPointSetMetricv4::LabelSetType
std::vector< LabelType > LabelSetType
Definition: itkLabeledPointSetToPointSetMetricv4.h:86
itk::ObjectToObjectMetricBaseTemplate::MeasureType
typename Superclass::MeasureType MeasureType
Definition: itkObjectToObjectMetricBase.h:109
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
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::PointType
typename Superclass::PointType PointType
Definition: itkLabeledPointSetToPointSetMetricv4.h:82
itk::LabeledPointSetToPointSetMetricv4::FixedPointSetType
TFixedPointSet FixedPointSetType
Definition: itkLabeledPointSetToPointSetMetricv4.h:73
itk::ObjectToObjectMetricBaseTemplate::DerivativeType
typename Superclass::DerivativeType DerivativeType
Definition: itkObjectToObjectMetricBase.h:112
itk::LabeledPointSetToPointSetMetricv4::LabelType
typename Superclass::PixelType LabelType
Definition: itkLabeledPointSetToPointSetMetricv4.h:85
itk::LabeledPointSetToPointSetMetricv4::m_PointSetMetric
PointSetMetricPointer m_PointSetMetric
Definition: itkLabeledPointSetToPointSetMetricv4.h:158
itk::PointSetToPointSetMetricv4
Computes similarity between two point sets.
Definition: itkPointSetToPointSetMetricv4.h:70
itk::LabeledPointSetToPointSetMetricv4::m_MovingPointSetLabels
LabelSetType m_MovingPointSetLabels
Definition: itkLabeledPointSetToPointSetMetricv4.h:162