OTB  10.0.0
Orfeo Toolbox
otbBinaryImageToDensityImageFilter.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 otbBinaryImageToDensityImageFilter_h
22 #define otbBinaryImageToDensityImageFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "itkDataObject.h"
26 #include "itkConstNeighborhoodIterator.h"
27 
28 namespace otb
29 {
36 template <class TInputImage, class TOutputImage, class TCountFunction>
37 class ITK_EXPORT BinaryImageToDensityImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
38 {
39 public:
42  typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
43  typedef itk::SmartPointer<Self> Pointer;
44  typedef itk::SmartPointer<const Self> ConstPointer;
45 
47  itkNewMacro(Self);
48 
50  itkTypeMacro(BinaryImageToDensityImageFilter, itk::ImageToImageFilter);
51 
53  typedef TInputImage InputImageType;
54  typedef typename InputImageType::RegionType InputImageRegionType;
55  typedef typename InputImageType::Pointer InputImagePointerType;
56  typedef typename InputImageType::SizeType InputImageSizeType;
57 
58  typedef TOutputImage OutputImageType;
59  typedef typename OutputImageType::Pointer OutputImagePointerType;
60 
61  typedef TCountFunction CountFunctionType;
62  typedef typename CountFunctionType::Pointer CountFunctionPointerType;
63 
64  typedef itk::ConstNeighborhoodIterator<TInputImage> NeighborhoodIteratorType;
65  typedef typename NeighborhoodIteratorType::RadiusType RadiusType;
66 
68  itkSetMacro(NeighborhoodRadius, RadiusType);
69  itkGetMacro(NeighborhoodRadius, RadiusType);
71 
72  void SetNeighborhoodRadius(unsigned int rad)
73  {
74  m_NeighborhoodRadius.Fill(rad);
75  this->Modified();
76  }
77 
79  void DynamicThreadedGenerateData(const InputImageRegionType& outputRegionForThread) override;
80  void BeforeThreadedGenerateData() override;
83 
84 protected:
87 
90 
92  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
93 
94 private:
96  void operator=(const Self&) = delete;
97 
99 
102 };
103 } // End namespace otb
104 
105 #ifndef OTB_MANUAL_INSTANTIATION
107 #endif
108 
109 #endif
This class performs a streaming isotropic shrinking operation without smoothing.
void DynamicThreadedGenerateData(const InputImageRegionType &outputRegionForThread) override
void GenerateInputRequestedRegion() override
BinaryImageToDensityImageFilter(const Self &)=delete
void PrintSelf(std::ostream &os, itk::Indent indent) const override
NeighborhoodIteratorType::RadiusType RadiusType
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
itk::ConstNeighborhoodIterator< TInputImage > NeighborhoodIteratorType
void operator=(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.