OTB  10.0.0
Orfeo Toolbox
otbLabelImageToOGRDataSourceFilter.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 otbLabelImageToOGRDataSourceFilter_h
22 #define otbLabelImageToOGRDataSourceFilter_h
23 
24 #include "itkProcessObject.h"
26 #include <string>
27 
28 namespace otb
29 {
30 
47 template <class TInputImage>
48 class ITK_EXPORT LabelImageToOGRDataSourceFilter : public itk::ProcessObject
49 {
50 public:
53  typedef itk::ProcessObject Superclass;
54  typedef itk::SmartPointer<Self> Pointer;
55  typedef itk::SmartPointer<const Self> ConstPointer;
56 
58  itkNewMacro(Self);
59 
61  itkTypeMacro(LabelImageToOGRDataSourceFilter, ProcessObject);
62 
64  typedef TInputImage InputImageType;
65  typedef typename InputImageType::PixelType InputPixelType;
66  typedef typename InputImageType::IndexType InputIndexType;
67  typedef typename InputImageType::SizeType SizeType;
68  typedef typename InputImageType::RegionType RegionType;
69  typedef typename InputImageType::SpacingType SpacingType;
70  typedef typename InputImageType::PointType OriginType;
71  typedef typename InputImageType::IndexType IndexType;
72 
76 
77  typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
78 
80  using Superclass::SetInput;
81  virtual void SetInput(const InputImageType* input);
82  virtual const InputImageType* GetInput(void);
84 
89  virtual void SetInputMask(const InputImageType* input);
90  virtual const InputImageType* GetInputMask(void);
92 
96  itkSetMacro(FieldName, std::string);
97 
101  itkGetMacro(FieldName, std::string);
102 
106  itkSetMacro(Use8Connected, bool);
107 
111  itkGetMacro(Use8Connected, bool);
112 
116  const OGRDataSourceType* GetOutput();
117 
118 protected:
121  {
122  }
123 
124  void GenerateInputRequestedRegion() override;
125 
127  void GenerateData() override;
128 
130  typedef itk::DataObject::Pointer DataObjectPointer;
131 
132  DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override;
133  using Superclass::MakeOutput;
134 
135 private:
137  void operator=(const Self&) = delete;
138 
139  std::string m_FieldName;
141 };
142 
143 
144 } // end namespace otb
145 
146 #ifndef OTB_MANUAL_INSTANTIATION
148 #endif
149 
150 #endif
void operator=(const Self &)=delete
LabelImageToOGRDataSourceFilter(const Self &)=delete
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Collection of geometric objects.
itk::SmartPointer< Self > Pointer
Layer of geometric objects.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.