OTB  9.0.0
Orfeo Toolbox
otbPersistentImageToVectorDataFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbPersistentImageToVectorDataFilter_h
23 #define otbPersistentImageToVectorDataFilter_h
24 
26 #include "itkExtractImageFilter.h"
27 
29 #include "otbOGRVectorDataIO.h"
30 #include "itkMacro.h"
31 #include <string>
32 
33 namespace otb
34 {
35 
51 template <class TImage, class TOutputVectorData>
52 class ITK_EXPORT PersistentImageToVectorDataFilter : public PersistentImageFilter<TImage, TImage>
53 {
54 public:
58  typedef itk::SmartPointer<Self> Pointer;
59  typedef itk::SmartPointer<const Self> ConstPointer;
60 
63 
64  typedef TImage InputImageType;
65  typedef typename InputImageType::Pointer InputImagePointer;
66  typedef typename InputImageType::RegionType RegionType;
67  typedef typename InputImageType::SizeType SizeType;
68  typedef typename InputImageType::IndexType IndexType;
69  typedef typename InputImageType::PixelType PixelType;
70  typedef typename InputImageType::InternalPixelType InternalPixelType;
71 
72  typedef TOutputVectorData OutputVectorDataType;
73  typedef typename TOutputVectorData::Pointer OutputVectorDataPointerType;
74 
75  typedef itk::ExtractImageFilter<InputImageType, InputImageType> ExtractImageFilterType;
76  typedef typename ExtractImageFilterType::Pointer ExtractImageFilterPointerType;
77 
80 
82  typedef typename OGRVectorDataIOType::Pointer OGRVectorDataIOPointerType;
83 
85  typedef itk::DataObject::Pointer DataObjectPointer;
86 
87  OutputVectorDataType* GetOutputVectorData() const;
88 
89  void AllocateOutputs() override;
90 
91  void Reset(void) override;
92 
93  void Synthetize(void) override;
94 
96  itkSetStringMacro(FileName);
97  itkGetStringMacro(FileName);
99 
100 protected:
103  {
104  }
105 
106  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
107 
108  void GenerateData() override;
109 
111 
113 
114 private:
115  PersistentImageToVectorDataFilter(const Self&) = delete;
116  void operator=(const Self&) = delete;
117 
118  virtual OutputVectorDataPointerType ProcessTile() = 0;
119 
121  std::string m_FileName;
122 
123 }; // end of class
124 } // end namespace otb
125 
126 #ifndef OTB_MANUAL_INSTANTIATION
128 #endif
129 
130 #endif
otb::ConcatenateVectorDataFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbConcatenateVectorDataFilter.h:52
otb::PersistentImageToVectorDataFilter
Perform vectorization in a persistent way.
Definition: otbPersistentImageToVectorDataFilter.h:52
otbPersistentImageFilter.h
otb::PersistentImageToVectorDataFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbPersistentImageToVectorDataFilter.h:58
otb::PersistentImageToVectorDataFilter::m_FileName
std::string m_FileName
Definition: otbPersistentImageToVectorDataFilter.h:121
otb::PersistentImageFilter
This filter is the base class for all filter persisting data through multiple update....
Definition: otbPersistentImageFilter.h:47
otb::PersistentImageToVectorDataFilter::InternalPixelType
InputImageType::InternalPixelType InternalPixelType
Definition: otbPersistentImageToVectorDataFilter.h:70
otb::PersistentImageToVectorDataFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbPersistentImageToVectorDataFilter.h:59
otb::VectorData
This class represents a hierarchy of vector data.
Definition: otbVectorData.h:58
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::PersistentImageToVectorDataFilter::Self
PersistentImageToVectorDataFilter Self
Definition: otbPersistentImageToVectorDataFilter.h:56
otb::PersistentImageToVectorDataFilter::Superclass
PersistentImageFilter< TImage, TImage > Superclass
Definition: otbPersistentImageToVectorDataFilter.h:57
otb::ConcatenateVectorDataFilter
Produces a VectorData from the concatenation of several input vectordatas.
Definition: otbConcatenateVectorDataFilter.h:46
otb::PersistentImageToVectorDataFilter::OGRVectorDataIOPointerType
OGRVectorDataIOType::Pointer OGRVectorDataIOPointerType
Definition: otbPersistentImageToVectorDataFilter.h:82
otbOGRVectorDataIO.h
otbPersistentImageToVectorDataFilter.hxx
otb::PersistentImageToVectorDataFilter::InputImagePointer
InputImageType::Pointer InputImagePointer
Definition: otbPersistentImageToVectorDataFilter.h:65
otb::PersistentImageToVectorDataFilter::InputImageType
TImage InputImageType
Definition: otbPersistentImageToVectorDataFilter.h:62
otb::PersistentImageToVectorDataFilter::OGRVectorDataIOType
otb::OGRVectorDataIO OGRVectorDataIOType
Definition: otbPersistentImageToVectorDataFilter.h:81
otbConcatenateVectorDataFilter.h
otb::PersistentImageToVectorDataFilter::OutputVectorDataPointerType
TOutputVectorData::Pointer OutputVectorDataPointerType
Definition: otbPersistentImageToVectorDataFilter.h:73
otb::PersistentImageToVectorDataFilter::OutputVectorDataType
TOutputVectorData OutputVectorDataType
Definition: otbPersistentImageToVectorDataFilter.h:72
otb::PersistentImageToVectorDataFilter::DataObjectPointer
itk::DataObject::Pointer DataObjectPointer
Definition: otbPersistentImageToVectorDataFilter.h:85
otb::PersistentImageToVectorDataFilter::ExtractImageFilterType
itk::ExtractImageFilter< InputImageType, InputImageType > ExtractImageFilterType
Definition: otbPersistentImageToVectorDataFilter.h:75
otb::PersistentImageToVectorDataFilter::ExtractImageFilterPointerType
ExtractImageFilterType::Pointer ExtractImageFilterPointerType
Definition: otbPersistentImageToVectorDataFilter.h:76
otb::PersistentImageToVectorDataFilter::~PersistentImageToVectorDataFilter
~PersistentImageToVectorDataFilter() override
Definition: otbPersistentImageToVectorDataFilter.h:102
otb::PersistentImageToVectorDataFilter::m_VectorDataIO
OGRVectorDataIOPointerType m_VectorDataIO
Definition: otbPersistentImageToVectorDataFilter.h:120
otb::PersistentImageToVectorDataFilter::m_OutputVectorData
OutputVectorDataPointerType m_OutputVectorData
Definition: otbPersistentImageToVectorDataFilter.h:112
otb::PersistentImageToVectorDataFilter::ConcatenateVectorDataFilterPointerType
ConcatenateVectorDataFilterType::Pointer ConcatenateVectorDataFilterPointerType
Definition: otbPersistentImageToVectorDataFilter.h:79
otb::PersistentImageToVectorDataFilter::IndexType
InputImageType::IndexType IndexType
Definition: otbPersistentImageToVectorDataFilter.h:68
otb::PersistentImageToVectorDataFilter::SizeType
InputImageType::SizeType SizeType
Definition: otbPersistentImageToVectorDataFilter.h:67
otb::OGRVectorDataIO
ImageIO object for reading and writing OGR format vector data.
Definition: otbOGRVectorDataIO.h:47
otb::PersistentImageToVectorDataFilter::PixelType
InputImageType::PixelType PixelType
Definition: otbPersistentImageToVectorDataFilter.h:69
otb::PersistentImageToVectorDataFilter::m_ExtractFilter
ExtractImageFilterPointerType m_ExtractFilter
Definition: otbPersistentImageToVectorDataFilter.h:110
otb::PersistentImageToVectorDataFilter::RegionType
InputImageType::RegionType RegionType
Definition: otbPersistentImageToVectorDataFilter.h:66
otb::PersistentImageToVectorDataFilter::ConcatenateVectorDataFilterType
otb::ConcatenateVectorDataFilter< OutputVectorDataType > ConcatenateVectorDataFilterType
Definition: otbPersistentImageToVectorDataFilter.h:78