OTB  9.0.0
Orfeo Toolbox
otbEuclideanDistanceMetricWithMissingValuePow2.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  * Copyright (C) 2007-2012 Institut Mines Telecom / Telecom Bretagne
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 
23 #ifndef otbEuclideanDistanceMetricWithMissingValuePow2_h
24 #define otbEuclideanDistanceMetricWithMissingValuePow2_h
25 
26 #include "itkEuclideanDistanceMetric.h"
27 
28 namespace otb
29 {
30 
31 namespace Statistics
32 {
33 
52 template <class TVector>
53 class ITK_EXPORT EuclideanDistanceMetricWithMissingValuePow2 : public itk::Statistics::EuclideanDistanceMetric<TVector>
54 {
55 public:
58  typedef itk::Statistics::EuclideanDistanceMetric<TVector> Superclass;
59  typedef itk::SmartPointer<Self> Pointer;
60  typedef itk::SmartPointer<const Self> ConstPointer;
61  typedef typename Superclass::MeasurementVectorSizeType MeasurementVectorSizeType;
62 
64  itkTypeMacro(EuclideanDistanceMetricWithMissingValuePow2, EuclideanDistanceMetric);
65 
67  itkNewMacro(Self);
68 
70  typedef typename TVector::ValueType ValueType;
71 
73  double Evaluate(const TVector& x) const override;
74 
76  double Evaluate(const TVector& x1, const TVector& x2) const override;
77 
80  double Evaluate(const ValueType& a, const ValueType& b) const;
81 
84  bool IsWithinRange(const TVector& x, const double radius) const
85  {
86  return Superclass::IsWithinRange(x, radius);
87  }
88 
90  static bool IsMissingValue(const ValueType& v);
91 
93  static void SetToMissingValue(ValueType& v);
94 
95 protected:
97  {
98  }
100  {
101  }
102 }; // end of class
103 
104 } // end namespace statistics
105 
106 } // end namespace otb
107 
108 #ifndef OTB_MANUAL_INSTANTIATION
110 #endif
111 
112 #endif
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2::EuclideanDistanceMetricWithMissingValuePow2
EuclideanDistanceMetricWithMissingValuePow2()
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:96
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2::MeasurementVectorSizeType
Superclass::MeasurementVectorSizeType MeasurementVectorSizeType
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:61
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2::IsWithinRange
bool IsWithinRange(const TVector &x, const double radius) const
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:84
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2::Self
EuclideanDistanceMetricWithMissingValuePow2 Self
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:57
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2::~EuclideanDistanceMetricWithMissingValuePow2
~EuclideanDistanceMetricWithMissingValuePow2() override
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:99
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:59
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2
Euclidean comparison distance function facing missing value. The square root is not performed in this...
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:53
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2::ValueType
TVector::ValueType ValueType
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:67
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2::Superclass
itk::Statistics::EuclideanDistanceMetric< TVector > Superclass
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:58
otb::Statistics::EuclideanDistanceMetricWithMissingValuePow2::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbEuclideanDistanceMetricWithMissingValuePow2.h:60
otbEuclideanDistanceMetricWithMissingValuePow2.hxx