OTB  10.0.0
Orfeo Toolbox
otbEdgeDensityImageFilter.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 otbEdgeDensityImageFilter_h
22 #define otbEdgeDensityImageFilter_h
23 
25 #include "itkProcessObject.h"
26 
27 
28 namespace otb
29 {
30 
39 template <class TInputImage, class TOutputImage, class TEdgeDetector, class TDensityCount>
40 class ITK_EXPORT EdgeDensityImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
41 {
42 
43 public:
46  typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
47  typedef itk::SmartPointer<Self> Pointer;
48  typedef itk::SmartPointer<const Self> ConstPointer;
49 
51  itkNewMacro(Self);
52 
54  itkTypeMacro(EdgeDensityImageFilter, itk::ImageToImageFilter);
55 
57  typedef TInputImage InputImageType;
58  typedef typename InputImageType::Pointer InputImagePointerType;
59  typedef typename InputImageType::PixelType InputImagePixelType;
60  typedef typename InputImageType::SizeType InputImageSizeType;
61 
63  typedef TOutputImage OutputImageType;
64  typedef typename OutputImageType::RegionType OutputImageRegionType;
65  typedef typename OutputImageType::Pointer OutputImagePointerType;
66 
68  typedef TEdgeDetector DetectorType;
69  typedef typename DetectorType::Pointer DetectorPointerType;
70 
72  typedef TDensityCount DensityCountFunctionType;
73 
76 
78 
81  itkSetMacro(NeighborhoodRadius, InputImageSizeType);
82  itkGetConstReferenceMacro(NeighborhoodRadius, InputImageSizeType);
83  void SetNeighborhoodRadius(unsigned int rad)
84  {
85  m_NeighborhoodRadius.Fill(rad);
86  this->Modified();
87  }
89 
91  itkSetObjectMacro(Detector, DetectorType);
93  itkGetObjectMacro(DensityImageFilter, DensityImageType);
95 
96 protected:
101 
106 
110  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
111 
115  void GenerateData() override;
116 
117 private:
118  EdgeDensityImageFilter(const Self&) = delete;
119  void operator=(const Self&) = delete;
120 
124 };
125 }
126 #ifndef OTB_MANUAL_INSTANTIATION
128 #endif
129 
130 #endif
This class performs a streaming isotropic shrinking operation without smoothing.
This composite filter computes the density of the edges around a pixel.
itkGetObjectMacro(DensityImageFilter, DensityImageType)
InputImageType::Pointer InputImagePointerType
itkGetObjectMacro(Detector, DetectorType)
InputImageType::PixelType InputImagePixelType
void GenerateData() override
itk::SmartPointer< const Self > ConstPointer
OutputImageType::Pointer OutputImagePointerType
void operator=(const Self &)=delete
void SetNeighborhoodRadius(unsigned int rad)
otb::BinaryImageToDensityImageFilter< InputImageType, OutputImageType, DensityCountFunctionType > DensityImageType
OutputImageType::RegionType OutputImageRegionType
InputImageType::SizeType InputImageSizeType
EdgeDensityImageFilter(const Self &)=delete
DetectorType::Pointer DetectorPointerType
itk::SmartPointer< Self > Pointer
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
void PrintSelf(std::ostream &os, itk::Indent indent) const override
DensityImagePointerType m_DensityImageFilter
DensityImageType::Pointer DensityImagePointerType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.