OTB  9.0.0
Orfeo Toolbox
otbBinaryFunctorImageFilter.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 otbBinaryFunctorImageFilter_h
22 #define otbBinaryFunctorImageFilter_h
23 
24 #include "itkBinaryFunctorImageFilter.h"
25 
26 namespace otb
27 {
43 template <class TInputImage1, class TInputImage2, class TOutputImage, class TFunction>
44 class ITK_EXPORT BinaryFunctorImageFilter : public itk::BinaryFunctorImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction>
45 {
46 public:
47 
50  typedef itk::BinaryFunctorImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunction> Superclass;
51  typedef itk::SmartPointer<Self> Pointer;
52  typedef itk::SmartPointer<const Self> ConstPointer;
53 
55  itkNewMacro(Self);
56 
58  itkTypeMacro(BinaryFunctorImageFilter, itk::BinaryFunctorImageFilter);
59 
60 protected:
63  {
64  }
65 
74  void GenerateOutputInformation() override
75  {
76  Superclass::GenerateOutputInformation();
77  typename Superclass::OutputImagePointer outputPtr = this->GetOutput();
78  outputPtr->SetNumberOfComponentsPerPixel( // propagate vector length info
79  this->GetFunctor().GetOutputSize());
80  }
82 
83 private:
84  BinaryFunctorImageFilter(const Self&) = delete;
85  void operator=(const Self&) = delete;
86 };
87 
88 } // end namespace otb
89 
90 #endif
otb::BinaryFunctorImageFilter
Implements pixel-wise generic operation on two images.
Definition: otbBinaryFunctorImageFilter.h:44
otb::BinaryFunctorImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbBinaryFunctorImageFilter.h:52
otb::BinaryFunctorImageFilter::~BinaryFunctorImageFilter
~BinaryFunctorImageFilter() override
Definition: otbBinaryFunctorImageFilter.h:62
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::BinaryFunctorImageFilter::Superclass
itk::BinaryFunctorImageFilter< TInputImage1, TInputImage2, TOutputImage, TFunction > Superclass
Definition: otbBinaryFunctorImageFilter.h:50
otb::BinaryFunctorImageFilter::GenerateOutputInformation
void GenerateOutputInformation() override
Definition: otbBinaryFunctorImageFilter.h:74
otb::BinaryFunctorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbBinaryFunctorImageFilter.h:51
otb::BinaryFunctorImageFilter::BinaryFunctorImageFilter
BinaryFunctorImageFilter()
Definition: otbBinaryFunctorImageFilter.h:61
otb::BinaryFunctorImageFilter::Self
BinaryFunctorImageFilter Self
Definition: otbBinaryFunctorImageFilter.h:49