OTB  10.0.0
Orfeo Toolbox
otbThresholdImageToPointSetFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 otbThresholdImageToPointSetFilter_h
22 #define otbThresholdImageToPointSetFilter_h
23 
25 #include "itkPointSet.h"
26 #include "itkConceptChecking.h"
27 
28 namespace otb
29 {
30 
38 template <class TInputImage, class TOutputPointSet = itk::PointSet<typename TInputImage::PixelType, 2>>
39 class ITK_EXPORT ThresholdImageToPointSetFilter : public ImageToPointSetFilter<TInputImage, TOutputPointSet>
40 {
41 public:
42  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
43 
44  typedef TInputImage InputImageType;
45 
49  typedef itk::SmartPointer<Self> Pointer;
50  typedef itk::SmartPointer<const Self> ConstPointer;
51 
52  itkNewMacro(Self);
53 
55 
60  typedef typename Superclass::InputImageType::SizeType SizeType;
61  typedef typename Superclass::InputImageType::IndexType IndexType;
62 
64  typedef typename Superclass::OutputPointSetType::PixelType OutputPointSetPixelType;
67 
68 #ifdef ITK_USE_CONCEPT_CHECKING
70  itkConceptMacro(PixelConvertibleToPointSetDataType, (itk::Concept::Convertible<InputPixelType, typename PointDataContainerType::Element>));
71 #endif
72 
73 
74  itkSetMacro(LowerThreshold, InputPixelType);
75  itkGetConstReferenceMacro(LowerThreshold, InputPixelType);
76  itkSetMacro(UpperThreshold, InputPixelType);
77  itkGetConstReferenceMacro(UpperThreshold, InputPixelType);
78 
79 protected:
82  {
83  }
84 
85  void ThreadedGenerateData(const InputImageRegionType& inputRegionForThread, itk::ThreadIdType threadId) override;
86 
87  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
88 
89 private:
91  void operator=(const Self&) = delete;
92 
95 };
96 } // end namespace otb
97 
98 #ifndef OTB_MANUAL_INSTANTIATION
100 #endif
101 
102 #endif
Base class to output PointSet data with image data as input.
Superclass::PointsContainerType PointsContainerType
InputImageType::Pointer InputImagePointer
Superclass::OutputPointSetType OutputPointSetType
InputImageType::ConstPointer InputImageConstPointer
Superclass::PointDataContainerType PointDataContainerType
Superclass::OutputPointSetPointer OutputPointSetPointer
InputImageType::RegionType InputImageRegionType
InputImageType::PixelType InputImagePixelType
Produce a PointSet according to filtering conditions.
ThresholdImageToPointSetFilter(const Self &)=delete
ImageToPointSetFilter< InputImageType, TOutputPointSet > Superclass
void operator=(const Self &)=delete
Superclass::InputImageType::IndexType IndexType
Superclass::OutputPointSetPointer OutputPointSetPointer
Superclass::InputImageType::SizeType SizeType
Superclass::PointDataContainerType PointDataContainerType
Superclass::PointsContainerType PointsContainerType
Superclass::InputImageRegionType InputImageRegionType
Superclass::OutputPointSetType::PixelType OutputPointSetPixelType
Superclass::InputImageConstPointer InputImageConstPointer
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.