OTB  9.0.0
Orfeo Toolbox
otbRadiometricMomentsImageFunction.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 otbRadiometricMomentsImageFunction_h
22 #define otbRadiometricMomentsImageFunction_h
23 
24 #include "itkImageFunction.h"
26 #include "itkConstNeighborhoodIterator.h"
27 #include "itkFixedArray.h"
28 
29 namespace otb
30 {
31 
47 template <class TInputImage, class TCoordRep = double>
49  : public itk::ImageFunction<TInputImage, itk::FixedArray<typename itk::NumericTraits<typename TInputImage::PixelType>::RealType, 4>, TCoordRep>
50 {
51 public:
54  typedef itk::ImageFunction<TInputImage, itk::FixedArray<typename itk::NumericTraits<typename TInputImage::PixelType>::RealType, 4>, TCoordRep> Superclass;
55  typedef itk::SmartPointer<Self> Pointer;
56  typedef itk::SmartPointer<const Self> ConstPointer;
57 
59  itkTypeMacro(RadiometricMomentsImageFunction, ImageFunction);
60 
62  itkNewMacro(Self);
63 
65  typedef TInputImage InputImageType;
66  typedef typename Superclass::IndexType IndexType;
67  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
68  typedef typename Superclass::PointType PointType;
69 
70  typedef typename Superclass::OutputType OutputType;
71  typedef typename OutputType::ValueType ScalarRealType;
72 
73  typedef TCoordRep CoordRepType;
74 
76 
78  itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);
79 
81  OutputType EvaluateAtIndex(const IndexType& index) const override;
82 
84  OutputType Evaluate(const PointType& point) const override
85  {
86  IndexType index;
87  this->ConvertPointToNearestIndex(point, index);
88  return this->EvaluateAtIndex(index);
89  }
91  {
92  IndexType index;
93  this->ConvertContinuousIndexToNearestIndex(cindex, index);
94  return this->EvaluateAtIndex(index);
95  }
97 
101  itkSetMacro(NeighborhoodRadius, unsigned int);
102  itkGetConstReferenceMacro(NeighborhoodRadius, unsigned int);
104 
105 protected:
108  {
109  }
110  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
111 
112 private:
113  RadiometricMomentsImageFunction(const Self&) = delete;
114  void operator=(const Self&) = delete;
115 
116  unsigned int m_NeighborhoodRadius;
118 };
119 
120 } // namespace otb
121 
122 #ifndef OTB_MANUAL_INSTANTIATION
124 #endif
125 
126 #endif
otb::RadiometricMomentsImageFunction::m_NeighborhoodRadius
unsigned int m_NeighborhoodRadius
Definition: otbRadiometricMomentsImageFunction.h:116
otb::RadiometricMomentsImageFunction::Superclass
itk::ImageFunction< TInputImage, itk::FixedArray< typename itk::NumericTraits< typename TInputImage::PixelType >::RealType, 4 >, TCoordRep > Superclass
Definition: otbRadiometricMomentsImageFunction.h:54
otb::RadiometricMomentsImageFunction::OutputType
Superclass::OutputType OutputType
Definition: otbRadiometricMomentsImageFunction.h:70
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::RadiometricMomentsImageFunction::EvaluateAtContinuousIndex
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const override
Definition: otbRadiometricMomentsImageFunction.h:90
otb::RadiometricMomentsImageFunction::FunctorType
Functor::RadiometricMomentsFunctor< itk::ConstNeighborhoodIterator< InputImageType >, ScalarRealType > FunctorType
Definition: otbRadiometricMomentsImageFunction.h:75
otb::RadiometricMomentsImageFunction::m_Functor
FunctorType m_Functor
Definition: otbRadiometricMomentsImageFunction.h:117
otb::RadiometricMomentsImageFunction::~RadiometricMomentsImageFunction
~RadiometricMomentsImageFunction() override
Definition: otbRadiometricMomentsImageFunction.h:107
otb::RadiometricMomentsImageFunction::Evaluate
OutputType Evaluate(const PointType &point) const override
Definition: otbRadiometricMomentsImageFunction.h:84
otb::RadiometricMomentsImageFunction::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbRadiometricMomentsImageFunction.h:56
otb::RadiometricMomentsImageFunction::CoordRepType
TCoordRep CoordRepType
Definition: otbRadiometricMomentsImageFunction.h:73
otb::RadiometricMomentsImageFunction::IndexType
Superclass::IndexType IndexType
Definition: otbRadiometricMomentsImageFunction.h:66
otb::RadiometricMomentsImageFunction::PointType
Superclass::PointType PointType
Definition: otbRadiometricMomentsImageFunction.h:68
otb::RadiometricMomentsImageFunction::ScalarRealType
OutputType::ValueType ScalarRealType
Definition: otbRadiometricMomentsImageFunction.h:71
otbRadiometricMomentsFunctor.h
otb::RadiometricMomentsImageFunction::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbRadiometricMomentsImageFunction.h:55
otb::RadiometricMomentsImageFunction
Calculate the radiometric moments.
Definition: otbRadiometricMomentsImageFunction.h:48
otb::RadiometricMomentsImageFunction::ContinuousIndexType
Superclass::ContinuousIndexType ContinuousIndexType
Definition: otbRadiometricMomentsImageFunction.h:67
otbRadiometricMomentsImageFunction.hxx
otb::RadiometricMomentsImageFunction::InputImageType
TInputImage InputImageType
Definition: otbRadiometricMomentsImageFunction.h:62
otb::RadiometricMomentsImageFunction::Self
RadiometricMomentsImageFunction Self
Definition: otbRadiometricMomentsImageFunction.h:53
otb::Functor::RadiometricMomentsFunctor
Definition: otbRadiometricMomentsFunctor.h:39