OTB  6.7.0
Orfeo Toolbox
otbLabelImageToVectorDataFilter.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 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 :
45  public VectorDataSource< otb::VectorData<TPrecision> >
46 {
47 public:
48 
54 
56  itkNewMacro(Self);
57 
60 
62  typedef TInputImage InputImageType;
63  typedef typename InputImageType::PixelType InputPixelType;
66  typedef typename InputImageType::RegionType RegionType;
70 
81  typedef typename LineType::VertexType VertexType;
82 
86 
87 
89  using Superclass::SetInput;
90  virtual void SetInput(const InputImageType *input);
91  virtual const InputImageType * GetInput(void);
93 
98  virtual void SetInputMask(const InputImageType *input);
99  virtual const InputImageType * GetInputMask(void);
101 
102  itkSetMacro(FieldName, std::string);
103  itkGetMacro(FieldName, std::string);
104 
105  itkSetMacro(Use8Connected, bool);
106  itkGetMacro(Use8Connected, bool);
107 
108 protected:
111 
112  void GenerateInputRequestedRegion() override;
113 
115  void GenerateData() override;
116 
117 private:
118  LabelImageToVectorDataFilter(const Self &) = delete;
119  void operator =(const Self&) = delete;
120 
121  std::string m_FieldName;
123 
124 };
125 
126 
127 } // end namespace otb
128 
129 #ifndef OTB_MANUAL_INSTANTIATION
131 #endif
132 
133 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
Collection of geometric objects.
this class uses GDALPolygonize method to transform a Label image into a VectorData. An optional input mask can be used to exclude pixels from vectorization process. All pixels with a value of 0 in the input mask image will not be suitable for vectorization.
Layer of geometric objets.
This class implement a PolyLineParametricPath for which a value can be set. The value is stored in th...
This class represents a node of data in a vector data hierarchy.
Definition: otbDataNode.h:75
VectorDataSource< VectorData< TPrecision > > Superclass
Filter hierarchy for generating VectorData.
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
itk::SmartPointer< const Self > ConstPointer
This class represents a hierarchy of vector data.
Definition: otbVectorData.h:58
VectorImageType::SpacingType SpacingType
Definition: mvdTypes.h:181
VectorImageType::PointType PointType
Definition: mvdTypes.h:189