OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Attributes | List of all members
otb::Functor::RadiometricIndex< TInput, TOutput > Class Template Referenceabstract

#include <otbRadiometricIndex.h>

+ Inheritance diagram for otb::Functor::RadiometricIndex< TInput, TOutput >:
+ Collaboration diagram for otb::Functor::RadiometricIndex< TInput, TOutput >:

Public Types

using BandNameType = CommonBandNames
 
using InputType = TInput
 
using OutputType = TOutput
 
using PixelType = itk::VariableLengthVector< InputType >
 

Public Member Functions

 RadiometricIndex (const std::set< BandNameType > &requiredBands)
 
virtual ~RadiometricIndex ()=default
 

Static Public Attributes

static constexpr double Epsilon = 0.0000001
 
static constexpr vcl_size_t NumberOfBands = static_cast<vcl_size_t>(BandNameType::MAX)
 
using RequiredBandsContainer = std::array< bool, NumberOfBands >
 
using BandIndicesContainer = std::array< vcl_size_t, NumberOfBands >
 
RequiredBandsContainer m_RequiredBands
 
BandIndicesContainer m_BandIndices
 
std::set< BandNameTypeGetRequiredBands () const
 
void SetBandIndex (BandNameType band, vcl_size_t index)
 
void SetBandsIndices (const std::map< BandNameType, vcl_size_t > &indicesMap)
 
vcl_size_t GetBandIndex (BandNameType band) const
 
virtual TOutput operator() (const itk::VariableLengthVector< TInput > &input) const =0
 
vcl_size_t UncheckedBandIndex (BandNameType band) const
 
double Value (BandNameType band, const itk::VariableLengthVector< TInput > &input) const
 
 RadiometricIndex ()=delete
 

Detailed Description

template<typename TInput, typename TOutput>
class otb::Functor::RadiometricIndex< TInput, TOutput >

Base class for all radiometric indices.

This class is the base class for all radiometric indices.

It offers services to:

This class is designed for performance on the critical path. For best performances use the Value() method when implementing operator() to avoid branches.

Definition at line 57 of file otbRadiometricIndex.h.

Member Typedef Documentation

◆ BandIndicesContainer

template<typename TInput , typename TOutput >
using otb::Functor::RadiometricIndex< TInput, TOutput >::BandIndicesContainer = std::array<vcl_size_t, NumberOfBands>
private

An array storing the indice for each band.

Definition at line 220 of file otbRadiometricIndex.h.

◆ BandNameType

template<typename TInput , typename TOutput >
using otb::Functor::RadiometricIndex< TInput, TOutput >::BandNameType = CommonBandNames

Enum Among which bands are used.

Definition at line 67 of file otbRadiometricIndex.h.

◆ InputType

template<typename TInput , typename TOutput >
using otb::Functor::RadiometricIndex< TInput, TOutput >::InputType = TInput

Types for input/output.

Definition at line 61 of file otbRadiometricIndex.h.

◆ OutputType

template<typename TInput , typename TOutput >
using otb::Functor::RadiometricIndex< TInput, TOutput >::OutputType = TOutput

Definition at line 63 of file otbRadiometricIndex.h.

◆ PixelType

template<typename TInput , typename TOutput >
using otb::Functor::RadiometricIndex< TInput, TOutput >::PixelType = itk::VariableLengthVector<InputType>

Definition at line 62 of file otbRadiometricIndex.h.

◆ RequiredBandsContainer

template<typename TInput , typename TOutput >
using otb::Functor::RadiometricIndex< TInput, TOutput >::RequiredBandsContainer = std::array<bool, NumberOfBands>
private

An array storing the required status for each band.

Definition at line 216 of file otbRadiometricIndex.h.

Constructor & Destructor Documentation

◆ ~RadiometricIndex()

template<typename TInput , typename TOutput >
virtual otb::Functor::RadiometricIndex< TInput, TOutput >::~RadiometricIndex ( )
virtualdefault

◆ RadiometricIndex() [1/2]

template<typename TInput , typename TOutput >
otb::Functor::RadiometricIndex< TInput, TOutput >::RadiometricIndex ( const std::set< BandNameType > &  requiredBands)
inline
Parameters
requiredBandsthe set<CommonBandNames> of required bands
Exceptions
runtime_errorif requiredBands contains CommonBandNames::MAX

Definition at line 81 of file otbRadiometricIndex.h.

◆ RadiometricIndex() [2/2]

template<typename TInput , typename TOutput >
otb::Functor::RadiometricIndex< TInput, TOutput >::RadiometricIndex ( )
privatedelete

An array storing the required status for each band.

Member Function Documentation

◆ GetBandIndex()

template<typename TInput , typename TOutput >
vcl_size_t otb::Functor::RadiometricIndex< TInput, TOutput >::GetBandIndex ( BandNameType  band) const
inline

◆ GetRequiredBands()

template<typename TInput , typename TOutput >
std::set<BandNameType> otb::Functor::RadiometricIndex< TInput, TOutput >::GetRequiredBands ( ) const
inline
Returns
a set<CommandBandName> containing the required bands for this indice.

Definition at line 102 of file otbRadiometricIndex.h.

◆ operator()()

template<typename TInput , typename TOutput >
virtual TOutput otb::Functor::RadiometricIndex< TInput, TOutput >::operator() ( const itk::VariableLengthVector< TInput > &  input) const
pure virtual

◆ SetBandIndex()

template<typename TInput , typename TOutput >
void otb::Functor::RadiometricIndex< TInput, TOutput >::SetBandIndex ( BandNameType  band,
vcl_size_t  index 
)
inline
Parameters
bandThe band to set (value in CommandBandName)
indexThe index of the band to set (starts at 1 for first band)
Exceptions
runtime_errorif band is CommandBandName::MAX

