OTB  10.0.0
Orfeo Toolbox
otbSOMImageClassificationFilter.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 otbSOMImageClassificationFilter_h
22 #define otbSOMImageClassificationFilter_h
23 
24 #include "otbSOMClassifier.h"
25 #include "itkInPlaceImageFilter.h"
26 #include "itkListSample.h"
27 
28 namespace otb
29 {
44 template <class TInputImage, class TOutputImage, class TSOMMap, class TMaskImage = TOutputImage>
45 class ITK_EXPORT SOMImageClassificationFilter : public itk::InPlaceImageFilter<TInputImage, TOutputImage>
46 {
47 public:
50  typedef itk::InPlaceImageFilter<TInputImage, TOutputImage> Superclass;
51  typedef itk::SmartPointer<Self> Pointer;
52  typedef itk::SmartPointer<const Self> ConstPointer;
53 
55  itkNewMacro(Self);
56 
58  itkTypeMacro(SOMImageClassificationFilter, InPlaceImageFilter);
59 
60  typedef TInputImage InputImageType;
61  typedef typename InputImageType::ConstPointer InputImageConstPointerType;
62  typedef typename InputImageType::InternalPixelType ValueType;
63 
64  typedef TMaskImage MaskImageType;
65  typedef typename MaskImageType::ConstPointer MaskImageConstPointerType;
66  typedef typename MaskImageType::Pointer MaskImagePointerType;
67 
68  typedef TOutputImage OutputImageType;
69  typedef typename OutputImageType::Pointer OutputImagePointerType;
70  typedef typename OutputImageType::RegionType OutputImageRegionType;
71  typedef typename OutputImageType::PixelType LabelType;
72 
73  typedef TSOMMap SOMMapType;
74  typedef typename SOMMapType::Pointer SOMMapPointerType;
75  typedef typename SOMMapType::PixelType SampleType;
76 
77  typedef itk::Statistics::ListSample<SampleType> ListSampleType;
78  typedef typename ListSampleType::Pointer ListSamplePointerType;
81 
83  itkSetObjectMacro(Map, SOMMapType);
86 
88  itkSetMacro(DefaultLabel, LabelType);
89  itkGetMacro(DefaultLabel, LabelType);
91 
96  void SetInputMask(const MaskImageType* mask);
97 
103 
104 protected:
107 
110  {
111  }
112 
114  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) override;
115 
117  void BeforeThreadedGenerateData() override;
118 
120  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
121 
122 private:
124  void operator=(const Self&) = delete;
125 
128 
131 };
132 } // End namespace otb
133 #ifndef OTB_MANUAL_INSTANTIATION
135 #endif
136 
137 #endif
This class implements a SOM-Based classifier.
itk::SmartPointer< Self > Pointer
This filter performs the classification of a VectorImage using a given SOM map.
void operator=(const Self &)=delete
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
MaskImageType::ConstPointer MaskImageConstPointerType
itk::InPlaceImageFilter< TInputImage, TOutputImage > Superclass
itk::SmartPointer< const Self > ConstPointer
InputImageType::InternalPixelType ValueType
const MaskImageType * GetInputMask(void)
itk::Statistics::ListSample< SampleType > ListSampleType
otb::SOMClassifier< ListSampleType, SOMMapType, LabelType > ClassifierType
InputImageType::ConstPointer InputImageConstPointerType
void SetInputMask(const MaskImageType *mask)
void BeforeThreadedGenerateData() override
void PrintSelf(std::ostream &os, itk::Indent indent) const override
SOMImageClassificationFilter(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.