OTB  9.0.0
Orfeo Toolbox
otbSOMClassifier.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 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);
83  itkGetObjectMacro(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
otb::SOMClassifier::InputPixelType
SampleType::MeasurementVectorType::ValueType InputPixelType
Definition: otbSOMClassifier.h:66
otb::SOMClassifier::SamplePointerType
SampleType::Pointer SamplePointerType
Definition: otbSOMClassifier.h:63
otb::SOMClassifier::Superclass
itk::ProcessObject Superclass
Definition: otbSOMClassifier.h:52
otb::SOMClassifier::SOMMapPointerType
SOMMapType::Pointer SOMMapPointerType
Definition: otbSOMClassifier.h:70
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::SOMClassifier::m_Sample
SamplePointerType m_Sample
The input sample.
Definition: otbSOMClassifier.h:104
otb::SOMClassifier::MeasurementVectorType
SampleType::MeasurementVectorType MeasurementVectorType
Definition: otbSOMClassifier.h:65
otb::SOMClassifier::SOMMapType
TSOMMap SOMMapType
Definition: otbSOMClassifier.h:69
otb::SOMClassifier::Self
SOMClassifier Self
Definition: otbSOMClassifier.h:51
otb::SOMClassifier::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbSOMClassifier.h:53
otb::SOMClassifier::SampleType
TSample SampleType
Definition: otbSOMClassifier.h:58
otb::SOMClassifier::ClassLabelType
TLabel ClassLabelType
Definition: otbSOMClassifier.h:77
otbSOMClassifier.hxx
otb::SOMClassifier::~SOMClassifier
~SOMClassifier() override
Definition: otbSOMClassifier.h:92
otb::SOMClassifier::OutputType
itk::Statistics::MembershipSample< SampleType > OutputType
Definition: otbSOMClassifier.h:73
otb::SOMClassifier
This class implements a SOM-Based classifier.
Definition: otbSOMClassifier.h:47
otb::SOMClassifier::MeasurementType
SampleType::MeasurementType MeasurementType
Definition: otbSOMClassifier.h:64
otb::SOMClassifier::OutputPointerType
OutputType::Pointer OutputPointerType
Definition: otbSOMClassifier.h:74
otb::SOMClassifier::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbSOMClassifier.h:54