OTB  9.0.0
Orfeo Toolbox
otbCloudDetectionFilter.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 otbCloudDetectionFilter_h
22 #define otbCloudDetectionFilter_h
23 
25 #include "itkUnaryFunctorImageFilter.h"
26 
27 namespace otb
28 {
34 template <class TInputImage, class TOutputImage,
35  class TFunction = Functor::CloudDetectionFunctor<typename TInputImage::PixelType, typename TOutputImage::PixelType>>
36 class ITK_EXPORT CloudDetectionFilter : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction>
37 {
38 public:
41  typedef typename itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, TFunction> Superclass;
42  typedef itk::SmartPointer<Self> Pointer;
43  typedef itk::SmartPointer<const Self> ConstPointer;
44 
46  itkNewMacro(Self);
47 
49  itkTypeMacro(CloudDetectionFilter, UnaryFunctorImageFilter);
50 
52  typedef TInputImage InputImageType;
53  typedef typename InputImageType::Pointer InputImagePointer;
54  typedef typename InputImageType::PixelType InputPixelType;
55  typedef TOutputImage OutputImageType;
56  typedef typename OutputImageType::Pointer OutputImagePointer;
57  typedef typename OutputImageType::RegionType OutputImageRegionType;
58  typedef typename OutputImageType::PixelType OutputPixelType;
59 
61  void SetReferencePixel(InputPixelType ref);
62  void SetVariance(double var);
63  void SetMinThreshold(double threshold);
64  void SetMaxThreshold(double threshold);
65  InputPixelType GetReferencePixel();
66  double GetMinThreshold();
67  double GetMaxThreshold();
68  double GetVariance();
70 
71 protected:
73 
75  {
76  }
77 
78  void BeforeThreadedGenerateData() override;
79 
80  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
81 
82 private:
83  CloudDetectionFilter(const Self&) = delete;
84  void operator=(const Self&) = delete;
85 };
86 
87 } // end namespace otb
88 
89 #ifndef OTB_MANUAL_INSTANTIATION
91 #endif
92 
93 #endif
otb::CloudDetectionFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbCloudDetectionFilter.h:42
otb::var
Definition: otbParserXPlugins.h:282
otb::CloudDetectionFilter::~CloudDetectionFilter
~CloudDetectionFilter() override
Definition: otbCloudDetectionFilter.h:74
otbCloudDetectionFunctor.h
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::CloudDetectionFilter::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbCloudDetectionFilter.h:54
otb::CloudDetectionFilter::InputImageType
TInputImage InputImageType
Definition: otbCloudDetectionFilter.h:49
otb::CloudDetectionFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: otbCloudDetectionFilter.h:57
otb::CloudDetectionFilter::OutputPixelType
OutputImageType::PixelType OutputPixelType
Definition: otbCloudDetectionFilter.h:58
otb::CloudDetectionFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbCloudDetectionFilter.h:43
otb::CloudDetectionFilter::OutputImagePointer
OutputImageType::Pointer OutputImagePointer
Definition: otbCloudDetectionFilter.h:56
otb::CloudDetectionFilter
Applies cloud detection functor to an image.
Definition: otbCloudDetectionFilter.h:36
otb::CloudDetectionFilter::InputImagePointer
InputImageType::Pointer InputImagePointer
Definition: otbCloudDetectionFilter.h:53
otb::CloudDetectionFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbCloudDetectionFilter.h:55
otb::CloudDetectionFilter::Self
CloudDetectionFilter Self
Definition: otbCloudDetectionFilter.h:40
otbCloudDetectionFilter.hxx
otb::CloudDetectionFilter::Superclass
itk::UnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction > Superclass
Definition: otbCloudDetectionFilter.h:41