OTB  9.0.0
Orfeo Toolbox
otbCloudDetectionFilter.hxx
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_hxx
22 #define otbCloudDetectionFilter_hxx
23 
25 
26 namespace otb
27 {
28 
32 template <class TInputImage, class TOutputImage, class TFunction>
34 {
35 }
36 
40 template <class TInputImage, class TOutputImage, class TFunction>
41 void CloudDetectionFilter<TInputImage, TOutputImage, TFunction>::PrintSelf(std::ostream& os, itk::Indent indent) const
42 {
43  this->Superclass::PrintSelf(os, indent);
44 }
45 
49 template <class TInputImage, class TOutputImage, class TFunction>
51 {
52  unsigned int ReferencePixelNumberOfBands = 0;
53  ReferencePixelNumberOfBands = this->GetReferencePixel().GetSize();
55 
56  if (ReferencePixelNumberOfBands != this->GetInput()->GetNumberOfComponentsPerPixel())
57  {
58  itkExceptionMacro("The number of bands of the reference pixel is different from the number of bands of the input image. ");
59  }
60 }
61 
65 template <class TInputImage, class TOutputImage, class TFunction>
67 {
68  this->GetFunctor().SetVariance(var);
69 }
70 
74 template <class TInputImage, class TOutputImage, class TFunction>
76 {
77  return this->GetFunctor().GetVariance();
78 }
79 
83 template <class TInputImage, class TOutputImage, class TFunction>
85 {
86  this->GetFunctor().SetReferencePixel(ref);
87 }
88 
92 template <class TInputImage, class TOutputImage, class TFunction>
95 {
96  return this->GetFunctor().GetReferencePixel();
97 }
98 
102 template <class TInputImage, class TOutputImage, class TFunction>
104 {
105  this->GetFunctor().SetMinThreshold(threshold);
106 }
107 
111 template <class TInputImage, class TOutputImage, class TFunction>
113 {
114  this->GetFunctor().SetMaxThreshold(threshold);
115 }
116 
120 template <class TInputImage, class TOutputImage, class TFunction>
122 {
123  return this->GetFunctor().GetMinThreshold();
124 }
125 
129 template <class TInputImage, class TOutputImage, class TFunction>
131 {
132  return this->GetFunctor().GetMaxThreshold();
133 }
134 }
136 
137 #endif
otb::var
Definition: otbParserXPlugins.h:282
otb::CloudDetectionFilter::GetVariance
double GetVariance()
Definition: otbCloudDetectionFilter.hxx:75
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otbCloudDetectionFilter.h
otb::CloudDetectionFilter::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbCloudDetectionFilter.h:54
otb::CloudDetectionFilter::SetMinThreshold
void SetMinThreshold(double threshold)
Definition: otbCloudDetectionFilter.hxx:103
otb::CloudDetectionFilter::SetVariance
void SetVariance(double var)
Definition: otbCloudDetectionFilter.hxx:66
otb::CloudDetectionFilter::SetReferencePixel
void SetReferencePixel(InputPixelType ref)
Definition: otbCloudDetectionFilter.hxx:84
otb::CloudDetectionFilter::BeforeThreadedGenerateData
void BeforeThreadedGenerateData() override
Definition: otbCloudDetectionFilter.hxx:50
otb::CloudDetectionFilter::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Definition: otbCloudDetectionFilter.hxx:41
otb::CloudDetectionFilter::SetMaxThreshold
void SetMaxThreshold(double threshold)
Definition: otbCloudDetectionFilter.hxx:112
otb::CloudDetectionFilter::GetReferencePixel
InputPixelType GetReferencePixel()
Definition: otbCloudDetectionFilter.hxx:94
otb::CloudDetectionFilter::GetMaxThreshold
double GetMaxThreshold()
Definition: otbCloudDetectionFilter.hxx:130
otb::CloudDetectionFilter::CloudDetectionFilter
CloudDetectionFilter()
Definition: otbCloudDetectionFilter.hxx:33
otb::CloudDetectionFilter::GetMinThreshold
double GetMinThreshold()
Definition: otbCloudDetectionFilter.hxx:121