OTB  6.7.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private 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

virtual TOutput operator() (const itk::VariableLengthVector< TInput > &input) const =0
 
 RadiometricIndex (const std::set< BandNameType > &requiredBands)
 
virtual ~RadiometricIndex ()=default
 
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
 

Static Public Attributes

static constexpr double Epsilon = 0.0000001
 
static constexpr vcl_size_t NumberOfBands = static_cast<vcl_size_t>(BandNameType::MAX)
 

Protected Member Functions

vcl_size_t UncheckedBandIndex (BandNameType band) const
 
double Value (BandNameType band, const itk::VariableLengthVector< TInput > &input) const
 

Private Types

using BandIndicesContainer = std::array< vcl_size_t, NumberOfBands >
 
using RequiredBandsContainer = std::array< bool, NumberOfBands >
 

Private Member Functions

 RadiometricIndex ()=delete
 

Private Attributes

BandIndicesContainer m_BandIndices
 
RequiredBandsContainer m_RequiredBands
 

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

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.

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.

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.

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

Definition at line 63 of file otbRadiometricIndex.h.

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

Definition at line 62 of file otbRadiometricIndex.h.

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

template<typename TInput , typename TOutput >
virtual otb::Functor::RadiometricIndex< TInput, TOutput >::~RadiometricIndex ( )
virtualdefault
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.

References otb::BandName::MAX.

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

Member Function Documentation

template<typename TInput , typename TOutput >
vcl_size_t otb::Functor::RadiometricIndex< TInput, TOutput >::GetBandIndex ( BandNameType  band) const
inline
Parameters
bandThe band for which to retrieve indice
Returns
The indices of the band
Exceptions
runtime_errorif band is CommandBandName::MAX

Definition at line 151 of file otbRadiometricIndex.h.

References otb::BandName::MAX.

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.

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

Astract method which will compute the radiometric indice

Parameters
inputA itk::VariableLengthVector<TInput> holding the pixel values for each band
Returns
The indice value as TOutput (starts at 1 for first band)

Implemented in otb::Functor::LAIFromReflectancesLinear< TInput, TOutput >, and otb::Functor::LAIFromNDVILogarithmic< TInput, TOutput >.

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.

References otb::BandName::MAX.

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.

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.

References otb::BandName::MAX.

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 wether 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::LAIFromNDVILogarithmic< TInput, TOutput >::operator()(), and otb::Functor::LAIFromReflectancesLinear< TInput, TOutput >::operator()().

Member Data Documentation

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

Definition at line 72 of file otbRadiometricIndex.h.

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

Definition at line 221 of file otbRadiometricIndex.h.

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

Definition at line 217 of file otbRadiometricIndex.h.

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

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: