OTB  9.0.0
Orfeo Toolbox
otbHooverMatrixFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 
22 #ifndef otbHooverMatrixFilter_h
23 #define otbHooverMatrixFilter_h
24 
25 #include "itkLabelMapFilter.h"
26 #include "itkVariableSizeMatrix.h"
27 
28 namespace otb
29 {
42 template <class TLabelMap>
43 class ITK_EXPORT HooverMatrixFilter : public itk::LabelMapFilter<TLabelMap, TLabelMap>
44 {
45 public:
48  typedef itk::LabelMapFilter<TLabelMap, TLabelMap> Superclass;
49  typedef itk::SmartPointer<Self> Pointer;
50  typedef itk::SmartPointer<const Self> ConstPointer;
51 
53  itkNewMacro(Self);
54 
56  itkTypeMacro(HooverMatrixFilter, LabelMapFilter);
57 
59  typedef TLabelMap LabelMapType;
60  typedef typename LabelMapType::LabelObjectType LabelObjectType;
61  typedef typename LabelMapType::LabelVectorType LabelVectorType;
62 
63  // typedef typename LabelObjectType::LineContainerType LineContainerType;
64  typedef typename LabelObjectType::IndexType IndexType;
65  typedef typename LabelObjectType::LabelType LabelType;
66 
67  typedef unsigned long CoefficientType;
68  typedef itk::VariableSizeMatrix<CoefficientType> MatrixType;
69 
71  void SetGroundTruthLabelMap(const LabelMapType* gt);
72 
74  void SetMachineSegmentationLabelMap(const LabelMapType* ms);
75 
77  const LabelMapType* GetGroundTruthLabelMap();
78 
80  const LabelMapType* GetMachineSegmentationLabelMap();
81 
84  {
85  return m_Matrix;
86  }
87 
88 protected:
91 
92  ~HooverMatrixFilter() override{};
93 
96  void BeforeThreadedGenerateData() override;
97 
101  void ThreadedProcessLabelObject(LabelObjectType* labelObject) override;
102 
103 private:
105  unsigned long m_NumberOfRegionsGT;
106 
108  unsigned long m_NumberOfRegionsMS;
109 
112 
115 };
116 }
117 
118 #ifndef OTB_MANUAL_INSTANTIATION
119 #include "otbHooverMatrixFilter.hxx"
120 #endif
121 
122 #endif
otb::HooverMatrixFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbHooverMatrixFilter.h:50
otb::HooverMatrixFilter::LabelType
LabelObjectType::LabelType LabelType
Definition: otbHooverMatrixFilter.h:65
otb::HooverMatrixFilter::m_NumberOfRegionsGT
unsigned long m_NumberOfRegionsGT
Definition: otbHooverMatrixFilter.h:105
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::HooverMatrixFilter::LabelObjectType
LabelMapType::LabelObjectType LabelObjectType
Definition: otbHooverMatrixFilter.h:60
otb::HooverMatrixFilter::IndexType
LabelObjectType::IndexType IndexType
Definition: otbHooverMatrixFilter.h:64
otb::HooverMatrixFilter::CoefficientType
unsigned long CoefficientType
Definition: otbHooverMatrixFilter.h:67
otb::HooverMatrixFilter::Self
HooverMatrixFilter Self
Definition: otbHooverMatrixFilter.h:47
otb::HooverMatrixFilter::LabelVectorType
LabelMapType::LabelVectorType LabelVectorType
Definition: otbHooverMatrixFilter.h:61
otb::HooverMatrixFilter::m_Matrix
MatrixType m_Matrix
Definition: otbHooverMatrixFilter.h:114
otb::HooverMatrixFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbHooverMatrixFilter.h:49
otbHooverMatrixFilter.hxx
otb::HooverMatrixFilter::m_NumberOfRegionsMS
unsigned long m_NumberOfRegionsMS
Definition: otbHooverMatrixFilter.h:108
otb::HooverMatrixFilter::~HooverMatrixFilter
~HooverMatrixFilter() override
Definition: otbHooverMatrixFilter.h:92
otb::HooverMatrixFilter::GetHooverConfusionMatrix
MatrixType & GetHooverConfusionMatrix()
Definition: otbHooverMatrixFilter.h:83
otb::HooverMatrixFilter
This class computes the confusion matrix from two LabelMapObject.
Definition: otbHooverMatrixFilter.h:43
otb::HooverMatrixFilter::Superclass
itk::LabelMapFilter< TLabelMap, TLabelMap > Superclass
Definition: otbHooverMatrixFilter.h:48
otb::HooverMatrixFilter::MatrixType
itk::VariableSizeMatrix< CoefficientType > MatrixType
Definition: otbHooverMatrixFilter.h:68
otb::HooverMatrixFilter::m_LabelsGT
LabelVectorType m_LabelsGT
Definition: otbHooverMatrixFilter.h:111
otb::HooverMatrixFilter::LabelMapType
TLabelMap LabelMapType
Definition: otbHooverMatrixFilter.h:56