From 7e9826a88d9e23a6e116530495c693532c6ff521 Mon Sep 17 00:00:00 2001 From: Julien Michel <julien.michel@orfeo-toolbox.org> Date: Tue, 16 Apr 2019 12:28:06 +0000 Subject: [PATCH] STY: s/RadiometricIndice/RadiometricIndex/g --- .../AppIndices/app/otbRadiometricIndices.cxx | 10 +- .../include/otbBuiltUpIndicesFunctor.h | 6 +- .../Indices/include/otbLandsatTMIndices.h | 2 +- ...iometricIndice.h => otbRadiometricIndex.h} | 12 +-- .../Indices/include/otbSoilIndicesFunctor.h | 22 ++--- .../include/otbVegetationIndicesFunctor.h | 96 +++++++++---------- .../Indices/include/otbWaterIndicesFunctor.h | 26 ++--- .../Radiometry/Indices/test/CMakeLists.txt | 4 +- .../Indices/test/otbIndicesTestDriver.cxx | 2 +- .../test/otbRadiometricIndicesTest.cxx | 4 +- 10 files changed, 92 insertions(+), 92 deletions(-) rename Modules/Radiometry/Indices/include/{otbRadiometricIndice.h => otbRadiometricIndex.h} (96%) diff --git a/Modules/Applications/AppIndices/app/otbRadiometricIndices.cxx b/Modules/Applications/AppIndices/app/otbRadiometricIndices.cxx index 535285cab4..3d3621d67a 100644 --- a/Modules/Applications/AppIndices/app/otbRadiometricIndices.cxx +++ b/Modules/Applications/AppIndices/app/otbRadiometricIndices.cxx @@ -51,18 +51,18 @@ public: using InputType = FloatVectorImageType::InternalPixelType; using OutputType = FloatImageType::PixelType; - using RadiometricIndiceType = otb::Functor::RadiometricIndice<InputType, OutputType>; - using IndicesStackFunctorType = otb::Functor::IndicesStackFunctor<RadiometricIndiceType>; + using RadiometricIndexType = otb::Functor::RadiometricIndex<InputType, OutputType>; + using IndicesStackFunctorType = otb::Functor::IndicesStackFunctor<RadiometricIndexType>; class indiceSpec { public: - indiceSpec(std::string k, std::string i, RadiometricIndiceType * ind) + indiceSpec(std::string k, std::string i, RadiometricIndexType * ind) : key(k), item(i), indice(ind) {} std::string key; std::string item; - std::unique_ptr<RadiometricIndiceType> indice; + std::unique_ptr<RadiometricIndexType> indice; }; @@ -233,7 +233,7 @@ private: bandChecker(bandIndicesMap,CommonBandNames::NIR,"channels.nir"); bandChecker(bandIndicesMap,CommonBandNames::MIR,"channels.mir"); - std::vector<RadiometricIndiceType*> indices; + std::vector<RadiometricIndexType*> indices; // Find selected indices for(unsigned int idx = 0; idx < GetSelectedItems("list").size(); ++idx) diff --git a/Modules/Radiometry/Indices/include/otbBuiltUpIndicesFunctor.h b/Modules/Radiometry/Indices/include/otbBuiltUpIndicesFunctor.h index b2a6ae8eb7..fe0ac92916 100644 --- a/Modules/Radiometry/Indices/include/otbBuiltUpIndicesFunctor.h +++ b/Modules/Radiometry/Indices/include/otbBuiltUpIndicesFunctor.h @@ -21,7 +21,7 @@ #ifndef otbBuiltUpIndicesFunctor_h #define otbBuiltUpIndicesFunctor_h -#include "otbRadiometricIndice.h" +#include "otbRadiometricIndex.h" namespace otb { @@ -38,10 +38,10 @@ namespace Functor * \ingroup OTBIndices */ template <class TInput, class TOutput> -class ISU : public RadiometricIndice<TInput,TOutput> +class ISU : public RadiometricIndex<TInput,TOutput> { public: - ISU() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + ISU() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { diff --git a/Modules/Radiometry/Indices/include/otbLandsatTMIndices.h b/Modules/Radiometry/Indices/include/otbLandsatTMIndices.h index e375136a98..aeb68d4024 100644 --- a/Modules/Radiometry/Indices/include/otbLandsatTMIndices.h +++ b/Modules/Radiometry/Indices/include/otbLandsatTMIndices.h @@ -22,8 +22,8 @@ #define otbLandsatTMIndices_h #include "otbMath.h" +#include "otbBandName.h" #include "itkVariableLengthVector.h" -#include "otbRadiometricIndice.h" #include "otbFuzzyVariable.h" #include <vector> #include <algorithm> diff --git a/Modules/Radiometry/Indices/include/otbRadiometricIndice.h b/Modules/Radiometry/Indices/include/otbRadiometricIndex.h similarity index 96% rename from Modules/Radiometry/Indices/include/otbRadiometricIndice.h rename to Modules/Radiometry/Indices/include/otbRadiometricIndex.h index bf1ff2cbf5..8683f3ecdb 100644 --- a/Modules/Radiometry/Indices/include/otbRadiometricIndice.h +++ b/Modules/Radiometry/Indices/include/otbRadiometricIndex.h @@ -18,8 +18,8 @@ * limitations under the License. */ -#ifndef otbRadiometricIndice_h -#define otbRadiometricIndice_h +#ifndef otbRadiometricIndex_h +#define otbRadiometricIndex_h #include "itkVariableLengthVector.h" #include "otbBandName.h" @@ -36,7 +36,7 @@ namespace otb namespace Functor { /** - * \class RadiometricIndice + * \class RadiometricIndex * \brief Base class for all radiometric indices * * This class is the base class for all radiometric indices. @@ -58,7 +58,7 @@ namespace Functor * \ingroup OTBIndices */ template <typename TInput, typename TOutput, typename TBandNameEnum = CommonBandNames> -class RadiometricIndice +class RadiometricIndex { public: /// Types for input/output @@ -78,7 +78,7 @@ public: * \param requiredBands the set<TBandNameEnum> of required bands * \throw runtime_error if requiredBands contains TBandNameEnum::MAX */ - RadiometricIndice(const std::set<BandNameType>& requiredBands) + RadiometricIndex(const std::set<BandNameType>& requiredBands) : m_RequiredBands(), m_BandIndices() { @@ -206,7 +206,7 @@ protected: private: // Explicitely disable default constructor - RadiometricIndice() = delete; + RadiometricIndex() = delete; /// An array storing the required status for each band using RequiredBandsContainer = std::array<bool,NumberOfBands>; diff --git a/Modules/Radiometry/Indices/include/otbSoilIndicesFunctor.h b/Modules/Radiometry/Indices/include/otbSoilIndicesFunctor.h index 5744cac7ed..d3193ce7c2 100644 --- a/Modules/Radiometry/Indices/include/otbSoilIndicesFunctor.h +++ b/Modules/Radiometry/Indices/include/otbSoilIndicesFunctor.h @@ -22,7 +22,7 @@ #define otbSoilIndicesFunctor_h #include "otbMath.h" -#include "otbRadiometricIndice.h" +#include "otbRadiometricIndex.h" namespace otb { @@ -43,17 +43,17 @@ namespace Functor * \ingroup OTBIndices */ template <class TInput, class TOutput> -class RI : public RadiometricIndice<TInput,TOutput> +class RI : public RadiometricIndex<TInput,TOutput> { public: - RI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::GREEN}) {} + RI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::GREEN}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { auto green = this->Value(CommonBandNames::GREEN,input); auto red = this->Value(CommonBandNames::RED,input); - if (std::abs(green) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(green) < RadiometricIndex<TInput,TOutput>::Epsilon) { return static_cast<TOutput>(0.); } @@ -77,17 +77,17 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class CI : public RadiometricIndice<TInput,TOutput> +class CI : public RadiometricIndex<TInput,TOutput> { public: - CI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::GREEN}) {} + CI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::GREEN}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { auto green = this->Value(CommonBandNames::GREEN,input); auto red = this->Value(CommonBandNames::RED,input); - if (std::abs(green + red) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(green + red) < RadiometricIndex<TInput,TOutput>::Epsilon) { return static_cast<TOutput>(0.); } @@ -107,10 +107,10 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class BI : public RadiometricIndice<TInput,TOutput> +class BI : public RadiometricIndex<TInput,TOutput> { public: - BI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::GREEN}) {} + BI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::GREEN}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -132,11 +132,11 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class BI2 : public RadiometricIndice<TInput,TOutput> +class BI2 : public RadiometricIndex<TInput,TOutput> { public: - BI2() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::GREEN, CommonBandNames::NIR}) {} + BI2() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::GREEN, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { diff --git a/Modules/Radiometry/Indices/include/otbVegetationIndicesFunctor.h b/Modules/Radiometry/Indices/include/otbVegetationIndicesFunctor.h index 860cf367a7..f474469e3d 100644 --- a/Modules/Radiometry/Indices/include/otbVegetationIndicesFunctor.h +++ b/Modules/Radiometry/Indices/include/otbVegetationIndicesFunctor.h @@ -22,7 +22,7 @@ #define otbVegetationIndicesFunctor_h #include "otbMath.h" -#include "otbRadiometricIndice.h" +#include "otbRadiometricIndex.h" namespace otb { @@ -40,10 +40,10 @@ namespace Functor * \ingroup OTBIndices */ template <class TInput, class TOutput> -class NDVI : public RadiometricIndice<TInput,TOutput> +class NDVI : public RadiometricIndex<TInput,TOutput> { public: - NDVI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + NDVI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -56,7 +56,7 @@ public: // This static compute will be used in indices derived from NDVI static double Compute(const double & red, const double & nir) { - if (std::abs(nir + red) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(nir + red) < RadiometricIndex<TInput,TOutput>::Epsilon) { return 0.; } @@ -77,17 +77,17 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class RVI : public RadiometricIndice<TInput,TOutput> +class RVI : public RadiometricIndex<TInput,TOutput> { public: - RVI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + RVI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { auto red = this->Value(CommonBandNames::RED,input); auto nir = this->Value(CommonBandNames::NIR,input); - if (std::abs(red) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(red) < RadiometricIndex<TInput,TOutput>::Epsilon) { return static_cast<TOutput>(0.); } @@ -110,10 +110,10 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class PVI : public RadiometricIndice<TInput,TOutput> +class PVI : public RadiometricIndex<TInput,TOutput> { public: - PVI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + PVI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -141,17 +141,17 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class SAVI : public RadiometricIndice<TInput,TOutput> +class SAVI : public RadiometricIndex<TInput,TOutput> { public: - SAVI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + SAVI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { auto red = this->Value(CommonBandNames::RED,input); auto nir = this->Value(CommonBandNames::NIR,input); - if (std::abs(nir + red + L) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(nir + red + L) < RadiometricIndex<TInput,TOutput>::Epsilon) { return static_cast<TOutput>(0.); } @@ -174,10 +174,10 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class TSAVI : public RadiometricIndice<TInput,TOutput> +class TSAVI : public RadiometricIndex<TInput,TOutput> { public: - TSAVI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + TSAVI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -186,7 +186,7 @@ public: double denominator = A * nir + red + X * (1. + A * A); - if (std::abs(denominator) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(denominator) < RadiometricIndex<TInput,TOutput>::Epsilon) { return static_cast<TOutput>(0.); } @@ -211,11 +211,11 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class WDVI : public RadiometricIndice<TInput,TOutput> +class WDVI : public RadiometricIndex<TInput,TOutput> { public: /// Constructor - WDVI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + WDVI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -246,10 +246,10 @@ public: */ template <class TInput, class TOutput> -class MSAVI : public RadiometricIndice<TInput,TOutput> +class MSAVI : public RadiometricIndex<TInput,TOutput> { public: - MSAVI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + MSAVI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -263,7 +263,7 @@ public: double denominator = nir + red + L; - if (std::abs(denominator) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(denominator) < RadiometricIndex<TInput,TOutput>::Epsilon) { return static_cast<TOutput>(0.); } @@ -287,11 +287,11 @@ private: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class MSAVI2 : public RadiometricIndice<TInput,TOutput> +class MSAVI2 : public RadiometricIndex<TInput,TOutput> { public: - MSAVI2() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + MSAVI2() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -319,10 +319,10 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class GEMI : public RadiometricIndice<TInput,TOutput> +class GEMI : public RadiometricIndex<TInput,TOutput> { public: - GEMI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + GEMI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -333,7 +333,7 @@ public: double num_nu; double denom_nu = nir + red + 0.5; - if (std::abs(denom_nu) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(denom_nu) < RadiometricIndex<TInput,TOutput>::Epsilon) { nu = 0; } @@ -344,7 +344,7 @@ public: } double denom_GEMI = 1 - red; - if (std::abs(denom_GEMI) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(denom_GEMI) < RadiometricIndex<TInput,TOutput>::Epsilon) { return static_cast<TOutput>(0.); } @@ -366,10 +366,10 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class AVI: public RadiometricIndice<TInput,TOutput> +class AVI: public RadiometricIndex<TInput,TOutput> { public: - AVI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::GREEN, CommonBandNames::RED, CommonBandNames::NIR}) {} + AVI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::GREEN, CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -381,7 +381,7 @@ public: constexpr double dfact2 = (LambdaR - LambdaG) / LambdaR; double dterm1; double dterm2; - if (std::abs(nir - red) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(nir - red) < RadiometricIndex<TInput,TOutput>::Epsilon) { dterm1 = 0; } @@ -390,7 +390,7 @@ public: dterm1 = std::atan(dfact1 / (nir - red)); } - if (std::abs(green - red) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(green - red) < RadiometricIndex<TInput,TOutput>::Epsilon) { dterm2 = 0; } @@ -426,11 +426,11 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class ARVI : public RadiometricIndice<TInput,TOutput> +class ARVI : public RadiometricIndex<TInput,TOutput> { public: - ARVI(): RadiometricIndice<TInput,TOutput>({CommonBandNames::BLUE, CommonBandNames::RED, CommonBandNames::NIR}) {} + ARVI(): RadiometricIndex<TInput,TOutput>({CommonBandNames::BLUE, CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -440,7 +440,7 @@ public: double RHOrb = red - Gamma * (blue - red); double denominator = nir + RHOrb; - if (std::abs(denominator) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(denominator) < RadiometricIndex<TInput,TOutput>::Epsilon) { return static_cast<TOutput>(0.); } @@ -464,11 +464,11 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class EVI : public RadiometricIndice<TInput,TOutput> +class EVI : public RadiometricIndex<TInput,TOutput> { public: - EVI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::BLUE, CommonBandNames::RED, CommonBandNames::NIR}) {} + EVI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::BLUE, CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -477,7 +477,7 @@ public: auto nir = this->Value(CommonBandNames::NIR,input); double denominator = nir + C1 * red - C2 * blue + L; - if (std::abs(denominator) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(denominator) < RadiometricIndex<TInput,TOutput>::Epsilon) { return (static_cast<TOutput>(0.)); } @@ -508,17 +508,17 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class IPVI : public RadiometricIndice<TInput,TOutput> +class IPVI : public RadiometricIndex<TInput,TOutput> { public: - IPVI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + IPVI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { auto red = this->Value(CommonBandNames::RED,input); auto nir = this->Value(CommonBandNames::NIR,input); - if (std::abs(nir + red) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(nir + red) < RadiometricIndex<TInput,TOutput>::Epsilon) { return static_cast<TOutput>(0.); } @@ -540,10 +540,10 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class TNDVI : public RadiometricIndice<TInput,TOutput> +class TNDVI : public RadiometricIndex<TInput,TOutput> { public: - TNDVI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + TNDVI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { @@ -580,10 +580,10 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class LAIFromNDVILogarithmic : public RadiometricIndice<TInput,TOutput> +class LAIFromNDVILogarithmic : public RadiometricIndex<TInput,TOutput> { public: - LAIFromNDVILogarithmic() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}), + LAIFromNDVILogarithmic() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}), m_NdviSoil(0.1), m_NdviInf(0.89), m_ExtinctionCoefficient(0.71) {} @@ -660,12 +660,12 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class LAIFromReflectancesLinear : public RadiometricIndice<TInput,TOutput> +class LAIFromReflectancesLinear : public RadiometricIndex<TInput,TOutput> { public: - LAIFromReflectancesLinear() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}), + LAIFromReflectancesLinear() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}), m_RedCoef(-17.91), m_NirCoef(12.26) {} @@ -722,18 +722,18 @@ public: template <class TInput, class TOutput> - class LAIFromNDVIFormosat2Functor : public RadiometricIndice<TInput,TOutput> + class LAIFromNDVIFormosat2Functor : public RadiometricIndex<TInput,TOutput> { public: - LAIFromNDVIFormosat2Functor(): RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} + LAIFromNDVIFormosat2Functor(): RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::NIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { auto red = this->Value(CommonBandNames::RED,input); auto nir = this->Value(CommonBandNames::NIR,input); - if (std::abs(nir + red) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(nir + red) < RadiometricIndex<TInput,TOutput>::Epsilon) { return static_cast<TOutput>(0.); } diff --git a/Modules/Radiometry/Indices/include/otbWaterIndicesFunctor.h b/Modules/Radiometry/Indices/include/otbWaterIndicesFunctor.h index e16dca15fa..e222efba2a 100644 --- a/Modules/Radiometry/Indices/include/otbWaterIndicesFunctor.h +++ b/Modules/Radiometry/Indices/include/otbWaterIndicesFunctor.h @@ -22,7 +22,7 @@ #define otbWaterIndicesFunctor_h #include "otbMath.h" -#include "otbRadiometricIndice.h" +#include "otbRadiometricIndex.h" namespace otb { @@ -43,18 +43,18 @@ namespace Functor * \ingroup OTBIndices */ template <class TInput, class TOutput> -class NDWI : public RadiometricIndice<TInput,TOutput> +class NDWI : public RadiometricIndex<TInput,TOutput> { public: - NDWI(): RadiometricIndice<TInput,TOutput>({CommonBandNames::NIR, CommonBandNames::MIR}) {} + NDWI(): RadiometricIndex<TInput,TOutput>({CommonBandNames::NIR, CommonBandNames::MIR}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { auto mir = this->Value(CommonBandNames::MIR,input); auto nir = this->Value(CommonBandNames::NIR,input); - if (std::abs(nir + mir) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(nir + mir) < RadiometricIndex<TInput,TOutput>::Epsilon) { return 0.; } @@ -74,18 +74,18 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class NDWI2 : public RadiometricIndice<TInput,TOutput> +class NDWI2 : public RadiometricIndex<TInput,TOutput> { public: - NDWI2() : RadiometricIndice<TInput,TOutput>({CommonBandNames::NIR, CommonBandNames::GREEN}) {} + NDWI2() : RadiometricIndex<TInput,TOutput>({CommonBandNames::NIR, CommonBandNames::GREEN}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { auto green = this->Value(CommonBandNames::GREEN,input); auto nir = this->Value(CommonBandNames::NIR,input); - if (std::abs(nir + green) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(nir + green) < RadiometricIndex<TInput,TOutput>::Epsilon) { return 0.; } @@ -109,17 +109,17 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class MNDWI : public RadiometricIndice<TInput,TOutput> +class MNDWI : public RadiometricIndex<TInput,TOutput> { public: - MNDWI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::MIR, CommonBandNames::GREEN}) {} + MNDWI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::MIR, CommonBandNames::GREEN}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { auto green = this->Value(CommonBandNames::GREEN,input); auto mir = this->Value(CommonBandNames::MIR,input); - if (std::abs(mir + green) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(mir + green) < RadiometricIndex<TInput,TOutput>::Epsilon) { return 0.; } @@ -139,18 +139,18 @@ public: * \ingroup OTBIndices */ template <class TInput, class TOutput> -class NDTI : public RadiometricIndice<TInput,TOutput> +class NDTI : public RadiometricIndex<TInput,TOutput> { public: - NDTI() : RadiometricIndice<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::GREEN}) {} + NDTI() : RadiometricIndex<TInput,TOutput>({CommonBandNames::RED, CommonBandNames::GREEN}) {} TOutput operator()(const itk::VariableLengthVector<TInput> & input) const override { auto green = this->Value(CommonBandNames::GREEN,input); auto red = this->Value(CommonBandNames::RED,input); - if (std::abs(red + green) < RadiometricIndice<TInput,TOutput>::Epsilon) + if (std::abs(red + green) < RadiometricIndex<TInput,TOutput>::Epsilon) { return 0.; } diff --git a/Modules/Radiometry/Indices/test/CMakeLists.txt b/Modules/Radiometry/Indices/test/CMakeLists.txt index bc33d1c2ac..79e4a82821 100644 --- a/Modules/Radiometry/Indices/test/CMakeLists.txt +++ b/Modules/Radiometry/Indices/test/CMakeLists.txt @@ -322,8 +322,8 @@ otb_add_test(NAME raTvLandsatTMThickCloudTest COMMAND otbIndicesTestDriver ) -otb_add_test(NAME raTvRadiometricIndicesBaseClassTest COMMAND otbIndicesTestDriver - otbRadiometricIndiceTest) +otb_add_test(NAME raTvRadiometricIndexBaseClassTest COMMAND otbIndicesTestDriver + otbRadiometricIndexTest) otb_add_test(NAME raTvVegetationIndicesTest COMMAND otbIndicesTestDriver otbVegetationIndicesTest) diff --git a/Modules/Radiometry/Indices/test/otbIndicesTestDriver.cxx b/Modules/Radiometry/Indices/test/otbIndicesTestDriver.cxx index 7a92310957..884ebeabb1 100644 --- a/Modules/Radiometry/Indices/test/otbIndicesTestDriver.cxx +++ b/Modules/Radiometry/Indices/test/otbIndicesTestDriver.cxx @@ -48,6 +48,6 @@ void RegisterTests() REGISTER_TEST(otbWaterIndicesTest); REGISTER_TEST(otbBuiltUpIndicesTest); REGISTER_TEST(otbSoilIndicesTest); - REGISTER_TEST(otbRadiometricIndiceTest); + REGISTER_TEST(otbRadiometricIndexTest); REGISTER_TEST(otbIndicesStackFunctorTest); } diff --git a/Modules/Radiometry/Indices/test/otbRadiometricIndicesTest.cxx b/Modules/Radiometry/Indices/test/otbRadiometricIndicesTest.cxx index 853d372970..e747130608 100644 --- a/Modules/Radiometry/Indices/test/otbRadiometricIndicesTest.cxx +++ b/Modules/Radiometry/Indices/test/otbRadiometricIndicesTest.cxx @@ -165,7 +165,7 @@ int otbBuiltUpIndicesTest(int, char**) } -int otbRadiometricIndiceTest(int,char**) +int otbRadiometricIndexTest(int,char**) { auto ndvi = NDVI<double,double>(); @@ -219,7 +219,7 @@ int otbRadiometricIndiceTest(int,char**) int otbIndicesStackFunctorTest(int, char**) { - using IndicesType = RadiometricIndice<double,int,CommonBandNames>; + using IndicesType = RadiometricIndex<double,int,CommonBandNames>; using StackFunctorType = IndicesStackFunctor<IndicesType>; auto ndvi = NDVI<double,int>(); -- GitLab