OTB  10.0.0
Orfeo Toolbox
otbVarianceImageFilter.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 otbVarianceImageFilter_h
22 #define otbVarianceImageFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "itkImage.h"
26 #include "itkNumericTraits.h"
27 
28 namespace otb
29 {
46 template <class TInputImage, class TOutputImage>
47 class ITK_EXPORT VarianceImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
48 {
49 public:
51  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
52  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
54 
56  typedef TInputImage InputImageType;
57  typedef TOutputImage OutputImageType;
58 
61  typedef itk::ImageToImageFilter<InputImageType, OutputImageType> Superclass;
62  typedef itk::SmartPointer<Self> Pointer;
63  typedef itk::SmartPointer<const Self> ConstPointer;
64 
66  itkNewMacro(Self);
67 
69  itkTypeMacro(VarianceImageFilter, ImageToImageFilter);
70 
72  typedef typename InputImageType::PixelType InputPixelType;
73  typedef typename OutputImageType::PixelType OutputPixelType;
74  typedef typename itk::NumericTraits<InputPixelType>::RealType InputRealType;
75 
76  typedef typename InputImageType::RegionType InputImageRegionType;
77  typedef typename OutputImageType::RegionType OutputImageRegionType;
78 
79  typedef typename InputImageType::SizeType InputSizeType;
80 
82  itkSetMacro(Radius, InputSizeType);
83 
85  itkGetConstReferenceMacro(Radius, InputSizeType);
86 
93  void GenerateInputRequestedRegion() override;
94 
95 #ifdef ITK_USE_CONCEPT_CHECKING
97  itkConceptMacro(InputHasNumericTraitsCheck, (itk::Concept::HasNumericTraits<InputPixelType>));
98 
100 #endif
101 
102 protected:
105  {
106  }
107  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
108 
119  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) override;
120 
121 private:
122  VarianceImageFilter(const Self&) = delete;
123  void operator=(const Self&) = delete;
124 
126 };
127 
128 } // end namespace otb
129 
130 #ifndef OTB_MANUAL_INSTANTIATION
132 #endif
133 
134 #endif
Applies an averaging filter to an image.
InputImageType::RegionType InputImageRegionType
itk::ImageToImageFilter< InputImageType, OutputImageType > Superclass
OutputImageType::PixelType OutputPixelType
InputImageType::SizeType InputSizeType
VarianceImageFilter(const Self &)=delete
InputImageType::PixelType InputPixelType
itk::SmartPointer< const Self > ConstPointer
OutputImageType::RegionType OutputImageRegionType
void operator=(const Self &)=delete
itk::SmartPointer< Self > Pointer
itk::NumericTraits< InputPixelType >::RealType InputRealType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.