Orfeo ToolBox  4.2
Orfeo ToolBox is not a black box
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
otb::BandMathImageFilter< TImage > Class Template Reference

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

#include <otbBandMathImageFilter.h>

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

Public Types

typedef itk::SmartPointer
< const Self
ConstPointer
 
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
 
std::string GetExpression () const
 
virtual const char * GetNameOfClass () const
 
ImageTypeGetNthInput (unsigned int idx)
 
std::string GetNthInputName (unsigned int idx) const
 
void SetExpression (const std::string &expression)
 
void SetNthInput (unsigned int idx, const ImageType *image)
 
void SetNthInput (unsigned int idx, const ImageType *image, const std::string &varName)
 
void SetNthInputName (unsigned int idx, const std::string &expression)
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::ImageSource< TOutputImage >
static const
ImageRegionSplitterBase
GetGlobalDefaultSplitter (void)
 

Protected Member Functions

 BandMathImageFilter ()
 
virtual ~BandMathImageFilter ()
 
void AfterThreadedGenerateData ()
 
void BeforeThreadedGenerateData ()
 
virtual void PrintSelf (std::ostream &os, itk::Indent indent) const
 
void ThreadedGenerateData (const ImageRegionType &outputRegionForThread, itk::ThreadIdType threadId)
 

Private Member Functions

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

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
 

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 79 of file otbBandMathImageFilter.h.

Member Typedef Documentation

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

Definition at line 87 of file otbBandMathImageFilter.h.

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

Definition at line 97 of file otbBandMathImageFilter.h.

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

Definition at line 98 of file otbBandMathImageFilter.h.

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

Some convenient typedefs.

Definition at line 93 of file otbBandMathImageFilter.h.

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

Definition at line 100 of file otbBandMathImageFilter.h.

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

Definition at line 101 of file otbBandMathImageFilter.h.

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

Definition at line 103 of file otbBandMathImageFilter.h.

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

Definition at line 99 of file otbBandMathImageFilter.h.

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

Definition at line 86 of file otbBandMathImageFilter.h.

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

Standard class typedefs.

Definition at line 84 of file otbBandMathImageFilter.h.

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

Definition at line 102 of file otbBandMathImageFilter.h.

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

Definition at line 85 of file otbBandMathImageFilter.h.

Constructor & Destructor Documentation

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

Constructor

Definition at line 41 of file otbBandMathImageFilter.txx.

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

Destructor

Definition at line 57 of file otbBandMathImageFilter.txx.

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

Member Function Documentation

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

Definition at line 220 of file otbBandMathImageFilter.txx.

References otbWarningMacro.

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

Definition at line 147 of file otbBandMathImageFilter.txx.

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

Return the expression to be parsed

Definition at line 133 of file otbBandMathImageFilter.txx.

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

Run-time type information (and related methods).

Reimplemented from itk::InPlaceImageFilter< TImage >.

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

Return a pointer on the nth filter input

Definition at line 117 of file otbBandMathImageFilter.txx.

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

Return the nth filter input associated variable name

Definition at line 140 of file otbBandMathImageFilter.txx.

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

Method for creation through the object factory.

template<class TImage >
void otb::BandMathImageFilter< TImage >::operator= ( const Self )
private
template<class TImage >
void otb::BandMathImageFilter< TImage >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
protectedvirtual
template<typename TImage >
void otb::BandMathImageFilter< TImage >::SetExpression ( const std::string &  expression)

Set the expression to be parsed

Definition at line 124 of file otbBandMathImageFilter.txx.

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

Set the nth filter input with or without a specified associated variable name

Definition at line 79 of file otbBandMathImageFilter.txx.

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

Definition at line 96 of file otbBandMathImageFilter.txx.

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

Change the nth filter input associated variable name

Definition at line 110 of file otbBandMathImageFilter.txx.

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

Member Data Documentation

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

Definition at line 139 of file otbBandMathImageFilter.h.

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

Definition at line 137 of file otbBandMathImageFilter.h.

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

Definition at line 141 of file otbBandMathImageFilter.h.

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

Definition at line 144 of file otbBandMathImageFilter.h.

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

Definition at line 147 of file otbBandMathImageFilter.h.

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

Definition at line 143 of file otbBandMathImageFilter.h.

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

Definition at line 149 of file otbBandMathImageFilter.h.

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

Definition at line 148 of file otbBandMathImageFilter.h.

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

Definition at line 146 of file otbBandMathImageFilter.h.

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

Definition at line 138 of file otbBandMathImageFilter.h.

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

Definition at line 140 of file otbBandMathImageFilter.h.


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