OTB  9.0.0
Orfeo Toolbox
otbLabelMapWithClassLabelToLabeledSampleListFilter.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 #ifndef otbLabelMapWithClassLabelToLabeledSampleListFilter_h
22 #define otbLabelMapWithClassLabelToLabeledSampleListFilter_h
23 
25 
26 namespace otb
27 {
42 template <class TInputLabelMap, class TOutputSampleList, class TOutputTrainingSampleList,
43  class TMeasurementFunctor =
44  Functor::AttributesMapMeasurementFunctor<typename TInputLabelMap::LabelObjectType, typename TOutputSampleList::MeasurementVectorType>>
45 class ITK_EXPORT LabelMapWithClassLabelToLabeledSampleListFilter : public LabelMapToSampleListFilter<TInputLabelMap, TOutputSampleList, TMeasurementFunctor>
46 {
47 public:
51  typedef itk::SmartPointer<Self> Pointer;
52  typedef itk::SmartPointer<const Self> ConstPointer;
53 
55  itkNewMacro(Self);
56 
59 
61  typedef TInputLabelMap InputLabelMapType;
62  typedef typename InputLabelMapType::ConstPointer InputLabelMapConstPointerType;
63  typedef typename InputLabelMapType::LabelObjectType LabelObjectType;
64  typedef typename InputLabelMapType::ConstIterator ConstIteratorType;
65  typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
66 
68  typedef TOutputSampleList OutputSampleListType;
69  typedef typename OutputSampleListType::Pointer OutputSampleListPointerType;
70  typedef typename OutputSampleListType::MeasurementVectorType MeasurementVectorType;
71 
73  typedef TOutputTrainingSampleList OutputTrainingSampleListType;
74  typedef typename OutputTrainingSampleListType::Pointer OutputTrainingSampleListPointerType;
75  typedef typename OutputTrainingSampleListType::MeasurementVectorType TraningVectorType;
76 
78  typedef TMeasurementFunctor MeasurementFunctorType;
79 
80  // DataObject type definition from superclass
82 
83  // Get the output training ListSample
84  const OutputTrainingSampleListType* GetOutputTrainingSampleList();
85 
86  // Get a hook on the functor for settings
88  {
89  m_MeasurementFunctor = functor;
90  }
91 
93  {
94  return m_MeasurementFunctor;
95  }
96 
97 protected:
100 
101  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
102 
103  void GenerateData() override;
104 
106  DataObjectPointerType MakeOutput(DataObjectPointerArraySizeType idx) override;
107  using Superclass::MakeOutput;
108 
109 private:
111  void operator=(const Self&) = delete;
112 
115 };
116 
117 } // end namespace otb
118 
119 #ifndef OTB_MANUAL_INSTANTIATION
121 #endif
122 
123 #endif
otb::LabelMapWithClassLabelToLabeledSampleListFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:51
otb::LabelMapWithClassLabelToLabeledSampleListFilter::OutputSampleListType
TOutputSampleList OutputSampleListType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:68
otb::LabelMapWithClassLabelToLabeledSampleListFilter::m_MeasurementFunctor
MeasurementFunctorType m_MeasurementFunctor
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:114
otb::LabelMapWithClassLabelToLabeledSampleListFilter::OutputSampleListPointerType
OutputSampleListType::Pointer OutputSampleListPointerType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:69
otb::LabelMapWithClassLabelToLabeledSampleListFilter::TraningVectorType
OutputTrainingSampleListType::MeasurementVectorType TraningVectorType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:75
otb::LabelMapWithClassLabelToLabeledSampleListFilter::MeasurementVectorType
OutputSampleListType::MeasurementVectorType MeasurementVectorType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:70
otb::LabelMapToSampleListFilter
This class converts a LabelObjectMap to a SampleList for learning and classification.
Definition: otbLabelMapToSampleListFilter.h:46
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::LabelMapWithClassLabelToLabeledSampleListFilter
This class converts a LabelObjectMap with some class labeled objects to a SampleList and a TrainingSa...
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:45
otb::LabelMapToSampleListFilter::DataObjectPointerType
Superclass::DataObjectPointer DataObjectPointerType
Definition: otbLabelMapToSampleListFilter.h:75
otb::LabelMapWithClassLabelToLabeledSampleListFilter::OutputTrainingSampleListPointerType
OutputTrainingSampleListType::Pointer OutputTrainingSampleListPointerType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:74
otb::LabelMapWithClassLabelToLabeledSampleListFilter::InputLabelMapType
TInputLabelMap InputLabelMapType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:58
otb::LabelMapWithClassLabelToLabeledSampleListFilter::MeasurementFunctorType
TMeasurementFunctor MeasurementFunctorType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:78
otb::LabelMapWithClassLabelToLabeledSampleListFilter::ConstIteratorType
InputLabelMapType::ConstIterator ConstIteratorType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:64
otb::LabelMapWithClassLabelToLabeledSampleListFilter::OutputTrainingSampleListType
TOutputTrainingSampleList OutputTrainingSampleListType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:73
otb::LabelMapWithClassLabelToLabeledSampleListFilter::DataObjectPointerType
Superclass::DataObjectPointerType DataObjectPointerType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:81
otb::LabelMapWithClassLabelToLabeledSampleListFilter::DataObjectPointerArraySizeType
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:65
otbLabelMapWithClassLabelToLabeledSampleListFilter.hxx
otbLabelMapToSampleListFilter.h
otb::LabelMapWithClassLabelToLabeledSampleListFilter::LabelObjectType
InputLabelMapType::LabelObjectType LabelObjectType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:63
otb::LabelMapWithClassLabelToLabeledSampleListFilter::Superclass
LabelMapToSampleListFilter< TInputLabelMap, TOutputSampleList, TMeasurementFunctor > Superclass
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:50
otb::LabelMapWithClassLabelToLabeledSampleListFilter::GetMeasurementFunctor
MeasurementFunctorType & GetMeasurementFunctor()
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:92
otb::LabelMapWithClassLabelToLabeledSampleListFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:52
otb::LabelMapWithClassLabelToLabeledSampleListFilter::SetMeasurementFunctor
void SetMeasurementFunctor(const MeasurementFunctorType &functor)
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:87
otb::LabelMapWithClassLabelToLabeledSampleListFilter::Self
LabelMapWithClassLabelToLabeledSampleListFilter Self
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:49
otb::LabelMapWithClassLabelToLabeledSampleListFilter::InputLabelMapConstPointerType
InputLabelMapType::ConstPointer InputLabelMapConstPointerType
Definition: otbLabelMapWithClassLabelToLabeledSampleListFilter.h:62