OTB  9.0.0
Orfeo Toolbox
otbImageToPointSetFilter.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 otbImageToPointSetFilter_h
22 #define otbImageToPointSetFilter_h
23 
24 #include "otbPointSetSource.h"
26 
27 // TODO: This class needs a refactoring to become a persistent filter
28 
29 namespace otb
30 {
31 
43 template <class TInputImage, class TOutputPointSet>
44 class ITK_EXPORT ImageToPointSetFilter : public PointSetSource<TOutputPointSet>
45 {
46 public:
50  typedef itk::SmartPointer<Self> Pointer;
51  typedef itk::SmartPointer<const Self> ConstPointer;
52 
55 
57  typedef TInputImage InputImageType;
58  typedef typename InputImageType::Pointer InputImagePointer;
59  typedef typename InputImageType::ConstPointer InputImageConstPointer;
60  typedef typename InputImageType::RegionType InputImageRegionType;
61  typedef typename InputImageType::PixelType InputImagePixelType;
62  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
63 
69  typedef itk::ProcessObject ProcessObjectType;
70 
72  using Superclass::SetInput;
73  void SetInput(unsigned int idx, const InputImageType* input);
74  void SetInput(const InputImageType* input);
76 
78  const InputImageType* GetInput(unsigned int idx);
79  const InputImageType* GetInput();
81 
83  void GenerateOutputInformation(void) override;
84 
85 protected:
88  {
89  }
90  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
91 
92  void GenerateData(void) override;
93 
96  typedef std::vector<typename OutputPointSetType::PointsContainer::Pointer> OutputPointsContainerForThreadType;
97  typedef std::vector<typename OutputPointSetType::PointDataContainer::Pointer> OutputPointDataContainerForThreadType;
98 
99  virtual void BeforeThreadedGenerateData();
100 
101  virtual void AfterThreadedGenerateData();
102 
103  virtual int SplitRequestedRegion(int i, int num, InputImageRegionType& splitRegion);
104 
105  virtual void ThreadedGenerateData(const InputImageRegionType& inputRegionForThread, itk::ThreadIdType threadId);
106 
110  static ITK_THREAD_RETURN_TYPE ThreaderCallback(void* arg);
111 
114  {
116  };
117 
120 
125  typedef typename StreamingManagerType::Pointer StreamingManagerPointer;
126 
128 
129 private:
131  void operator=(const ImageToPointSetFilter&) = delete;
132 };
133 
134 } // end namespace otb
135 
136 #ifndef OTB_MANUAL_INSTANTIATION
138 #endif
139 
140 #endif
otb::PointSetSource< itk::PointSet< typename TInputImage::PixelType, 2 > >::PointsContainerType
OutputPointSetType::PointsContainer PointsContainerType
Definition: otbPointSetSource.h:65
otb::ImageToPointSetFilter::OutputPointSetType
Superclass::OutputPointSetType OutputPointSetType
Definition: otbImageToPointSetFilter.h:65
otb::ImageToPointSetFilter::Superclass
PointSetSource< TOutputPointSet > Superclass
Definition: otbImageToPointSetFilter.h:49
otb::ImageToPointSetFilter::OutputPointsContainerForThreadType
std::vector< typename OutputPointSetType::PointsContainer::Pointer > OutputPointsContainerForThreadType
Definition: otbImageToPointSetFilter.h:96
otb::ImageToPointSetFilter::~ImageToPointSetFilter
~ImageToPointSetFilter() override
Definition: otbImageToPointSetFilter.h:87
otb::ImageToPointSetFilter::m_StreamingManager
StreamingManagerPointer m_StreamingManager
Definition: otbImageToPointSetFilter.h:127
otb::ImageToPointSetFilter::m_PointsContainerPerThread
OutputPointsContainerForThreadType m_PointsContainerPerThread
Definition: otbImageToPointSetFilter.h:118
otb::ImageToPointSetFilter::ThreadStruct
Definition: otbImageToPointSetFilter.h:113
otb::ImageToPointSetFilter
Base class to output PointSet data with image data as input.
Definition: otbImageToPointSetFilter.h:44
otb::ImageToPointSetFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbImageToPointSetFilter.h:50
otb::ImageToPointSetFilter::PointDataContainerType
Superclass::PointDataContainerType PointDataContainerType
Definition: otbImageToPointSetFilter.h:68
otb::ImageToPointSetFilter::InputImagePointer
InputImageType::Pointer InputImagePointer
Definition: otbImageToPointSetFilter.h:58
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ImageToPointSetFilter::OutputPointSetPointer
Superclass::OutputPointSetPointer OutputPointSetPointer
Definition: otbImageToPointSetFilter.h:66
otb::ImageToPointSetFilter::ProcessObjectType
itk::ProcessObject ProcessObjectType
Definition: otbImageToPointSetFilter.h:69
otb::ImageToPointSetFilter::OutputPointDataContainerForThreadType
std::vector< typename OutputPointSetType::PointDataContainer::Pointer > OutputPointDataContainerForThreadType
Definition: otbImageToPointSetFilter.h:97
otb::ImageToPointSetFilter::Self
ImageToPointSetFilter Self
Definition: otbImageToPointSetFilter.h:48
otb::ImageToPointSetFilter::StreamingManagerPointer
StreamingManagerType::Pointer StreamingManagerPointer
Definition: otbImageToPointSetFilter.h:125
otb::ImageToPointSetFilter::InputImageConstPointer
InputImageType::ConstPointer InputImageConstPointer
Definition: otbImageToPointSetFilter.h:59
otb::RAMDrivenAdaptativeStreamingManager
This class computes the divisions needed to stream an image according to the input image tiling schem...
Definition: otbRAMDrivenAdaptativeStreamingManager.h:49
otb::PointSetSource
Base class for all process objects that output point set data.
Definition: otbPointSetSource.h:45
otb::ImageToPointSetFilter::StreamingManagerType
RAMDrivenAdaptativeStreamingManager< InputImageType > StreamingManagerType
Definition: otbImageToPointSetFilter.h:124
otb::ImageToPointSetFilter::InputImageType
TInputImage InputImageType
Definition: otbImageToPointSetFilter.h:54
otb::ImageToPointSetFilter::ThreadStruct::Filter
Pointer Filter
Definition: otbImageToPointSetFilter.h:115
otbPointSetSource.h
otb::PointSetSource< itk::PointSet< typename TInputImage::PixelType, 2 > >::PointDataContainerType
OutputPointSetType::PointDataContainer PointDataContainerType
Definition: otbPointSetSource.h:66
otb::ImageToPointSetFilter::m_PointDataContainerPerThread
OutputPointDataContainerForThreadType m_PointDataContainerPerThread
Definition: otbImageToPointSetFilter.h:119
otb::ImageToPointSetFilter::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: otbImageToPointSetFilter.h:60
otb::PointSetSource< itk::PointSet< typename TInputImage::PixelType, 2 > >::OutputPointSetPointer
OutputPointSetType::Pointer OutputPointSetPointer
Definition: otbPointSetSource.h:64
otb::ImageToPointSetFilter::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: otbImageToPointSetFilter.h:61
otbRAMDrivenAdaptativeStreamingManager.h
otb::PointSetSource< itk::PointSet< typename TInputImage::PixelType, 2 > >::OutputPointSetType
itk::PointSet< typename TInputImage::PixelType, 2 > OutputPointSetType
Definition: otbPointSetSource.h:63
otb::ImageToPointSetFilter::PointsContainerType
Superclass::PointsContainerType PointsContainerType
Definition: otbImageToPointSetFilter.h:67
otbImageToPointSetFilter.hxx
otb::ImageToPointSetFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbImageToPointSetFilter.h:51