OTB  10.0.0
Orfeo Toolbox
otbLabelMapWithClassLabelToClassLabelImageFilter.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 otbLabelMapWithClassLabelToClassLabelImageFilter_h
22 #define otbLabelMapWithClassLabelToClassLabelImageFilter_h
23 
24 #include "itkLabelMapFilter.h"
25 
26 namespace otb
27 {
28 
35 template <class TInputImage, class TOutputImage>
36 class ITK_EXPORT LabelMapWithClassLabelToClassLabelImageFilter : public itk::LabelMapFilter<TInputImage, TOutputImage>
37 {
38 public:
41  typedef itk::LabelMapFilter<TInputImage, TOutputImage> Superclass;
42  typedef itk::SmartPointer<Self> Pointer;
43  typedef itk::SmartPointer<const Self> ConstPointer;
44 
46  typedef TInputImage InputImageType;
47  typedef TOutputImage OutputImageType;
48  typedef typename InputImageType::Pointer InputImagePointer;
49  typedef typename InputImageType::ConstPointer InputImageConstPointer;
50  typedef typename InputImageType::RegionType InputImageRegionType;
51  typedef typename InputImageType::PixelType InputImagePixelType;
52  typedef typename InputImageType::LabelObjectType LabelObjectType;
53 
54  typedef typename LabelObjectType::ConstLineIterator ConstLineIteratorType;
55 
56  typedef typename OutputImageType::Pointer OutputImagePointer;
57  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
58  typedef typename OutputImageType::RegionType OutputImageRegionType;
59  typedef typename OutputImageType::PixelType OutputImagePixelType;
60  typedef typename OutputImageType::IndexType IndexType;
61 
63  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
64  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
66 
68  itkNewMacro(Self);
69 
71  itkTypeMacro(LabelMapWithClassLabelToClassLabelImageFilter, ImageToImageFilter);
72 
73 protected:
76 
77  void BeforeThreadedGenerateData() override;
78 
79  void ThreadedProcessLabelObject(LabelObjectType* labelObject) override;
80 
81 private:
83  void operator=(const Self&) = delete;
84 
85 }; // end of class
86 
87 } // end namespace otb
88 
89 #ifndef OTB_MANUAL_INSTANTIATION
91 #endif
92 
93 #endif
Converts a LabelMap<LabelObjectWithClassLabel> to an image of class labels.
LabelMapWithClassLabelToClassLabelImageFilter(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.