OTB  10.0.0
Orfeo Toolbox
otbLabelImageToVectorDataFilter.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 otbLabelImageToVectorDataFilter_h
22 #define otbLabelImageToVectorDataFilter_h
23 
24 #include "otbVectorDataSource.h"
25 #include "otbVectorData.h"
27 #include <string>
28 
29 namespace otb
30 {
43 template <class TInputImage, class TPrecision = double>
44 class ITK_EXPORT LabelImageToVectorDataFilter : public VectorDataSource<otb::VectorData<TPrecision>>
45 {
46 public:
50  typedef itk::SmartPointer<Self> Pointer;
51  typedef itk::SmartPointer<const Self> ConstPointer;
52 
54  itkNewMacro(Self);
55 
58 
60  typedef TInputImage InputImageType;
61  typedef typename InputImageType::PixelType InputPixelType;
62  typedef typename InputImageType::IndexType InputIndexType;
63  typedef typename InputImageType::SizeType SizeType;
64  typedef typename InputImageType::RegionType RegionType;
65  typedef typename InputImageType::SpacingType SpacingType;
66  typedef typename InputImageType::PointType OriginType;
67  typedef typename InputImageType::IndexType IndexType;
68 
77  typedef typename LineType::VertexType VertexType;
78 
82 
83 
85  using Superclass::SetInput;
86  virtual void SetInput(const InputImageType* input);
87  virtual const InputImageType* GetInput(void);
89 
94  virtual void SetInputMask(const InputImageType* input);
95  virtual const InputImageType* GetInputMask(void);
97 
98  itkSetMacro(FieldName, std::string);
99  itkGetMacro(FieldName, std::string);
100 
101  itkSetMacro(Use8Connected, bool);
102  itkGetMacro(Use8Connected, bool);
103 
104 protected:
107  {
108  }
109 
110  void GenerateInputRequestedRegion() override;
111 
113  void GenerateData() override;
114 
115 private:
117  void operator=(const Self&) = delete;
118 
119  std::string m_FieldName;
121 };
122 
123 
124 } // end namespace otb
125 
126 #ifndef OTB_MANUAL_INSTANTIATION
128 #endif
129 
130 #endif
This class represents a node of data in a vector data hierarchy.
Definition: otbDataNode.h:74
itk::SmartPointer< Self > Pointer
Definition: otbDataNode.h:79
this class uses GDALPolygonize method to transform a Label image into a VectorData....
itk::SmartPointer< const Self > ConstPointer
void operator=(const Self &)=delete
LabelImageToVectorDataFilter(const Self &)=delete
VectorDataSource< VectorData< TPrecision > > Superclass
Filter hierarchy for generating VectorData.
This class represents a hierarchy of vector data.
Definition: otbVectorData.h:62
itk::SmartPointer< Self > Pointer
Definition: otbVectorData.h:67
boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, DataNodePointerType > DataTreeType
Definition: otbVectorData.h:87
typename DataNodeType::PointType PointType
Definition: otbVectorData.h:82
typename DataNodeType::LineType LineType
Definition: otbVectorData.h:83
Collection of geometric objects.
itk::SmartPointer< Self > Pointer
Layer of geometric objects.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.