OTB  9.0.0
Orfeo Toolbox
otbUnaryImageFunctorWithVectorImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbUnaryImageFunctorWithVectorImageFilter_h
23 #define otbUnaryImageFunctorWithVectorImageFilter_h
24 
25 #include "otbVectorImage.h"
26 #include "itkVariableLengthVector.h"
27 #include "itkUnaryFunctorImageFilter.h"
28 
29 namespace otb
30 {
45 template <class TInputImage, class TOutputImage, class TFunction>
46 class ITK_EXPORT UnaryImageFunctorWithVectorImageFilter : public itk::InPlaceImageFilter<TInputImage, TOutputImage>
47 
48 {
49 public:
52  typedef itk::InPlaceImageFilter<TInputImage, TOutputImage> Superclass;
53  typedef itk::SmartPointer<Self> Pointer;
54  typedef itk::SmartPointer<const Self> ConstPointer;
55 
57  itkNewMacro(Self);
58 
60  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
61  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
63 
65  typedef TInputImage InputImageType;
66  typedef TOutputImage OutputImageType;
67  typedef TFunction FunctorType;
68 
70  typedef typename InputImageType::PixelType InputPixelType;
71  typedef typename InputImageType::InternalPixelType InputInternalPixelType;
72  typedef typename InputImageType::RegionType InputImageRegionType;
73  typedef typename OutputImageType::PixelType OutputPixelType;
74  typedef typename OutputImageType::InternalPixelType OutputInternalPixelType;
75  typedef typename OutputImageType::RegionType OutputImageRegionType;
76 
78  typedef typename InputImageType::SizeType SizeType;
79 
80  typedef std::vector<FunctorType> FunctorVectorType;
81 
83  itkTypeMacro(UnaryImageFunctorWithVectorImageFilter, itk::InPlaceImageFilter);
84 
87  {
88  return m_FunctorVector;
89  }
90 
91 protected:
94  {
95  }
96 
105  void GenerateOutputInformation() override;
106 
117  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
118 
119  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
120 
121 private:
124 };
125 
126 } // end namespace otb
127 
128 #ifndef OTB_MANUAL_INSTANTIATION
130 #endif
131 
132 #endif
otb::UnaryImageFunctorWithVectorImageFilter::InputImageType
TInputImage InputImageType
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:65
otbVectorImage.h
otb::UnaryImageFunctorWithVectorImageFilter::OutputPixelType
OutputImageType::PixelType OutputPixelType
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:73
otb::UnaryImageFunctorWithVectorImageFilter::FunctorType
TFunction FunctorType
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:67
otb::UnaryImageFunctorWithVectorImageFilter::Superclass
itk::InPlaceImageFilter< TInputImage, TOutputImage > Superclass
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:52
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::UnaryImageFunctorWithVectorImageFilter::OutputInternalPixelType
OutputImageType::InternalPixelType OutputInternalPixelType
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:74
otb::UnaryImageFunctorWithVectorImageFilter::Self
UnaryImageFunctorWithVectorImageFilter Self
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:51
otb::UnaryImageFunctorWithVectorImageFilter::FunctorVectorType
std::vector< FunctorType > FunctorVectorType
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:80
otb::UnaryImageFunctorWithVectorImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:54
otb::UnaryImageFunctorWithVectorImageFilter
Applies a functor to a VectorImage.
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:46
otb::UnaryImageFunctorWithVectorImageFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:75
otb::UnaryImageFunctorWithVectorImageFilter::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:70
otb::UnaryImageFunctorWithVectorImageFilter::GetFunctorVector
FunctorVectorType & GetFunctorVector(void)
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:86
otb::UnaryImageFunctorWithVectorImageFilter::m_FunctorVector
FunctorVectorType m_FunctorVector
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:123
otb::UnaryImageFunctorWithVectorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:53
otbUnaryImageFunctorWithVectorImageFilter.hxx
otb::UnaryImageFunctorWithVectorImageFilter::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:72
otb::UnaryImageFunctorWithVectorImageFilter::~UnaryImageFunctorWithVectorImageFilter
~UnaryImageFunctorWithVectorImageFilter() override
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:93
otb::UnaryImageFunctorWithVectorImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:66
otb::UnaryImageFunctorWithVectorImageFilter::InputInternalPixelType
InputImageType::InternalPixelType InputInternalPixelType
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:71
otb::UnaryImageFunctorWithVectorImageFilter::SizeType
InputImageType::SizeType SizeType
Definition: otbUnaryImageFunctorWithVectorImageFilter.h:78