OTB  6.7.0
Orfeo Toolbox
otbVectorImageToAmplitudeImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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 
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:
38 
39  inline TOutput operator ()(const TInput& A)
40  {
41  return static_cast<TOutput>(A.GetNorm());
42  }
43 
44  itkConceptMacro(OutputShouldNotBeVectorImageCheck,
46 
47 }; // end namespace Functor
48 }
49 
59 template <class TInputImage, class TOutputImage>
61  : public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage,
62  Functor::VectorToAmplitudeFunctor<
63  typename TInputImage::PixelType, typename TOutputImage::PixelType> >
64 {
65 public:
69  TInputImage,
70  TOutputImage,
72  typename TInputImage::PixelType,
73  typename TOutputImage::PixelType> > Superclass;
76 
78  itkNewMacro(Self);
79 
81  itkTypeMacro(VectorImageToAmplitudeImageFilter, UnaryFunctorImageFilter);
82 
83 protected:
86 
89 
91  void PrintSelf(std::ostream& os, itk::Indent indent) const override
92  {
93  Superclass::PrintSelf(os, indent);
94  }
95 
96 private:
97  VectorImageToAmplitudeImageFilter(const Self &) = delete;
98  void operator =(const Self&) = delete;
99 };
100 
101 } // End namespace otb
102 #endif
itk::UnaryFunctorImageFilter< TInputImage, TOutputImage, Functor::VectorToAmplitudeFunctor< typename TInputImage::PixelType, typename TOutputImage::PixelType > > Superclass
void PrintSelf(std::ostream &os, itk::Indent indent) const override
This filter returns the the amplitude of the pixel vector.
#define itkConceptMacro(name, concept)