OTB  10.0.0
Orfeo Toolbox
otbLineDetectorImageFilterBase.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 otbLineDetectorImageFilterBase_h
22 #define otbLineDetectorImageFilterBase_h
23 
24 #include "itkNearestNeighborInterpolateImageFunction.h"
25 #include "itkLinearInterpolateImageFunction.h"
27 #include "otbImage.h"
28 #include "itkNumericTraits.h"
29 
30 namespace otb
31 {
32 
54 template <class TInputImage, class TOutputImage, class TOutputImageDirection = TOutputImage,
55  class TInterpolator = itk::LinearInterpolateImageFunction<TInputImage>>
56 class ITK_EXPORT LineDetectorImageFilterBase : public ImageToModulusAndDirectionImageFilter<TInputImage, TOutputImage, TOutputImageDirection>
57 {
58 public:
60  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
61  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
63 
67  typedef itk::SmartPointer<Self> Pointer;
68  typedef itk::SmartPointer<const Self> ConstPointer;
69 
71  itkNewMacro(Self);
72 
75 
79  typedef TInterpolator InterpolatorType;
80 
82  typedef typename InterpolatorType::Pointer InterpolatorPointer;
83  typedef typename InterpolatorType::CoordRepType CoordRepType;
84 
85  typedef typename InputImageType::PointType TPoint;
86 
88  typedef typename InputImageType::PixelType InputPixelType;
89  typedef typename OutputImageType::PixelType OutputPixelType;
90  typedef typename OutputImageType::Pointer OutputImagePointerType;
91 
92  typedef typename InputImageType::RegionType InputImageRegionType;
93  typedef typename OutputImageType::RegionType OutputImageRegionType;
94 
96  typedef typename InputImageType::SizeType SizeType;
97 
99  itkSetMacro(LengthLine, unsigned int);
100 
102  itkGetConstReferenceMacro(LengthLine, unsigned int);
103 
105  itkSetMacro(WidthLine, unsigned int);
106 
108  itkGetConstReferenceMacro(WidthLine, unsigned int);
109 
111  itkSetMacro(Radius, SizeType);
112 
114  itkGetConstReferenceMacro(Radius, SizeType);
115 
117  itkSetMacro(Threshold, OutputPixelType);
118 
120  itkGetConstReferenceMacro(Threshold, OutputPixelType);
121 
123  itkSetMacro(NumberOfDirections, unsigned int);
124 
126  itkGetConstReferenceMacro(NumberOfDirections, unsigned int);
127 
128  void GenerateInputRequestedRegion() override;
129 
130 protected:
133  {
134  }
135  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
136 
137  void BeforeThreadedGenerateData() override;
138 
148  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) override;
149 
150  virtual double ComputeMeasure(std::vector<double>* m1, std::vector<double>* m2, std::vector<double>* m3);
151 
153  unsigned int m_LengthLine;
154 
156  unsigned int m_WidthLine;
157 
160 
163 
165 
166  unsigned int m_NumberOfDirections;
167 
168 private:
170  void operator=(const Self&) = delete;
171 };
172 } // end namespace otb
173 
174 #ifndef OTB_MANUAL_INSTANTIATION
176 #endif
177 
178 #endif
Base class for modulus and direction image filters.
Base class for line detector filters.
ImageToModulusAndDirectionImageFilter< TInputImage, TOutputImage, TOutputImageDirection > Superclass
Superclass::OutputImageDirectionType OutputImageDirectionType
OutputImageType::RegionType OutputImageRegionType
void operator=(const Self &)=delete
InterpolatorType::CoordRepType CoordRepType
itk::SmartPointer< const Self > ConstPointer
LineDetectorImageFilterBase(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.