OTB  9.0.0
Orfeo Toolbox
otbAssociativeSymmetricalSumImageFilter.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 otbAssociativeSymmetricalSumImageFilter_h
22 #define otbAssociativeSymmetricalSumImageFilter_h
23 
24 #include "itkBinaryFunctorImageFilter.h"
25 
26 namespace otb
27 {
28 
44 namespace Functor
45 {
51 template <class TInput1, class TInput2, class TOutput>
52 class ITK_EXPORT AssociativeSymmetricalSum
53 {
54 public:
57  {
58  }
59 
60  inline TOutput operator()(const TInput1 X, const TInput2 Y)
61  {
62 
63  TOutput SumXY = 0.;
64 
65  SumXY += static_cast<TOutput>((X * Y) / (1. - X - Y + (2 * X * Y)));
66 
67  return (SumXY);
68  }
69 };
70 }
71 
72 template <class TInputImage1, class TInputImage2, class TOutputImage>
74  : public itk::BinaryFunctorImageFilter<
75  TInputImage1, TInputImage2, TOutputImage,
76  Functor::AssociativeSymmetricalSum<typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType>>
77 {
78 public:
81  typedef itk::BinaryFunctorImageFilter<
82  TInputImage1, TInputImage2, TOutputImage,
85  typedef itk::SmartPointer<Self> Pointer;
86  typedef itk::SmartPointer<const Self> ConstPointer;
87 
89  itkNewMacro(Self);
90 
91 protected:
93  {
94  }
96  {
97  }
98 
99 private:
100  AssociativeSymmetricalSumImageFilter(const Self&) = delete;
101  void operator=(const Self&) = delete;
102 };
103 
104 } // end namespace otb
105 
106 #endif
otb::Functor::AssociativeSymmetricalSum::~AssociativeSymmetricalSum
virtual ~AssociativeSymmetricalSum()
Definition: otbAssociativeSymmetricalSumImageFilter.h:56
otb::Functor::AssociativeSymmetricalSum
Functor used with the AssociativeSymmetricalSumImageFilter.
Definition: otbAssociativeSymmetricalSumImageFilter.h:52
otb::AssociativeSymmetricalSumImageFilter
Implements an asymmetric fusion of line detector image filter.
Definition: otbAssociativeSymmetricalSumImageFilter.h:73
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::AssociativeSymmetricalSumImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbAssociativeSymmetricalSumImageFilter.h:86
otb::AssociativeSymmetricalSumImageFilter::~AssociativeSymmetricalSumImageFilter
~AssociativeSymmetricalSumImageFilter() override
Definition: otbAssociativeSymmetricalSumImageFilter.h:95
otb::Functor::AssociativeSymmetricalSum::AssociativeSymmetricalSum
AssociativeSymmetricalSum()
Definition: otbAssociativeSymmetricalSumImageFilter.h:55
otb::AssociativeSymmetricalSumImageFilter::AssociativeSymmetricalSumImageFilter
AssociativeSymmetricalSumImageFilter()
Definition: otbAssociativeSymmetricalSumImageFilter.h:92
otb::AssociativeSymmetricalSumImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbAssociativeSymmetricalSumImageFilter.h:85
otb::Functor::AssociativeSymmetricalSum::operator()
TOutput operator()(const TInput1 X, const TInput2 Y)
Definition: otbAssociativeSymmetricalSumImageFilter.h:60
otb::AssociativeSymmetricalSumImageFilter::Superclass
itk::BinaryFunctorImageFilter< TInputImage1, TInputImage2, TOutputImage, Functor::AssociativeSymmetricalSum< typename TInputImage1::PixelType, typename TInputImage1::PixelType, typename TOutputImage::PixelType > > Superclass
Definition: otbAssociativeSymmetricalSumImageFilter.h:84
otb::AssociativeSymmetricalSumImageFilter::Self
AssociativeSymmetricalSumImageFilter Self
Definition: otbAssociativeSymmetricalSumImageFilter.h:80