Definition at line 122 of file otbRadiometricIndex.h.

Referenced by otb::Functor::WaterSqrtSpectralAngleFunctor< TInput, TOutput >::SetBlueChannel(), otb::Functor::WaterSqrtSpectralAngleFunctor< TInput, TOutput >::SetGreenChannel(), otb::Functor::WaterSqrtSpectralAngleFunctor< TInput, TOutput >::SetNIRChannel(), and otb::Functor::WaterSqrtSpectralAngleFunctor< TInput, TOutput >::SetRedChannel().

◆ SetBandsIndices()

template<typename TInput , typename TOutput >
void otb::Functor::RadiometricIndex< TInput, TOutput >::SetBandsIndices ( const std::map< BandNameType, vcl_size_t > &  indicesMap)
inline
Parameters
indicesMapa std::map<CommandBandName,size_t> containing all bands indices to set (starts at 1 for first band)
Exceptions
runtime_errorif indicesMap contains CommandBandName::MAX

Definition at line 137 of file otbRadiometricIndex.h.

◆ UncheckedBandIndex()

template<typename TInput , typename TOutput >
vcl_size_t otb::Functor::RadiometricIndex< TInput, TOutput >::UncheckedBandIndex ( BandNameType  band) const
inlineprotected

Helper method to retrieve index for band name. With respect to the public method, this method will not throw an exception if CommandBandName::MAX is used as a parameter. Since it is meant for internal use in the critical path and not for client code, it will only assert that band is not CommandBandName::MAX in debug mode.

Parameters
bandThe band for which to retrieve indice
Returns
The indices of the band

Definition at line 181 of file otbRadiometricIndex.h.

◆ Value()

template<typename TInput , typename TOutput >
double otb::Functor::RadiometricIndex< TInput, TOutput >::Value ( BandNameType  band,
const itk::VariableLengthVector< TInput > &  input 
) const
inlineprotected

Helper method to parse input itk::VariableLengthVector<TInput> and get the corresponding band value. For instance:

As this function is on the critical performance path, no checks are made to see whether this band is really required for this indice. However an assertion will be raised in debug mode.

Parameters
bandThe band for which to retrieve the value
inputA itk::VariableLengthVector<TInput> holding the pixel values for each band
Returns
The value of the band as double

Definition at line 204 of file otbRadiometricIndex.h.

Referenced by otb::Functor::ISU< TInput, TOutput >::operator()(), otb::Functor::NDVI< typename TReduceSpectralResponse::ValuePrecisionType, typename TReduceSpectralResponse::ValuePrecisionType >::operator()(), otb::Functor::RI< TInput, TOutput >::operator()(), otb::Functor::NDWI< TInput, TOutput >::operator()(), otb::Functor::WaterSqrtSpectralAngleFunctor< TInput, TOutput >::operator()(), otb::Functor::NDWI2< TInput, TOutput >::operator()(), otb::Functor::RVI< TInput, TOutput >::operator()(), otb::Functor::CI< TInput, TOutput >::operator()(), otb::Functor::BI< TInput, TOutput >::operator()(), otb::Functor::MNDWI< TInput, TOutput >::operator()(), otb::Functor::PVI< TInput, TOutput >::operator()(), otb::Functor::BI2< TInput, TOutput >::operator()(), otb::Functor::NDTI< TInput, TOutput >::operator()(), otb::Functor::SAVI< TInput, TOutput >::operator()(), otb::Functor::TSAVI< TInput, TOutput >::operator()(), otb::Functor::WDVI< TInput, TOutput >::operator()(), otb::Functor::MSAVI< TInput, TOutput >::operator()(), otb::Functor::MSAVI2< TInput, TOutput >::operator()(), otb::Functor::GEMI< TInput, TOutput >::operator()(), otb::Functor::AVI< TInput, TOutput >::operator()(), otb::Functor::ARVI< TInput, TOutput >::operator()(), otb::Functor::EVI< TInput, TOutput >::operator()(), otb::Functor::IPVI< TInput, TOutput >::operator()(), otb::Functor::TNDVI< TInput, TOutput >::operator()(), otb::Functor::LAIFromNDVILogarithmic< TInput, TOutput >::operator()(), otb::Functor::LAIFromReflectancesLinear< TInput, TOutput >::operator()(), otb::Functor::LAIFromNDVIFormosat2Functor< TInput, TOutput >::operator()(), and otb::Functor::WaterSqrtSpectralAngleFunctor< TInput, TOutput >::SetReferenceWaterPixel().

Member Data Documentation

◆ Epsilon

template<typename TInput , typename TOutput >
constexpr double otb::Functor::RadiometricIndex< TInput, TOutput >::Epsilon = 0.0000001
staticconstexpr

Definition at line 72 of file otbRadiometricIndex.h.

◆ m_BandIndices

template<typename TInput , typename TOutput >
BandIndicesContainer otb::Functor::RadiometricIndex< TInput, TOutput >::m_BandIndices
private

An array storing the required status for each band.

Definition at line 221 of file otbRadiometricIndex.h.

◆ m_RequiredBands

template<typename TInput , typename TOutput >
RequiredBandsContainer otb::Functor::RadiometricIndex< TInput, TOutput >::m_RequiredBands
private

An array storing the required status for each band.

Definition at line 217 of file otbRadiometricIndex.h.

◆ NumberOfBands

template<typename TInput , typename TOutput >
constexpr vcl_size_t otb::Functor::RadiometricIndex< TInput, TOutput >::NumberOfBands = static_cast<vcl_size_t>(BandNameType::MAX)
staticconstexpr

The number of bands, derived from the Enum MAX value.

Definition at line 70 of file otbRadiometricIndex.h.


The documentation for this class was generated from the following file: