OTB  7.1.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
otb::BandMathImageFilter< TImage > Class Template Reference

#include <otbBandMathImageFilter.h>

+ Inheritance diagram for otb::BandMathImageFilter< TImage >:
+ Collaboration diagram for otb::BandMathImageFilter< TImage >:

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
 
typedef ImageType::ConstPointer ImagePointer
 
typedef ImageType::RegionType ImageRegionType
 
typedef TImage ImageType
 
typedef ImageType::IndexType IndexType
 
typedef ImageType::PointType OrigineType
 
typedef Parser ParserType
 
typedef ImageType::PixelType PixelType
 
typedef itk::SmartPointer< SelfPointer
 
typedef BandMathImageFilter< TImage > Self
 
typedef ImageType::SpacingType SpacingType
 
typedef itk::InPlaceImageFilter< TImage > Superclass
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
void SetNthInput (DataObjectPointerArraySizeType idx, const ImageType *image)
 
void SetNthInput (DataObjectPointerArraySizeType idx, const ImageType *image, const std::string &varName)
 

Static Public Member Functions

static Pointer New ()
 

Private Member Functions

 BandMathImageFilter (const Self &)=delete
 
void operator= (const Self &)=delete
 

Private Attributes

std::vector< std::vector< double > > m_AImage
 
std::string m_Expression
 
unsigned int m_NbVar
 
OrigineType m_Origin
 
long m_OverflowCount
 
SpacingType m_Spacing
 
itk::Array< long > m_ThreadOverflow
 
itk::Array< long > m_ThreadUnderflow
 
long m_UnderflowCount
 
std::vector< ParserType::Pointerm_VParser
 
std::vector< std::string > m_VVarName
 
void SetNthInputName (DataObjectPointerArraySizeType idx, const std::string &expression)
 
void SetExpression (const std::string &expression)
 
std::string GetExpression () const
 
std::string GetNthInputName (DataObjectPointerArraySizeType idx) const
 
ImageTypeGetNthInput (DataObjectPointerArraySizeType idx)
 
 BandMathImageFilter ()
 
 ~BandMathImageFilter () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
void BeforeThreadedGenerateData () override
 
void ThreadedGenerateData (const ImageRegionType &outputRegionForThread, itk::ThreadIdType threadId) override
 
void AfterThreadedGenerateData () override
 

Detailed Description

template<class TImage>
class otb::BandMathImageFilter< TImage >

Performs a mathematical operation on the input images according to the formula specified by the user.

This filter is based on the mathematical parser library muParser. The built in functions and operators list is available at: http://muparser.sourceforge.net/mup_features.html#idDef2

OTB additional functions: ndvi(r, niri)

OTB additional constants: e - log2e - log10e - ln2 - ln10 - pi - euler

In order to use this filter, at least one input image is to be set. An associated variable name can be specified or not by using the corresponding SetNthInput method. For the nth input image, if no associated variable name has been spefified, a default variable name is given by concatenating the letter "b" (for band) and the corresponding input index. Next step is to set the expression according to the variable names. For example, in the default case with three input images the following expression is valid : "ndvi(b1, b2)*b3"

As an additional functionality, the filter also granted access to indexes information under special virtual bands named idxX, idxY for the images indexes and idxPhyX, idxPhyY for the physical indexes. It allows the user to perform, for example a spatial processing aiming to suppress a determined area : "if(sqrt((idxPhyX-105.3)*(idxPhyX-105.3)+ (idxPhyY-207.1)*(idxPhyY-207.1))>100, b1, 0)" This expression replace the physical zone around the point of physical index (105.3; 207.1) by a black area This functionality assumes that all the band involved have the same spacing and origin.

See also
Parser

Definition at line 83 of file otbBandMathImageFilter.h.

Member Typedef Documentation

◆ ConstPointer

template<class TImage >
typedef itk::SmartPointer<const Self> otb::BandMathImageFilter< TImage >::ConstPointer

Definition at line 90 of file otbBandMathImageFilter.h.

◆ DataObjectPointerArraySizeType

template<class TImage >
typedef itk::ProcessObject::DataObjectPointerArraySizeType otb::BandMathImageFilter< TImage >::DataObjectPointerArraySizeType

Definition at line 107 of file otbBandMathImageFilter.h.

◆ ImagePointer

template<class TImage >
typedef ImageType::ConstPointer otb::BandMathImageFilter< TImage >::ImagePointer

Definition at line 100 of file otbBandMathImageFilter.h.

◆ ImageRegionType

template<class TImage >
typedef ImageType::RegionType otb::BandMathImageFilter< TImage >::ImageRegionType

Definition at line 101 of file otbBandMathImageFilter.h.

◆ ImageType

template<class TImage >
typedef TImage otb::BandMathImageFilter< TImage >::ImageType

Some convenient typedefs.

Definition at line 96 of file otbBandMathImageFilter.h.

◆ IndexType

template<class TImage >
typedef ImageType::IndexType otb::BandMathImageFilter< TImage >::IndexType

Definition at line 103 of file otbBandMathImageFilter.h.

◆ OrigineType

template<class TImage >
typedef ImageType::PointType otb::BandMathImageFilter< TImage >::OrigineType

Definition at line 104 of file otbBandMathImageFilter.h.

◆ ParserType

template<class TImage >
typedef Parser otb::BandMathImageFilter< TImage >::ParserType

Definition at line 106 of file otbBandMathImageFilter.h.

◆ PixelType

template<class TImage >
typedef ImageType::PixelType otb::BandMathImageFilter< TImage >::PixelType

Definition at line 102 of file otbBandMathImageFilter.h.

◆ Pointer

template<class TImage >
typedef itk::SmartPointer<Self> otb::BandMathImageFilter< TImage >::Pointer

Definition at line 89 of file otbBandMathImageFilter.h.

◆ Self

template<class TImage >
typedef BandMathImageFilter<TImage> otb::BandMathImageFilter< TImage >::Self

Standard class typedefs.

Definition at line 87 of file otbBandMathImageFilter.h.

◆ SpacingType

template<class TImage >
typedef ImageType::SpacingType otb::BandMathImageFilter< TImage >::SpacingType

Definition at line 105 of file otbBandMathImageFilter.h.

◆ Superclass

template<class TImage >
typedef itk::InPlaceImageFilter<TImage> otb::BandMathImageFilter< TImage >::Superclass

Definition at line 88 of file otbBandMathImageFilter.h.

Constructor & Destructor Documentation

◆ BandMathImageFilter() [1/2]

template<class TImage >
otb::BandMathImageFilter< TImage >::BandMathImageFilter ( )
protected

Constructor

Definition at line 40 of file otbBandMathImageFilter.hxx.

◆ ~BandMathImageFilter()

template<class TImage >
otb::BandMathImageFilter< TImage >::~BandMathImageFilter ( )
overrideprotected

Destructor

Definition at line 56 of file otbBandMathImageFilter.hxx.

◆ BandMathImageFilter() [2/2]

template<class TImage >
otb::BandMathImageFilter< TImage >::BandMathImageFilter ( const Self )
privatedelete

Member Function Documentation

◆ AfterThreadedGenerateData()

template<typename TImage >
void otb::BandMathImageFilter< TImage >::AfterThreadedGenerateData ( )
overrideprotected

Change the nth filter input associated variable name

Definition at line 207 of file otbBandMathImageFilter.hxx.

References otbWarningMacro.

◆ BeforeThreadedGenerateData()

template<typename TImage >
void otb::BandMathImageFilter< TImage >::BeforeThreadedGenerateData ( void  )
overrideprotected

Change the nth filter input associated variable name

Definition at line 135 of file otbBandMathImageFilter.hxx.

◆ CreateAnother()

template<class TImage >
virtual::itk::LightObject::Pointer otb::BandMathImageFilter< TImage >::CreateAnother ( void  ) const

◆ GetExpression()

template<typename TImage >
std::string otb::BandMathImageFilter< TImage >::GetExpression ( ) const

Return the expression to be parsed

Definition at line 123 of file otbBandMathImageFilter.hxx.

◆ GetNameOfClass()

template<class TImage >
virtual const char* otb::BandMathImageFilter< TImage >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

◆ GetNthInput()

template<typename TImage >
TImage * otb::BandMathImageFilter< TImage >::GetNthInput ( DataObjectPointerArraySizeType  idx)

Return a pointer on the nth filter input

Definition at line 109 of file otbBandMathImageFilter.hxx.

◆ GetNthInputName()

template<typename TImage >
std::string otb::BandMathImageFilter< TImage >::GetNthInputName ( DataObjectPointerArraySizeType  idx) const

Return the nth filter input associated variable name

Definition at line 129 of file otbBandMathImageFilter.hxx.

◆ New()

template<class TImage >
static Pointer otb::BandMathImageFilter< TImage >::New ( )
static

Method for creation through the object factory.

◆ operator=()

template<class TImage >
void otb::BandMathImageFilter< TImage >::operator= ( const Self )
privatedelete

◆ PrintSelf()

template<class TImage >
void otb::BandMathImageFilter< TImage >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

Change the nth filter input associated variable name

Definition at line 61 of file otbBandMathImageFilter.hxx.

◆ SetExpression()

template<typename TImage >
void otb::BandMathImageFilter< TImage >::SetExpression ( const std::string &  expression)

Set the expression to be parsed

Definition at line 115 of file otbBandMathImageFilter.hxx.

◆ SetNthInput() [1/2]

template<class TImage >
void otb::BandMathImageFilter< TImage >::SetNthInput ( DataObjectPointerArraySizeType  idx,
const ImageType image 
)

Definition at line 74 of file otbBandMathImageFilter.hxx.

◆ SetNthInput() [2/2]

template<class TImage >
void otb::BandMathImageFilter< TImage >::SetNthInput ( DataObjectPointerArraySizeType  idx,
const ImageType image,
const std::string &  varName 
)

Definition at line 90 of file otbBandMathImageFilter.hxx.

◆ SetNthInputName()

template<class TImage >
void otb::BandMathImageFilter< TImage >::SetNthInputName ( DataObjectPointerArraySizeType  idx,
const std::string &  expression 
)

Change the nth filter input associated variable name

Definition at line 103 of file otbBandMathImageFilter.hxx.

◆ ThreadedGenerateData()

template<typename TImage >
void otb::BandMathImageFilter< TImage >::ThreadedGenerateData ( const ImageRegionType outputRegionForThread,
itk::ThreadIdType  threadId 
)
overrideprotected

Change the nth filter input associated variable name

Definition at line 232 of file otbBandMathImageFilter.hxx.

References value().

Member Data Documentation

◆ m_AImage

template<class TImage >
std::vector<std::vector<double> > otb::BandMathImageFilter< TImage >::m_AImage
private

Definition at line 145 of file otbBandMathImageFilter.h.

◆ m_Expression

template<class TImage >
std::string otb::BandMathImageFilter< TImage >::m_Expression
private

Definition at line 143 of file otbBandMathImageFilter.h.

◆ m_NbVar

template<class TImage >
unsigned int otb::BandMathImageFilter< TImage >::m_NbVar
private

Definition at line 147 of file otbBandMathImageFilter.h.

◆ m_Origin

template<class TImage >
OrigineType otb::BandMathImageFilter< TImage >::m_Origin
private

Definition at line 150 of file otbBandMathImageFilter.h.

◆ m_OverflowCount

template<class TImage >
long otb::BandMathImageFilter< TImage >::m_OverflowCount
private

Definition at line 153 of file otbBandMathImageFilter.h.

◆ m_Spacing

template<class TImage >
SpacingType otb::BandMathImageFilter< TImage >::m_Spacing
private

Definition at line 149 of file otbBandMathImageFilter.h.

◆ m_ThreadOverflow

template<class TImage >
itk::Array<long> otb::BandMathImageFilter< TImage >::m_ThreadOverflow
private

Definition at line 155 of file otbBandMathImageFilter.h.

◆ m_ThreadUnderflow

template<class TImage >
itk::Array<long> otb::BandMathImageFilter< TImage >::m_ThreadUnderflow
private

Definition at line 154 of file otbBandMathImageFilter.h.

◆ m_UnderflowCount

template<class TImage >
long otb::BandMathImageFilter< TImage >::m_UnderflowCount
private

Definition at line 152 of file otbBandMathImageFilter.h.

◆ m_VParser

template<class TImage >
std::vector<ParserType::Pointer> otb::BandMathImageFilter< TImage >::m_VParser
private

Definition at line 144 of file otbBandMathImageFilter.h.

◆ m_VVarName

template<class TImage >
std::vector<std::string> otb::BandMathImageFilter< TImage >::m_VVarName
private

Definition at line 146 of file otbBandMathImageFilter.h.


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