OTB  6.7.0
Orfeo Toolbox
otbLabelImageToOGRDataSourceFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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>
49  public itk::ProcessObject
50 {
51 public:
52 
58 
60  itkNewMacro(Self);
61 
63  itkTypeMacro(LabelImageToOGRDataSourceFilter, ProcessObject);
64 
66  typedef TInputImage InputImageType;
67  typedef typename InputImageType::PixelType InputPixelType;
70  typedef typename InputImageType::RegionType RegionType;
74 
78 
80 
82  using Superclass::SetInput;
83  virtual void SetInput(const InputImageType *input);
84  virtual const InputImageType * GetInput(void);
86 
91  virtual void SetInputMask(const InputImageType *input);
92  virtual const InputImageType * GetInputMask(void);
94 
98  itkSetMacro(FieldName, std::string);
99 
103  itkGetMacro(FieldName, std::string);
104 
108  itkSetMacro(Use8Connected, bool);
109 
113  itkGetMacro(Use8Connected, bool);
114 
118  const OGRDataSourceType * GetOutput();
119 
120 protected:
123 
124  void GenerateInputRequestedRegion() override;
125 
127  void GenerateData() override;
128 
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 
145 
146 } // end namespace otb
147 
148 #ifndef OTB_MANUAL_INSTANTIATION
150 #endif
151 
152 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
Collection of geometric objects.
Layer of geometric objets.
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
VectorImageType::SpacingType SpacingType
Definition: mvdTypes.h:181
VectorImageType::PointType PointType
Definition: mvdTypes.h:189