OTB  9.0.0
Orfeo Toolbox
otbVectorImageToAmplitudeImageFilter.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 otbVectorImageToAmplitudeImageFilter_h
22 #define otbVectorImageToAmplitudeImageFilter_h
23 
24 #include "itkUnaryFunctorImageFilter.h"
25 #include "otbMath.h"
26 #include "itkConceptChecking.h"
27 
28 namespace otb
29 {
30 namespace Functor
31 {
32 template <class TInput, class TOutput>
34 {
35 public:
37  {
38  }
40  {
41  }
42 
43  inline TOutput operator()(const TInput& A)
44  {
45  return static_cast<TOutput>(A.GetNorm());
46  }
47 
48  itkConceptMacro(OutputShouldNotBeVectorImageCheck, (itk::Concept::Convertible<TOutput, double>));
49 
50 }; // end namespace Functor
51 }
52 
62 template <class TInputImage, class TOutputImage>
64  : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage,
65  Functor::VectorToAmplitudeFunctor<typename TInputImage::PixelType, typename TOutputImage::PixelType>>
66 {
67 public:
70  typedef itk::UnaryFunctorImageFilter<TInputImage, TOutputImage,
73  typedef itk::SmartPointer<Self> Pointer;
74  typedef itk::SmartPointer<const Self> ConstPointer;
75 
77  itkNewMacro(Self);
78 
80  itkTypeMacro(VectorImageToAmplitudeImageFilter, UnaryFunctorImageFilter);
81 
82 protected:
85 
88  {
89  }
90 
92  void PrintSelf(std::ostream& os, itk::Indent indent) const override
93  {
94  Superclass::PrintSelf(os, indent);
95  }
96 
97 private:
98  VectorImageToAmplitudeImageFilter(const Self&) = delete;
99  void operator=(const Self&) = delete;
100 };
101 
102 } // End namespace otb
103 #endif
otb::VectorImageToAmplitudeImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbVectorImageToAmplitudeImageFilter.h:73
otbMath.h
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Functor::VectorToAmplitudeFunctor::~VectorToAmplitudeFunctor
virtual ~VectorToAmplitudeFunctor()
Definition: otbVectorImageToAmplitudeImageFilter.h:39
otb::VectorImageToAmplitudeImageFilter
This filter returns the the amplitude of the pixel vector.
Definition: otbVectorImageToAmplitudeImageFilter.h:63
otb::Functor::VectorToAmplitudeFunctor::VectorToAmplitudeFunctor
VectorToAmplitudeFunctor()
Definition: otbVectorImageToAmplitudeImageFilter.h:36
otb::VectorImageToAmplitudeImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbVectorImageToAmplitudeImageFilter.h:74
otb::VectorImageToAmplitudeImageFilter::Superclass
itk::UnaryFunctorImageFilter< TInputImage, TOutputImage, Functor::VectorToAmplitudeFunctor< typename TInputImage::PixelType, typename TOutputImage::PixelType > > Superclass
Definition: otbVectorImageToAmplitudeImageFilter.h:72
otb::VectorImageToAmplitudeImageFilter::VectorImageToAmplitudeImageFilter
VectorImageToAmplitudeImageFilter()
Definition: otbVectorImageToAmplitudeImageFilter.h:84
otb::VectorImageToAmplitudeImageFilter::Self
VectorImageToAmplitudeImageFilter Self
Definition: otbVectorImageToAmplitudeImageFilter.h:69
otb::Functor::VectorToAmplitudeFunctor::operator()
TOutput operator()(const TInput &A)
Definition: otbVectorImageToAmplitudeImageFilter.h:43
otb::Functor::VectorToAmplitudeFunctor
Definition: otbVectorImageToAmplitudeImageFilter.h:33
otb::VectorImageToAmplitudeImageFilter::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Definition: otbVectorImageToAmplitudeImageFilter.h:92
otb::VectorImageToAmplitudeImageFilter::~VectorImageToAmplitudeImageFilter
~VectorImageToAmplitudeImageFilter() override
Definition: otbVectorImageToAmplitudeImageFilter.h:87