OTB  9.0.0
Orfeo Toolbox
otbLabelImageToVectorDataFilter.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 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 
73  typedef typename DataTreeType::Pointer DataTreePointerType;
74  typedef typename DataTreeType::TreeNodeType InternalTreeNodeType;
79  typedef typename LineType::VertexType VertexType;
80 
84 
85 
87  using Superclass::SetInput;
88  virtual void SetInput(const InputImageType* input);
89  virtual const InputImageType* GetInput(void);
91 
96  virtual void SetInputMask(const InputImageType* input);
97  virtual const InputImageType* GetInputMask(void);
99 
100  itkSetMacro(FieldName, std::string);
101  itkGetMacro(FieldName, std::string);
102 
103  itkSetMacro(Use8Connected, bool);
104  itkGetMacro(Use8Connected, bool);
105 
106 protected:
109  {
110  }
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 } // end namespace otb
127 
128 #ifndef OTB_MANUAL_INSTANTIATION
130 #endif
131 
132 #endif
otb::LabelImageToVectorDataFilter::RegionType
InputImageType::RegionType RegionType
Definition: otbLabelImageToVectorDataFilter.h:64
otb::DataNode::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbDataNode.h:79
otb::LabelImageToVectorDataFilter::Superclass
VectorDataSource< VectorData< TPrecision > > Superclass
Definition: otbLabelImageToVectorDataFilter.h:49
otb::LabelImageToVectorDataFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbLabelImageToVectorDataFilter.h:50
otb::LabelImageToVectorDataFilter::m_FieldName
std::string m_FieldName
Definition: otbLabelImageToVectorDataFilter.h:121
otb::VectorData::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbVectorData.h:64
otb::LabelImageToVectorDataFilter::Self
LabelImageToVectorDataFilter Self
Definition: otbLabelImageToVectorDataFilter.h:48
otb::VectorData
This class represents a hierarchy of vector data.
Definition: otbVectorData.h:58
otb::LabelImageToVectorDataFilter::m_Use8Connected
bool m_Use8Connected
Definition: otbLabelImageToVectorDataFilter.h:122
otb::LabelImageToVectorDataFilter::PointType
VectorDataType::PointType PointType
Definition: otbLabelImageToVectorDataFilter.h:78
otb::DataNode
This class represents a node of data in a vector data hierarchy.
Definition: otbDataNode.h:73
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::LabelImageToVectorDataFilter::InputIndexType
InputImageType::IndexType InputIndexType
Definition: otbLabelImageToVectorDataFilter.h:62
otb::LabelImageToVectorDataFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbLabelImageToVectorDataFilter.h:51
otb::LabelImageToVectorDataFilter::InputImageType
TInputImage InputImageType
Definition: otbLabelImageToVectorDataFilter.h:57
otb::LabelImageToVectorDataFilter
this class uses GDALPolygonize method to transform a Label image into a VectorData....
Definition: otbLabelImageToVectorDataFilter.h:44
otb::LabelImageToVectorDataFilter::VectorDataPointerType
VectorDataType::Pointer VectorDataPointerType
Definition: otbLabelImageToVectorDataFilter.h:71
otb::LabelImageToVectorDataFilter::OGRDataSourcePointerType
OGRDataSourceType::Pointer OGRDataSourcePointerType
Definition: otbLabelImageToVectorDataFilter.h:82
otb::LabelImageToVectorDataFilter::OGRLayerType
ogr::Layer OGRLayerType
Definition: otbLabelImageToVectorDataFilter.h:83
otb::LabelImageToVectorDataFilter::SpacingType
InputImageType::SpacingType SpacingType
Definition: otbLabelImageToVectorDataFilter.h:65
otb::LabelImageToVectorDataFilter::InternalTreeNodeType
DataTreeType::TreeNodeType InternalTreeNodeType
Definition: otbLabelImageToVectorDataFilter.h:74
otb::VectorData::DataTreeType
itk::TreeContainer< DataNodePointerType > DataTreeType
Definition: otbVectorData.h:79
otb::VectorData::PointType
DataNodeType::PointType PointType
Definition: otbVectorData.h:82
otb::LabelImageToVectorDataFilter::VertexType
LineType::VertexType VertexType
Definition: otbLabelImageToVectorDataFilter.h:79
otb::LabelImageToVectorDataFilter::IndexType
InputImageType::IndexType IndexType
Definition: otbLabelImageToVectorDataFilter.h:67
otb::LabelImageToVectorDataFilter::VectorDataType
VectorData< TPrecision > VectorDataType
Definition: otbLabelImageToVectorDataFilter.h:70
otbVectorDataSource.h
otb::LabelImageToVectorDataFilter::DataNodeType
VectorDataType::DataNodeType DataNodeType
Definition: otbLabelImageToVectorDataFilter.h:75
otb::LabelImageToVectorDataFilter::DataTreePointerType
DataTreeType::Pointer DataTreePointerType
Definition: otbLabelImageToVectorDataFilter.h:73
otb::ogr::DataSource::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbOGRDataSourceWrapper.h:90
otb::PolyLineParametricPathWithValue
This class implement a PolyLineParametricPath for which a value can be set. The value is stored in th...
Definition: otbPolyLineParametricPathWithValue.h:50
otb::LabelImageToVectorDataFilter::SizeType
InputImageType::SizeType SizeType
Definition: otbLabelImageToVectorDataFilter.h:63
otbVectorData.h
otb::LabelImageToVectorDataFilter::OGRDataSourceType
ogr::DataSource OGRDataSourceType
Definition: otbLabelImageToVectorDataFilter.h:81
otbLabelImageToVectorDataFilter.hxx
otb::LabelImageToVectorDataFilter::DataTreeType
VectorDataType::DataTreeType DataTreeType
Definition: otbLabelImageToVectorDataFilter.h:72
otb::LabelImageToVectorDataFilter::~LabelImageToVectorDataFilter
~LabelImageToVectorDataFilter() override
Definition: otbLabelImageToVectorDataFilter.h:108
otb::LabelImageToVectorDataFilter::OriginType
InputImageType::PointType OriginType
Definition: otbLabelImageToVectorDataFilter.h:66
otb::LabelImageToVectorDataFilter::LineType
VectorDataType::LineType LineType
Definition: otbLabelImageToVectorDataFilter.h:77
otb::PolyLineParametricPathWithValue::VertexType
Superclass::VertexType VertexType
Definition: otbPolyLineParametricPathWithValue.h:69
otb::VectorDataSource
Filter hierarchy for generating VectorData.
Definition: otbVectorDataSource.h:42
otb::LabelImageToVectorDataFilter::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbLabelImageToVectorDataFilter.h:61
otb::ogr::Layer
Layer of geometric objects.
Definition: otbOGRLayerWrapper.h:80
otb::LabelImageToVectorDataFilter::DataNodePointerType
DataNodeType::Pointer DataNodePointerType
Definition: otbLabelImageToVectorDataFilter.h:76
otbOGRDataSourceWrapper.h