OTB  9.0.0
Orfeo Toolbox
otbUnaryFunctorVectorImageFilter.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 otbUnaryFunctorVectorImageFilter_h
22 #define otbUnaryFunctorVectorImageFilter_h
23 
24 #include "itkInPlaceImageFilter.h"
25 
26 namespace otb
27 {
39 template <class TInputImage, class TOutputImage, class TFunction>
40 class ITK_EXPORT UnaryFunctorVectorImageFilter : public itk::InPlaceImageFilter<TInputImage, TOutputImage>
41 {
42 public:
45  typedef itk::InPlaceImageFilter<TInputImage, TOutputImage> Superclass;
46  typedef itk::SmartPointer<Self> Pointer;
47  typedef itk::SmartPointer<const Self> ConstPointer;
48 
50  itkNewMacro(Self);
51 
53  itkTypeMacro(UnaryFunctorVectorImageFilter, InPlaceImageFilter);
54 
56  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
57  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
59 
61  typedef TFunction FunctorType;
62  typedef TInputImage InputImageType;
63  typedef typename InputImageType::ConstPointer InputImagePointer;
64  typedef typename InputImageType::RegionType InputImageRegionType;
65  typedef typename InputImageType::PixelType InputImagePixelType;
66  typedef TOutputImage OutputImageType;
67  typedef typename OutputImageType::Pointer OutputImagePointer;
68  typedef typename OutputImageType::RegionType OutputImageRegionType;
69  typedef typename OutputImageType::PixelType OutputImagePixelType;
70 
71  typedef itk::ProcessObject ProcessObjectType;
72 
78  {
79  return m_Functor;
80  }
81 
88  void SetFunctor(const FunctorType& functor)
89  {
90  m_Functor = functor;
91  this->Modified();
92  }
94 
95 protected:
98  {
99  }
100 
111  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
112 
117  void GenerateOutputInformation(void) override;
118 
119 private:
120  UnaryFunctorVectorImageFilter(const Self&) = delete;
121  void operator=(const Self&) = delete;
122 
124 }; // end of class
125 
126 } // namespace otb
127 
128 #ifndef OTB_MANUAL_INSTANTIATION
130 #endif
131 
132 #endif
otb::UnaryFunctorVectorImageFilter::OutputImagePixelType
OutputImageType::PixelType OutputImagePixelType
Definition: otbUnaryFunctorVectorImageFilter.h:69
otbUnaryFunctorVectorImageFilter.hxx
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::UnaryFunctorVectorImageFilter::ProcessObjectType
itk::ProcessObject ProcessObjectType
Definition: otbUnaryFunctorVectorImageFilter.h:71
otb::UnaryFunctorVectorImageFilter::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: otbUnaryFunctorVectorImageFilter.h:65
otb::UnaryFunctorVectorImageFilter::Superclass
itk::InPlaceImageFilter< TInputImage, TOutputImage > Superclass
Definition: otbUnaryFunctorVectorImageFilter.h:45
otb::UnaryFunctorVectorImageFilter::SetFunctor
void SetFunctor(const FunctorType &functor)
Definition: otbUnaryFunctorVectorImageFilter.h:88
otb::UnaryFunctorVectorImageFilter::~UnaryFunctorVectorImageFilter
~UnaryFunctorVectorImageFilter() override
Definition: otbUnaryFunctorVectorImageFilter.h:97
otb::UnaryFunctorVectorImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbUnaryFunctorVectorImageFilter.h:66
otb::UnaryFunctorVectorImageFilter::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: otbUnaryFunctorVectorImageFilter.h:64
otb::UnaryFunctorVectorImageFilter::InputImagePointer
InputImageType::ConstPointer InputImagePointer
Definition: otbUnaryFunctorVectorImageFilter.h:63
otb::UnaryFunctorVectorImageFilter::Self
UnaryFunctorVectorImageFilter Self
Definition: otbUnaryFunctorVectorImageFilter.h:44
otb::Functor::NormalizeVectorImageFunctor< TInputImage::PixelType, TOutputImage::PixelType >
otb::UnaryFunctorVectorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbUnaryFunctorVectorImageFilter.h:46
otb::UnaryFunctorVectorImageFilter
Implements neighborhood-wise generic operation of one vector image.
Definition: otbUnaryFunctorVectorImageFilter.h:40
otb::UnaryFunctorVectorImageFilter::m_Functor
FunctorType m_Functor
Definition: otbUnaryFunctorVectorImageFilter.h:123
otb::UnaryFunctorVectorImageFilter::GetFunctor
FunctorType & GetFunctor()
Definition: otbUnaryFunctorVectorImageFilter.h:77
otb::UnaryFunctorVectorImageFilter::FunctorType
TFunction FunctorType
Definition: otbUnaryFunctorVectorImageFilter.h:61
otb::UnaryFunctorVectorImageFilter::OutputImagePointer
OutputImageType::Pointer OutputImagePointer
Definition: otbUnaryFunctorVectorImageFilter.h:67
otb::UnaryFunctorVectorImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbUnaryFunctorVectorImageFilter.h:47
otb::UnaryFunctorVectorImageFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: otbUnaryFunctorVectorImageFilter.h:68
otb::UnaryFunctorVectorImageFilter::InputImageType
TInputImage InputImageType
Definition: otbUnaryFunctorVectorImageFilter.h:62