OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | List of all members

#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
 

Static Public Member Functions

static Pointer New ()
 
std::string m_Expression
 
std::vector< ParserType::Pointerm_VParser
 
std::vector< std::vector< double > > m_AImage
 
std::vector< std::string > m_VVarName
 
unsigned int m_NbVar
 
SpacingType m_Spacing
 
OrigineType m_Origin
 
long m_UnderflowCount
 
long m_OverflowCount
 
itk::Array< long > m_ThreadUnderflow
 
itk::Array< long > m_ThreadOverflow
 
void SetNthInput (DataObjectPointerArraySizeType idx, const ImageType *image)
 
void SetNthInput (DataObjectPointerArraySizeType idx, const ImageType *image, const std::string &varName)
 
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
 
 BandMathImageFilter (const Self &)=delete
 
void operator= (const Self &)=delete
 

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 specified, 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

Change the nth filter input associated variable name

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
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

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

Change the nth filter input associated variable name

◆ 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 
)

Change the nth filter input associated variable name

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 
)

Change the nth filter input associated variable name

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.

Member Data Documentation

◆ m_AImage

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

Change the nth filter input associated variable name

Definition at line 145 of file otbBandMathImageFilter.h.

◆ m_Expression

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

Change the nth filter input associated variable name

Definition at line 143 of file otbBandMathImageFilter.h.

◆ m_NbVar

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

Change the nth filter input associated variable name

Definition at line 147 of file otbBandMathImageFilter.h.

◆ m_Origin

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

Change the nth filter input associated variable name

Definition at line 150 of file otbBandMathImageFilter.h.

◆ m_OverflowCount

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

Change the nth filter input associated variable name

Definition at line 153 of file otbBandMathImageFilter.h.

◆ m_Spacing

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

Change the nth filter input associated variable name

Definition at line 149 of file otbBandMathImageFilter.h.

◆ m_ThreadOverflow

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

Change the nth filter input associated variable name

Definition at line 155 of file otbBandMathImageFilter.h.

◆ m_ThreadUnderflow

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

Change the nth filter input associated variable name

Definition at line 154 of file otbBandMathImageFilter.h.

◆ m_UnderflowCount

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

Change the nth filter input associated variable name

Definition at line 152 of file otbBandMathImageFilter.h.

◆ m_VParser

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

Change the nth filter input associated variable name

Definition at line 144 of file otbBandMathImageFilter.h.

◆ m_VVarName

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

Change the nth filter input associated variable name

Definition at line 146 of file otbBandMathImageFilter.h.


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