OTB  9.0.0
Orfeo Toolbox
otbBoxAndWhiskerImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  * Copyright (C) 2007-2012 Institut Mines Telecom / Telecom Bretagne
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbBoxAndWhiskerImageFilter_h
23 #define otbBoxAndWhiskerImageFilter_h
24 
25 #include "itkMacro.h"
26 #include "itkUnaryFunctorImageFilter.h"
27 
28 namespace otb
29 {
30 
49 template <class TInputImage>
50 class ITK_EXPORT BoxAndWhiskerImageFilter : public itk::InPlaceImageFilter<TInputImage>
51 {
52 public:
55  typedef typename itk::InPlaceImageFilter<TInputImage> Superclass;
56  typedef itk::SmartPointer<Self> Pointer;
57  typedef itk::SmartPointer<const Self> ConstPointer;
58 
60  itkNewMacro(Self);
61 
63  itkTypeMacro(BoxAndWhiskerImageFilter, InPlaceImageFilter);
64 
66  typedef typename Superclass::OutputImageType OutputImageType;
67  typedef typename Superclass::OutputImagePointer OutputImagePointer;
68  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
69  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
70 
71  typedef typename Superclass::InputImageType InputImageType;
72  typedef typename Superclass::InputImagePointer InputImagePointer;
73  typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
74  typedef typename Superclass::InputImageRegionType InputImageRegionType;
75  typedef typename Superclass::InputImagePixelType InputImagePixelType;
76 
77  typedef typename InputImageType::PixelType PixelType;
78  typedef typename InputImageType::InternalPixelType ValueType;
79  typedef typename InputImageType::SizeType SizeType;
80  typedef typename InputImageType::RegionType RegionType;
81 
83  itkStaticConstMacro(InputImageDimension, unsigned int, InputImageType::ImageDimension);
84  itkStaticConstMacro(OutputImageDimension, unsigned int, OutputImageType::ImageDimension);
86 
88  itkSetMacro(Radius, SizeType);
89  itkGetConstReferenceMacro(Radius, SizeType);
91 
93  itkGetConstMacro(Beta, double);
94  itkSetMacro(Beta, double);
95  itkGetConstMacro(NumberFound, unsigned int);
97 
98 protected:
101  {
102  }
103 
105  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
106  void GenerateOutputInformation() override;
107  void AllocateOutputs() override;
109 
111  PixelType PerformBoxAndWhiskerDetection(const PixelType& pixel);
112 
113 private:
114  BoxAndWhiskerImageFilter(const Self&);
115  void operator=(const Self&); // not implemented
116 
118  double m_Beta;
119  long int m_NumberFound;
120 
121 }; // end of class BoxAndWhiskerImageFilter
122 
123 } // end of namespace otb
124 
125 #ifndef OTB_MANUAL_INSTANTIATION
127 #endif
128 
129 #endif
otb::BoxAndWhiskerImageFilter::SizeType
InputImageType::SizeType SizeType
Definition: otbBoxAndWhiskerImageFilter.h:79
otb::BoxAndWhiskerImageFilter::~BoxAndWhiskerImageFilter
~BoxAndWhiskerImageFilter() override
Definition: otbBoxAndWhiskerImageFilter.h:100
otb::BoxAndWhiskerImageFilter::OutputImagePointer
Superclass::OutputImagePointer OutputImagePointer
Definition: otbBoxAndWhiskerImageFilter.h:67
otb::BoxAndWhiskerImageFilter::InputImageRegionType
Superclass::InputImageRegionType InputImageRegionType
Definition: otbBoxAndWhiskerImageFilter.h:74
otb::BoxAndWhiskerImageFilter::OutputImageRegionType
Superclass::OutputImageRegionType OutputImageRegionType
Definition: otbBoxAndWhiskerImageFilter.h:68
otb::BoxAndWhiskerImageFilter::m_NumberFound
long int m_NumberFound
Definition: otbBoxAndWhiskerImageFilter.h:119
otb::BoxAndWhiskerImageFilter::RegionType
InputImageType::RegionType RegionType
Definition: otbBoxAndWhiskerImageFilter.h:80
otb::BoxAndWhiskerImageFilter
This class performs the detection of outlier with the Box and Whisker technique.
Definition: otbBoxAndWhiskerImageFilter.h:50
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::BoxAndWhiskerImageFilter::m_Beta
double m_Beta
Definition: otbBoxAndWhiskerImageFilter.h:118
otb::BoxAndWhiskerImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbBoxAndWhiskerImageFilter.h:57
otb::BoxAndWhiskerImageFilter::InputImageConstPointer
Superclass::InputImageConstPointer InputImageConstPointer
Definition: otbBoxAndWhiskerImageFilter.h:73
otb::BoxAndWhiskerImageFilter::ValueType
InputImageType::InternalPixelType ValueType
Definition: otbBoxAndWhiskerImageFilter.h:78
otbBoxAndWhiskerImageFilter.hxx
otb::BoxAndWhiskerImageFilter::InputImageType
Superclass::InputImageType InputImageType
Definition: otbBoxAndWhiskerImageFilter.h:71
otb::BoxAndWhiskerImageFilter::PixelType
InputImageType::PixelType PixelType
Definition: otbBoxAndWhiskerImageFilter.h:77
otb::BoxAndWhiskerImageFilter::Superclass
itk::InPlaceImageFilter< TInputImage > Superclass
Definition: otbBoxAndWhiskerImageFilter.h:55
otb::BoxAndWhiskerImageFilter::InputImagePointer
Superclass::InputImagePointer InputImagePointer
Definition: otbBoxAndWhiskerImageFilter.h:72
otb::BoxAndWhiskerImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbBoxAndWhiskerImageFilter.h:56
otb::BoxAndWhiskerImageFilter::OutputImagePixelType
Superclass::OutputImagePixelType OutputImagePixelType
Definition: otbBoxAndWhiskerImageFilter.h:69
otb::BoxAndWhiskerImageFilter::m_Radius
SizeType m_Radius
Definition: otbBoxAndWhiskerImageFilter.h:117
otb::BoxAndWhiskerImageFilter::OutputImageType
Superclass::OutputImageType OutputImageType
Definition: otbBoxAndWhiskerImageFilter.h:63
otb::BoxAndWhiskerImageFilter::Self
BoxAndWhiskerImageFilter Self
Definition: otbBoxAndWhiskerImageFilter.h:54
otb::BoxAndWhiskerImageFilter::InputImagePixelType
Superclass::InputImagePixelType InputImagePixelType
Definition: otbBoxAndWhiskerImageFilter.h:75