OTB  9.0.0
Orfeo Toolbox
otbPixelSuppressionByDirectionImageFilter.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 otbPixelSuppressionByDirectionImageFilter_h
22 #define otbPixelSuppressionByDirectionImageFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "itkImage.h"
26 #include "itkNumericTraits.h"
27 
28 namespace otb
29 {
30 
50 template <class TInputImage, class TOutputImage>
51 class ITK_EXPORT PixelSuppressionByDirectionImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
52 {
53 public:
55  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
56  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
58 
59  typedef TInputImage InputImageType;
60  typedef TOutputImage OutputImageType;
61 
64  typedef itk::ImageToImageFilter<InputImageType, OutputImageType> Superclass;
65  typedef itk::SmartPointer<Self> Pointer;
66  typedef itk::SmartPointer<const Self> ConstPointer;
67 
69  itkNewMacro(Self);
70 
72  itkTypeMacro(PixelSuppressionByDirectionImageFilter, ImageToImageFilter);
73 
75  typedef typename InputImageType::PixelType InputPixelType;
76  typedef typename OutputImageType::PixelType OutputPixelType;
77 
78  typedef typename itk::NumericTraits<InputPixelType>::RealType InputRealType;
79 
80  typedef typename InputImageType::RegionType InputImageRegionType;
81  typedef typename OutputImageType::RegionType OutputImageRegionType;
82 
83  typedef typename InputImageType::SizeType SizeType;
84 
86  itkSetMacro(Radius, SizeType);
87 
89  itkGetConstReferenceMacro(Radius, SizeType);
90 
92  itkSetMacro(AngularBeam, InputRealType);
93 
95  itkGetConstReferenceMacro(AngularBeam, InputRealType);
96 
98  void SetInputImage(const InputImageType* image);
99  const InputImageType* GetInputImage(void);
101 
102  void SetInputImageDirection(const InputImageType* image);
103  const InputImageType* GetInputImageDirection(void);
104 
105  void GenerateInputRequestedRegion() override;
106 
107 protected:
110  {
111  }
112  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
113 
114  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
115 
116 private:
117  PixelSuppressionByDirectionImageFilter(const Self&) = delete;
118  void operator=(const Self&) = delete;
119 
120  // Radius of the region
122  // Angular Accuracy on the direction of the central pixel
124 };
125 } // end namespace otb
126 
127 #ifndef OTB_MANUAL_INSTANTIATION
129 #endif
130 
131 #endif
otb::PixelSuppressionByDirectionImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbPixelSuppressionByDirectionImageFilter.h:60
otb::PixelSuppressionByDirectionImageFilter::~PixelSuppressionByDirectionImageFilter
~PixelSuppressionByDirectionImageFilter() override
Definition: otbPixelSuppressionByDirectionImageFilter.h:109
otb::PixelSuppressionByDirectionImageFilter::SizeType
InputImageType::SizeType SizeType
Definition: otbPixelSuppressionByDirectionImageFilter.h:83
otb::PixelSuppressionByDirectionImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbPixelSuppressionByDirectionImageFilter.h:66
otb::PixelSuppressionByDirectionImageFilter::OutputPixelType
OutputImageType::PixelType OutputPixelType
Definition: otbPixelSuppressionByDirectionImageFilter.h:76
otbPixelSuppressionByDirectionImageFilter.hxx
otb::PixelSuppressionByDirectionImageFilter::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbPixelSuppressionByDirectionImageFilter.h:72
otb::PixelSuppressionByDirectionImageFilter::Self
PixelSuppressionByDirectionImageFilter Self
Definition: otbPixelSuppressionByDirectionImageFilter.h:63
otb::PixelSuppressionByDirectionImageFilter::m_Radius
SizeType m_Radius
Definition: otbPixelSuppressionByDirectionImageFilter.h:121
otb::PixelSuppressionByDirectionImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbPixelSuppressionByDirectionImageFilter.h:65
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::PixelSuppressionByDirectionImageFilter::InputImageType
TInputImage InputImageType
Definition: otbPixelSuppressionByDirectionImageFilter.h:59
otb::PixelSuppressionByDirectionImageFilter::InputRealType
itk::NumericTraits< InputPixelType >::RealType InputRealType
Definition: otbPixelSuppressionByDirectionImageFilter.h:78
otb::PixelSuppressionByDirectionImageFilter::Superclass
itk::ImageToImageFilter< InputImageType, OutputImageType > Superclass
Definition: otbPixelSuppressionByDirectionImageFilter.h:64
otb::PixelSuppressionByDirectionImageFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: otbPixelSuppressionByDirectionImageFilter.h:81
otb::PixelSuppressionByDirectionImageFilter
Application of a filter of suppression of isolated pixels, not belonging to a line,...
Definition: otbPixelSuppressionByDirectionImageFilter.h:51
otb::PixelSuppressionByDirectionImageFilter::m_AngularBeam
InputRealType m_AngularBeam
Definition: otbPixelSuppressionByDirectionImageFilter.h:123
otb::PixelSuppressionByDirectionImageFilter::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: otbPixelSuppressionByDirectionImageFilter.h:80