OTB  9.0.0
Orfeo Toolbox
otbBinaryFunctorNeighborhoodVectorImageFilter.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 otbBinaryFunctorNeighborhoodVectorImageFilter_h
22 #define otbBinaryFunctorNeighborhoodVectorImageFilter_h
23 
24 #include "itkInPlaceImageFilter.h"
25 #include "itkImageRegionIteratorWithIndex.h"
26 #include "itkConstNeighborhoodIterator.h"
27 
28 namespace otb
29 {
41 template <class TInputImage1, class TInputImage2, class TOutputImage, class TFunction>
42 class ITK_EXPORT BinaryFunctorNeighborhoodVectorImageFilter : public itk::InPlaceImageFilter<TInputImage1, TOutputImage>
43 {
44 public:
47  typedef itk::InPlaceImageFilter<TInputImage1, TOutputImage> Superclass;
48  typedef itk::SmartPointer<Self> Pointer;
49  typedef itk::SmartPointer<const Self> ConstPointer;
50 
52  itkNewMacro(Self);
53 
55  itkTypeMacro(BinaryFunctorNeighborhoodVectorImageFilter, InPlaceImageFilter);
56 
58  typedef TFunction FunctorType;
59  typedef TInputImage1 Input1ImageType;
60  typedef typename Input1ImageType::ConstPointer Input1ImagePointer;
61  typedef typename Input1ImageType::RegionType Input1ImageRegionType;
62  typedef typename Input1ImageType::PixelType Input1ImagePixelType;
63  typedef TInputImage2 Input2ImageType;
64  typedef typename Input2ImageType::ConstPointer Input2ImagePointer;
65  typedef typename Input2ImageType::RegionType Input2ImageRegionType;
66  typedef typename Input2ImageType::PixelType Input2ImagePixelType;
67  typedef TOutputImage OutputImageType;
68  typedef typename OutputImageType::Pointer OutputImagePointer;
69  typedef typename OutputImageType::RegionType OutputImageRegionType;
70  typedef typename OutputImageType::PixelType OutputImagePixelType;
71 
72  typedef itk::ProcessObject ProcessObjectType;
73 
75  void SetInput1(const TInputImage1* image1);
76 
78  void SetInput2(const TInputImage2* image2);
79 
83  void SetRadius(const unsigned char& min, const unsigned char& max);
84 
90  {
91  return m_Functor;
92  }
93 
100  void SetFunctor(const FunctorType& functor)
101  {
102  m_Functor = functor;
103  this->Modified();
104  }
106 
107  typedef itk::ConstNeighborhoodIterator<TInputImage1> NeighborhoodIteratorType1;
108  typedef itk::ConstNeighborhoodIterator<TInputImage2> NeighborhoodIteratorType2;
109 
110  typedef typename NeighborhoodIteratorType1::RadiusType RadiusType1;
111  typedef typename NeighborhoodIteratorType2::RadiusType RadiusType2;
112 
113  typedef unsigned char RadiusSizeType;
114 
115  itkSetMacro(Radius, RadiusSizeType);
116 
117 protected:
120  {
121  }
122 
133  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
134 
139  void GenerateOutputInformation(void) override;
140 
142 
143 private:
145  void operator=(const Self&) = delete;
146 
148 };
149 } // namespace otb
150 
151 #ifndef OTB_MANUAL_INSTANTIATION
153 #endif
154 
155 #endif
otb::BinaryFunctorNeighborhoodVectorImageFilter::Input2ImagePixelType
Input2ImageType::PixelType Input2ImagePixelType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:66
otbBinaryFunctorNeighborhoodVectorImageFilter.hxx
otb::BinaryFunctorNeighborhoodVectorImageFilter::RadiusType1
NeighborhoodIteratorType1::RadiusType RadiusType1
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:110
otb::BinaryFunctorNeighborhoodVectorImageFilter::Input2ImageRegionType
Input2ImageType::RegionType Input2ImageRegionType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:65
otb::BinaryFunctorNeighborhoodVectorImageFilter::Input2ImageType
TInputImage2 Input2ImageType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:63
otb::BinaryFunctorNeighborhoodVectorImageFilter::NeighborhoodIteratorType2
itk::ConstNeighborhoodIterator< TInputImage2 > NeighborhoodIteratorType2
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:108
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::BinaryFunctorNeighborhoodVectorImageFilter::NeighborhoodIteratorType1
itk::ConstNeighborhoodIterator< TInputImage1 > NeighborhoodIteratorType1
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:107
otb::BinaryFunctorNeighborhoodVectorImageFilter
Implements neighborhood-wise generic operation of two images being vector images.
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:42
otb::BinaryFunctorNeighborhoodVectorImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:49
otb::BinaryFunctorNeighborhoodVectorImageFilter::GetFunctor
FunctorType & GetFunctor()
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:89
otb::BinaryFunctorNeighborhoodVectorImageFilter::Input2ImagePointer
Input2ImageType::ConstPointer Input2ImagePointer
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:64
otb::BinaryFunctorNeighborhoodVectorImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:67
otb::BinaryFunctorNeighborhoodVectorImageFilter::OutputImagePointer
OutputImageType::Pointer OutputImagePointer
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:68
otb::BinaryFunctorNeighborhoodVectorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:48
otb::BinaryFunctorNeighborhoodVectorImageFilter::Input1ImagePointer
Input1ImageType::ConstPointer Input1ImagePointer
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:60
otb::BinaryFunctorNeighborhoodVectorImageFilter::Input1ImageType
TInputImage1 Input1ImageType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:59
otb::BinaryFunctorNeighborhoodVectorImageFilter::OutputImagePixelType
OutputImageType::PixelType OutputImagePixelType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:70
otb::BinaryFunctorNeighborhoodVectorImageFilter::Self
BinaryFunctorNeighborhoodVectorImageFilter Self
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:46
otb::BinaryFunctorNeighborhoodVectorImageFilter::m_Functor
FunctorType m_Functor
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:147
otb::BinaryFunctorNeighborhoodVectorImageFilter::RadiusType2
NeighborhoodIteratorType2::RadiusType RadiusType2
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:111
otb::BinaryFunctorNeighborhoodVectorImageFilter::SetFunctor
void SetFunctor(const FunctorType &functor)
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:100
otb::BinaryFunctorNeighborhoodVectorImageFilter::~BinaryFunctorNeighborhoodVectorImageFilter
~BinaryFunctorNeighborhoodVectorImageFilter() override
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:119
otb::Functor::KullbackLeiblerProfile< itk::ConstNeighborhoodIterator< TInputImage1 >, itk::ConstNeighborhoodIterator< TInputImage2 >, TOutputImage::PixelType >
otb::BinaryFunctorNeighborhoodVectorImageFilter::Superclass
itk::InPlaceImageFilter< TInputImage1, TOutputImage > Superclass
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:47
otb::BinaryFunctorNeighborhoodVectorImageFilter::ProcessObjectType
itk::ProcessObject ProcessObjectType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:72
otb::BinaryFunctorNeighborhoodVectorImageFilter::RadiusSizeType
unsigned char RadiusSizeType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:113
otb::BinaryFunctorNeighborhoodVectorImageFilter::FunctorType
TFunction FunctorType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:55
otb::BinaryFunctorNeighborhoodVectorImageFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:69
otb::BinaryFunctorNeighborhoodVectorImageFilter::m_Radius
RadiusSizeType m_Radius
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:141
otb::BinaryFunctorNeighborhoodVectorImageFilter::Input1ImagePixelType
Input1ImageType::PixelType Input1ImagePixelType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:62
otb::BinaryFunctorNeighborhoodVectorImageFilter::Input1ImageRegionType
Input1ImageType::RegionType Input1ImageRegionType
Definition: otbBinaryFunctorNeighborhoodVectorImageFilter.h:61