OTB  9.0.0
Orfeo Toolbox
otbEdgeDensityImageFilter.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 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);
92  itkGetObjectMacro(Detector, DetectorType);
93  itkGetObjectMacro(DensityImageFilter, DensityImageType);
95 
96 protected:
101 
105  ~EdgeDensityImageFilter() override;
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
otb::EdgeDensityImageFilter::DetectorType
TEdgeDetector DetectorType
Definition: otbEdgeDensityImageFilter.h:68
otb::EdgeDensityImageFilter::InputImageType
TInputImage InputImageType
Definition: otbEdgeDensityImageFilter.h:54
otb::EdgeDensityImageFilter
This composite filter computes the density of the edges around a pixel.
Definition: otbEdgeDensityImageFilter.h:40
otb::EdgeDensityImageFilter::m_DensityImageFilter
DensityImagePointerType m_DensityImageFilter
Definition: otbEdgeDensityImageFilter.h:122
otb::EdgeDensityImageFilter::DensityImageType
otb::BinaryImageToDensityImageFilter< InputImageType, OutputImageType, DensityCountFunctionType > DensityImageType
Definition: otbEdgeDensityImageFilter.h:75
otb::EdgeDensityImageFilter::InputImageSizeType
InputImageType::SizeType InputImageSizeType
Definition: otbEdgeDensityImageFilter.h:60
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::EdgeDensityImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbEdgeDensityImageFilter.h:47
otb::EdgeDensityImageFilter::InputImagePointerType
InputImageType::Pointer InputImagePointerType
Definition: otbEdgeDensityImageFilter.h:58
otb::EdgeDensityImageFilter::OutputImagePointerType
OutputImageType::Pointer OutputImagePointerType
Definition: otbEdgeDensityImageFilter.h:65
otb::BinaryImageToDensityImageFilter
This class performs a streaming isotropic shrinking operation without smoothing.
Definition: otbBinaryImageToDensityImageFilter.h:37
otb::EdgeDensityImageFilter::m_NeighborhoodRadius
InputImageSizeType m_NeighborhoodRadius
Definition: otbEdgeDensityImageFilter.h:123
otb::EdgeDensityImageFilter::Self
EdgeDensityImageFilter Self
Definition: otbEdgeDensityImageFilter.h:45
otb::EdgeDensityImageFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: otbEdgeDensityImageFilter.h:64
otb::EdgeDensityImageFilter::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: otbEdgeDensityImageFilter.h:59
otb::EdgeDensityImageFilter::DensityCountFunctionType
TDensityCount DensityCountFunctionType
Definition: otbEdgeDensityImageFilter.h:72
otbBinaryImageToDensityImageFilter.h
otb::EdgeDensityImageFilter::SetNeighborhoodRadius
void SetNeighborhoodRadius(unsigned int rad)
Definition: otbEdgeDensityImageFilter.h:83
otb::EdgeDensityImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbEdgeDensityImageFilter.h:63
otb::EdgeDensityImageFilter::DetectorPointerType
DetectorType::Pointer DetectorPointerType
Definition: otbEdgeDensityImageFilter.h:69
otb::EdgeDensityImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbEdgeDensityImageFilter.h:48
otb::BinaryImageToDensityImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbBinaryImageToDensityImageFilter.h:43
otbEdgeDensityImageFilter.hxx
otb::EdgeDensityImageFilter::DensityImagePointerType
DensityImageType::Pointer DensityImagePointerType
Definition: otbEdgeDensityImageFilter.h:77
otb::EdgeDensityImageFilter::m_Detector
DetectorPointerType m_Detector
Definition: otbEdgeDensityImageFilter.h:121
otb::EdgeDensityImageFilter::Superclass
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
Definition: otbEdgeDensityImageFilter.h:46