OTB  9.0.0
Orfeo Toolbox
otbLabelImageToOGRDataSourceFilter.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 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:
136  LabelImageToOGRDataSourceFilter(const Self&) = delete;
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
otb::LabelImageToOGRDataSourceFilter::RegionType
InputImageType::RegionType RegionType
Definition: otbLabelImageToOGRDataSourceFilter.h:68
otb::LabelImageToOGRDataSourceFilter::SpacingType
InputImageType::SpacingType SpacingType
Definition: otbLabelImageToOGRDataSourceFilter.h:69
otb::LabelImageToOGRDataSourceFilter::Superclass
itk::ProcessObject Superclass
Definition: otbLabelImageToOGRDataSourceFilter.h:53
otb::LabelImageToOGRDataSourceFilter::OriginType
InputImageType::PointType OriginType
Definition: otbLabelImageToOGRDataSourceFilter.h:70
otb::LabelImageToOGRDataSourceFilter::IndexType
InputImageType::IndexType IndexType
Definition: otbLabelImageToOGRDataSourceFilter.h:71
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ogr::DataSource
Collection of geometric objects.
Definition: otbOGRDataSourceWrapper.h:83
otb::LabelImageToOGRDataSourceFilter::m_FieldName
std::string m_FieldName
Definition: otbLabelImageToOGRDataSourceFilter.h:139
otb::LabelImageToOGRDataSourceFilter::DataObjectPointer
itk::DataObject::Pointer DataObjectPointer
Definition: otbLabelImageToOGRDataSourceFilter.h:130
otb::LabelImageToOGRDataSourceFilter::~LabelImageToOGRDataSourceFilter
~LabelImageToOGRDataSourceFilter() override
Definition: otbLabelImageToOGRDataSourceFilter.h:120
otb::LabelImageToOGRDataSourceFilter::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbLabelImageToOGRDataSourceFilter.h:65
otb::LabelImageToOGRDataSourceFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbLabelImageToOGRDataSourceFilter.h:54
otb::LabelImageToOGRDataSourceFilter::m_Use8Connected
bool m_Use8Connected
Definition: otbLabelImageToOGRDataSourceFilter.h:140
otb::LabelImageToOGRDataSourceFilter::InputImageType
TInputImage InputImageType
Definition: otbLabelImageToOGRDataSourceFilter.h:61
otb::LabelImageToOGRDataSourceFilter::InputIndexType
InputImageType::IndexType InputIndexType
Definition: otbLabelImageToOGRDataSourceFilter.h:66
otb::LabelImageToOGRDataSourceFilter::OGRDataSourcePointerType
OGRDataSourceType::Pointer OGRDataSourcePointerType
Definition: otbLabelImageToOGRDataSourceFilter.h:74
otb::ogr::DataSource::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbOGRDataSourceWrapper.h:90
otb::LabelImageToOGRDataSourceFilter::Self
LabelImageToOGRDataSourceFilter Self
Definition: otbLabelImageToOGRDataSourceFilter.h:52
otb::LabelImageToOGRDataSourceFilter::OGRLayerType
ogr::Layer OGRLayerType
Definition: otbLabelImageToOGRDataSourceFilter.h:75
otb::LabelImageToOGRDataSourceFilter::OGRDataSourceType
ogr::DataSource OGRDataSourceType
Definition: otbLabelImageToOGRDataSourceFilter.h:73
otb::ogr::Layer
Layer of geometric objects.
Definition: otbOGRLayerWrapper.h:80
otb::LabelImageToOGRDataSourceFilter
Definition: otbLabelImageToOGRDataSourceFilter.h:48
otb::LabelImageToOGRDataSourceFilter::SizeType
InputImageType::SizeType SizeType
Definition: otbLabelImageToOGRDataSourceFilter.h:67
otbOGRDataSourceWrapper.h
otb::LabelImageToOGRDataSourceFilter::DataObjectPointerArraySizeType
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Definition: otbLabelImageToOGRDataSourceFilter.h:77
otb::LabelImageToOGRDataSourceFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbLabelImageToOGRDataSourceFilter.h:55
otbLabelImageToOGRDataSourceFilter.hxx