OTB  9.0.0
Orfeo Toolbox
otbVarianceImageFilter.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 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
96 
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 ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) 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
otb::VarianceImageFilter::Superclass
itk::ImageToImageFilter< InputImageType, OutputImageType > Superclass
Definition: otbVarianceImageFilter.h:61
otb::VarianceImageFilter::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbVarianceImageFilter.h:69
otb::VarianceImageFilter::Self
VarianceImageFilter Self
Definition: otbVarianceImageFilter.h:60
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::VarianceImageFilter::m_Radius
InputSizeType m_Radius
Definition: otbVarianceImageFilter.h:125
otb::VarianceImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbVarianceImageFilter.h:63
otb::VarianceImageFilter::OutputPixelType
OutputImageType::PixelType OutputPixelType
Definition: otbVarianceImageFilter.h:73
otb::VarianceImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbVarianceImageFilter.h:57
otb::VarianceImageFilter::~VarianceImageFilter
~VarianceImageFilter() override
Definition: otbVarianceImageFilter.h:104
otbVarianceImageFilter.hxx
otb::VarianceImageFilter::InputImageType
TInputImage InputImageType
Definition: otbVarianceImageFilter.h:56
otb::VarianceImageFilter::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: otbVarianceImageFilter.h:76
otb::VarianceImageFilter::InputSizeType
InputImageType::SizeType InputSizeType
Definition: otbVarianceImageFilter.h:79
otb::VarianceImageFilter
Applies an averaging filter to an image.
Definition: otbVarianceImageFilter.h:47
otb::VarianceImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbVarianceImageFilter.h:62
otb::VarianceImageFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: otbVarianceImageFilter.h:77
otb::VarianceImageFilter::InputRealType
itk::NumericTraits< InputPixelType >::RealType InputRealType
Definition: otbVarianceImageFilter.h:74