OTB  6.7.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-2019 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>
53  public PersistentImageFilter<TImage, TImage>
54 {
55 public:
61 
64 
65  typedef TImage InputImageType;
66  typedef typename InputImageType::Pointer InputImagePointer;
67  typedef typename InputImageType::RegionType RegionType;
70  typedef typename InputImageType::PixelType PixelType;
71  typedef typename InputImageType::InternalPixelType InternalPixelType;
72 
73  typedef TOutputVectorData OutputVectorDataType;
74  typedef typename TOutputVectorData::Pointer OutputVectorDataPointerType;
75 
78 
81 
84 
87 
88  OutputVectorDataType* GetOutputVectorData() const;
89 
90  void AllocateOutputs() override;
91 
92  void Reset(void) override;
93 
94  void Synthetize(void) override;
95 
97  itkSetStringMacro(FileName);
98  itkGetStringMacro(FileName);
100 
101 protected:
104 
105  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
106 
107  void GenerateData() override;
108 
110 
112 
113 private:
114  PersistentImageToVectorDataFilter(const Self &) = delete;
115  void operator =(const Self&) = delete;
116 
117  virtual OutputVectorDataPointerType ProcessTile() = 0;
118 
120  std::string m_FileName;
121 
122 }; // end of class
123 } // end namespace otb
124 
125 #ifndef OTB_MANUAL_INSTANTIATION
127 #endif
128 
129 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
Produces a VectorData from the concatenation of several input vectordatas.
ImageIO object for reading and writing OGR format vector data.
otb::ConcatenateVectorDataFilter< OutputVectorDataType > ConcatenateVectorDataFilterType
ConcatenateVectorDataFilterType::Pointer ConcatenateVectorDataFilterPointerType
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
PersistentImageFilter< TImage, TImage > Superclass
This class represents a hierarchy of vector data.
Definition: otbVectorData.h:58
Perform vectorization in a persistent way.
This filter is the base class for all filter persisting data through multiple update. For instance, a filter computing global statistics on an image with streaming capabilities will have to keep the temporary results for each streamed piece of the image in order to synthesize the global statistics at the end. This filter is an itk::ImageToImageFilter, providing two additional methods. The first one, Synthetize(), allows the user to synthesize temporary data produced by the multiple updates on different pieces of the image to the global result. The second one, Reset(), allows the user to reset the temporary data for a new input image for instance.
itk::ExtractImageFilter< InputImageType, InputImageType > ExtractImageFilterType