OTB  6.7.0
Orfeo Toolbox
otbVarianceImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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 :
48  public itk::ImageToImageFilter<TInputImage, TOutputImage>
49 {
50 public:
52  itkStaticConstMacro(InputImageDimension, unsigned int,
53  TInputImage::ImageDimension);
54  itkStaticConstMacro(OutputImageDimension, unsigned int,
55  TOutputImage::ImageDimension);
57 
59  typedef TInputImage InputImageType;
60  typedef TOutputImage OutputImageType;
61 
67 
69  itkNewMacro(Self);
70 
72  itkTypeMacro(VarianceImageFilter, ImageToImageFilter);
73 
75  typedef typename InputImageType::PixelType InputPixelType;
76  typedef typename OutputImageType::PixelType OutputPixelType;
78 
79  typedef typename InputImageType::RegionType InputImageRegionType;
80  typedef typename OutputImageType::RegionType OutputImageRegionType;
81 
83 
85  itkSetMacro(Radius, InputSizeType);
86 
88  itkGetConstReferenceMacro(Radius, InputSizeType);
89 
96  void GenerateInputRequestedRegion()
97  throw(itk::InvalidRequestedRegionError) override;
98 
99 #ifdef ITK_USE_CONCEPT_CHECKING
100 
101  itkConceptMacro(InputHasNumericTraitsCheck,
103 
105 #endif
106 
107 protected:
109  ~VarianceImageFilter() override {}
110  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
111 
122  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
123  itk::ThreadIdType threadId) override;
124 
125 private:
126  VarianceImageFilter(const Self &) = delete;
127  void operator =(const Self&) = delete;
128 
130 };
131 
132 } // end namespace otb
133 
134 #ifndef OTB_MANUAL_INSTANTIATION
136 #endif
137 
138 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
itk::SmartPointer< Self > Pointer
InputImageType::RegionType InputImageRegionType
Applies an averaging filter to an image.
itk::ImageToImageFilter< InputImageType, OutputImageType > Superclass
itk::NumericTraits< InputPixelType >::RealType InputRealType
InputImageType::SizeType InputSizeType
unsigned int ThreadIdType
InputImageType::PixelType InputPixelType
#define itkConceptMacro(name, concept)
OutputImageType::PixelType OutputPixelType
OutputImageType::RegionType OutputImageRegionType
itk::SmartPointer< const Self > ConstPointer