OTB  9.0.0
Orfeo Toolbox
otbUnaryFunctorNeighborhoodVectorImageFilter.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 otbUnaryFunctorNeighborhoodVectorImageFilter_h
22 #define otbUnaryFunctorNeighborhoodVectorImageFilter_h
23 
24 #include "itkInPlaceImageFilter.h"
25 #include "itkImageRegionIteratorWithIndex.h"
26 #include "itkConstNeighborhoodIterator.h"
27 
28 namespace otb
29 {
41 template <class TInputImage, class TOutputImage, class TFunction>
42 class ITK_EXPORT UnaryFunctorNeighborhoodVectorImageFilter : public itk::InPlaceImageFilter<TInputImage, TOutputImage>
43 {
44 public:
47  typedef itk::InPlaceImageFilter<TInputImage, TOutputImage> Superclass;
48  typedef itk::SmartPointer<Self> Pointer;
49  typedef itk::SmartPointer<const Self> ConstPointer;
50 
52  itkNewMacro(Self);
53 
55  itkTypeMacro(UnaryFunctorNeighborhoodVectorImageFilter, InPlaceImageFilter);
56 
58  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
59  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
61 
63  typedef TFunction FunctorType;
64  typedef TInputImage InputImageType;
65  typedef typename InputImageType::ConstPointer InputImagePointer;
66  typedef typename InputImageType::RegionType InputImageRegionType;
67  typedef typename InputImageType::PixelType InputImagePixelType;
68  typedef TOutputImage OutputImageType;
69  typedef typename OutputImageType::Pointer OutputImagePointer;
70  typedef typename OutputImageType::RegionType OutputImageRegionType;
71  typedef typename OutputImageType::PixelType OutputImagePixelType;
72 
73  typedef itk::ProcessObject ProcessObjectType;
74 
80  {
81  return m_Functor;
82  }
83 
90  void SetFunctor(const FunctorType& functor)
91  {
92  m_Functor = functor;
93  this->Modified();
94  }
96 
97  typedef itk::ConstNeighborhoodIterator<TInputImage> NeighborhoodIteratorType;
98  typedef typename NeighborhoodIteratorType::RadiusType RadiusType;
99 
105  itkSetMacro(Radius, RadiusType);
106  itkGetMacro(Radius, RadiusType);
108 
109 protected:
112  {
113  }
114 
125  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
126 
131  void GenerateOutputInformation(void) override;
132 
134 
135 private:
137  void operator=(const Self&) = delete;
138 
140 }; // end of class
141 
142 } // namespace otb
143 
144 #ifndef OTB_MANUAL_INSTANTIATION
146 #endif
147 
148 #endif
otb::UnaryFunctorNeighborhoodVectorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:48
otb::UnaryFunctorNeighborhoodVectorImageFilter::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:67
otb::UnaryFunctorNeighborhoodVectorImageFilter::OutputImagePointer
OutputImageType::Pointer OutputImagePointer
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:69
otb::UnaryFunctorNeighborhoodVectorImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:68
otb::UnaryFunctorNeighborhoodVectorImageFilter::RadiusType
NeighborhoodIteratorType::RadiusType RadiusType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:98
otb::UnaryFunctorNeighborhoodVectorImageFilter::NeighborhoodIteratorType
itk::ConstNeighborhoodIterator< TInputImage > NeighborhoodIteratorType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:97
otb::UnaryFunctorNeighborhoodVectorImageFilter::OutputImagePixelType
OutputImageType::PixelType OutputImagePixelType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:71
otb::UnaryFunctorNeighborhoodVectorImageFilter::InputImagePointer
InputImageType::ConstPointer InputImagePointer
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:65
otb::UnaryFunctorNeighborhoodVectorImageFilter::Self
UnaryFunctorNeighborhoodVectorImageFilter Self
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:46
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::UnaryFunctorNeighborhoodVectorImageFilter::InputImageType
TInputImage InputImageType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:64
otb::Functor::SobelOperator< itk::ConstNeighborhoodIterator< TInputImage >, TOutputImage::PixelType >
otb::UnaryFunctorNeighborhoodVectorImageFilter::~UnaryFunctorNeighborhoodVectorImageFilter
~UnaryFunctorNeighborhoodVectorImageFilter() override
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:111
otb::UnaryFunctorNeighborhoodVectorImageFilter::m_Radius
RadiusType m_Radius
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:133
otb::UnaryFunctorNeighborhoodVectorImageFilter::m_Functor
FunctorType m_Functor
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:139
otbUnaryFunctorNeighborhoodVectorImageFilter.hxx
otb::UnaryFunctorNeighborhoodVectorImageFilter::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:66
otb::UnaryFunctorNeighborhoodVectorImageFilter::FunctorType
TFunction FunctorType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:63
otb::UnaryFunctorNeighborhoodVectorImageFilter::SetFunctor
void SetFunctor(const FunctorType &functor)
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:90
otb::UnaryFunctorNeighborhoodVectorImageFilter::GetFunctor
FunctorType & GetFunctor()
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:79
otb::UnaryFunctorNeighborhoodVectorImageFilter::ProcessObjectType
itk::ProcessObject ProcessObjectType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:73
otb::UnaryFunctorNeighborhoodVectorImageFilter
Implements neighborhood-wise generic operation of one vector image.
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:42
otb::UnaryFunctorNeighborhoodVectorImageFilter::Superclass
itk::InPlaceImageFilter< TInputImage, TOutputImage > Superclass
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:47
otb::UnaryFunctorNeighborhoodVectorImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:49
otb::UnaryFunctorNeighborhoodVectorImageFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: otbUnaryFunctorNeighborhoodVectorImageFilter.h:70