OTB  10.0.0
Orfeo Toolbox
otbSOMClassifier.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 otbSOMClassifier_h
22 #define otbSOMClassifier_h
23 
24 #include "itkProcessObject.h"
25 #include "itkMembershipSample.h"
26 
27 namespace otb
28 {
29 
46 template <class TSample, class TSOMMap, class TLabel>
47 class ITK_EXPORT SOMClassifier : public itk::ProcessObject
48 {
49 public:
52  typedef itk::ProcessObject Superclass;
53  typedef itk::SmartPointer<Self> Pointer;
54  typedef itk::SmartPointer<const Self> ConstPointer;
55 
57  itkTypeMacro(SOMClassifier, itk::ProcessObject);
58  itkNewMacro(Self);
60 
62  typedef TSample SampleType;
63  typedef typename SampleType::Pointer SamplePointerType;
64  typedef typename SampleType::MeasurementType MeasurementType;
65  typedef typename SampleType::MeasurementVectorType MeasurementVectorType;
66  typedef typename SampleType::MeasurementVectorType::ValueType InputPixelType;
67 
69  typedef TSOMMap SOMMapType;
70  typedef typename SOMMapType::Pointer SOMMapPointerType;
71 
73  typedef itk::Statistics::MembershipSample<SampleType> OutputType;
74  typedef typename OutputType::Pointer OutputPointerType;
75 
77  typedef TLabel ClassLabelType;
78 
80  void SetMap(SOMMapType* sommap);
81  SOMMapType* GetMap(void);
82  itkSetObjectMacro(Sample, SampleType);
84 
85  OutputType* GetOutput();
86 
87 protected:
89  SOMClassifier();
90 
92  ~SOMClassifier() override
93  {
94  }
95 
97  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
98 
100  void GenerateData() override;
101 
102 private:
105 
106 }; // end of class
107 } // end of namespace otb
108 
109 #ifndef OTB_MANUAL_INSTANTIATION
110 #include "otbSOMClassifier.hxx"
111 #endif
112 
113 #endif
This class implements a SOM-Based classifier.
itk::ProcessObject Superclass
SOMClassifier Self
itk::Statistics::MembershipSample< SampleType > OutputType
~SOMClassifier() override
SampleType::MeasurementVectorType::ValueType InputPixelType
SOMMapType::Pointer SOMMapPointerType
itk::SmartPointer< const Self > ConstPointer
SampleType::Pointer SamplePointerType
SamplePointerType m_Sample
The input sample.
SampleType::MeasurementVectorType MeasurementVectorType
OutputType::Pointer OutputPointerType
itkGetObjectMacro(Sample, SampleType)
itk::SmartPointer< Self > Pointer
SampleType::MeasurementType MeasurementType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.