OTB  7.0.0
Orfeo Toolbox
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
otb::BandMathXImageFilter< TImage > Class Template Reference

#include <otbBandMathXImageFilter.h>

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

Classes

struct  adhocStruct
 

Public Types

typedef ImageType::ConstPointer ConstImagePointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
 
typedef ImageType::Pointer ImagePointer
 
typedef ImageType::RegionType ImageRegionType
 
typedef TImage ImageType
 
typedef ImageType::IndexType IndexType
 
typedef StreamingStatisticsVectorImageFilterType::MatrixType MatrixType
 
typedef ImageType::PointType OrigineType
 
typedef ParserX ParserType
 
typedef ImageType::PixelType PixelType
 
typedef ImageType::PixelType::ValueType PixelValueType
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
 
typedef BandMathXImageFilter< TImage > Self
 
typedef ImageType::SpacingType SpacingType
 
typedef StreamingStatisticsVectorImageFilterType::Pointer StreamingStatisticsVectorImageFilterPointerType
 
typedef StreamingStatisticsVectorImageFilter< ImageTypeStreamingStatisticsVectorImageFilterType
 
typedef itk::ImageToImageFilter< TImage, TImage > Superclass
 
typedef ParserType::ValueType ValueType
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
bool GlobalStatsDetected () 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 ()
 

Protected Member Functions

 BandMathXImageFilter ()
 

Private Member Functions

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

Private Attributes

std::vector< std::vector< adhocStruct > > m_AImage
 
std::vector< std::string > m_Expression
 
bool m_ManyExpressions
 
std::vector< unsigned int > m_NeighDetected
 
std::vector< RadiusTypem_NeighExtremaSizes
 
std::vector< unsigned int > m_outputsDimensions
 
long m_OverflowCount
 
unsigned int m_SizeNeighbourhood
 
std::vector< int > m_StatsVarDetected
 
itk::Array< long > m_ThreadOverflow
 
itk::Array< long > m_ThreadUnderflow
 
long m_UnderflowCount
 
std::vector< adhocStructm_VAllowedVarNameAddedByUser
 
std::vector< adhocStructm_VAllowedVarNameAuto
 
std::vector< adhocStructm_VFinalAllowedVarName
 
std::vector< adhocStructm_VNotAllowedVarName
 
std::vector< std::vector< ParserType::Pointer > > m_VParser
 
std::vector< adhocStructm_VVarName
 
ImageTypeGetNthInput (DataObjectPointerArraySizeType idx)
 
void SetManyExpressions (bool flag)
 
void SetExpression (const std::string &expression)
 
std::string GetExpression (unsigned int IDExpression) const
 
void SetMatrix (const std::string &name, const std::string &definition)
 
void SetConstant (const std::string &name, double value)
 
void ExportContext (const std::string &filename)
 
void ImportContext (const std::string &filename)
 
void ClearExpression ()
 
std::vector< std::string > GetVarNames () const
 
 ~BandMathXImageFilter () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
void GenerateOutputInformation () override
 
void GenerateInputRequestedRegion () override
 
void BeforeThreadedGenerateData () override
 
void ThreadedGenerateData (const ImageRegionType &outputRegionForThread, itk::ThreadIdType threadId) override
 
void AfterThreadedGenerateData () override
 
void AddVariable (adhocStruct &)
 
void CheckImageDimensions ()
 
void PrepareParsers ()
 
void PrepareParsersGlobStats ()
 
void OutputsDimensions ()
 

Detailed Description

template<class TImage>
class otb::BandMathXImageFilter< TImage >

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

This filter is based on the mathematical parser library muParserX. The built in functions and operators list is available at: http://articles.beltoforion.de/article.php?a=muparserx.

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 jth (j=1..T) input image, if no associated variable name has been specified, a default variable name is given by concatenating the prefix "im" with the corresponding input index plus one (for instance, im1 is related to the first input). If the jth input image is multidimensional, then the variable imj represents a vector whose components are related to its bands. In order to access the kth band, the variable observes the following pattern : imjbk.

See also
Parser

Definition at line 65 of file otbBandMathXImageFilter.h.

Member Typedef Documentation

◆ ConstImagePointer

template<class TImage >
typedef ImageType::ConstPointer otb::BandMathXImageFilter< TImage >::ConstImagePointer

Definition at line 82 of file otbBandMathXImageFilter.h.

◆ ConstPointer

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

Definition at line 72 of file otbBandMathXImageFilter.h.

◆ DataObjectPointerArraySizeType

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

Definition at line 93 of file otbBandMathXImageFilter.h.

◆ ImagePointer

template<class TImage >
typedef ImageType::Pointer otb::BandMathXImageFilter< TImage >::ImagePointer

Definition at line 83 of file otbBandMathXImageFilter.h.

◆ ImageRegionType

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

Definition at line 84 of file otbBandMathXImageFilter.h.

◆ ImageType

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

Some convenient typedefs.

Definition at line 78 of file otbBandMathXImageFilter.h.

◆ IndexType

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

Definition at line 88 of file otbBandMathXImageFilter.h.

◆ MatrixType

Definition at line 98 of file otbBandMathXImageFilter.h.

◆ OrigineType

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

Definition at line 89 of file otbBandMathXImageFilter.h.

◆ ParserType

template<class TImage >
typedef ParserX otb::BandMathXImageFilter< TImage >::ParserType

Definition at line 91 of file otbBandMathXImageFilter.h.

◆ PixelType

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

Definition at line 87 of file otbBandMathXImageFilter.h.

◆ PixelValueType

template<class TImage >
typedef ImageType::PixelType::ValueType otb::BandMathXImageFilter< TImage >::PixelValueType

Definition at line 86 of file otbBandMathXImageFilter.h.

◆ Pointer

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

Definition at line 71 of file otbBandMathXImageFilter.h.

◆ RadiusType

template<class TImage >
typedef itk::ConstNeighborhoodIterator<TImage>::RadiusType otb::BandMathXImageFilter< TImage >::RadiusType

Definition at line 85 of file otbBandMathXImageFilter.h.

◆ Self

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

Standard class typedefs.

Definition at line 69 of file otbBandMathXImageFilter.h.

◆ SpacingType

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

Definition at line 90 of file otbBandMathXImageFilter.h.

◆ StreamingStatisticsVectorImageFilterPointerType

Definition at line 97 of file otbBandMathXImageFilter.h.

◆ StreamingStatisticsVectorImageFilterType

Typedef for statistic computing.

Definition at line 96 of file otbBandMathXImageFilter.h.

◆ Superclass

template<class TImage >
typedef itk::ImageToImageFilter<TImage, TImage> otb::BandMathXImageFilter< TImage >::Superclass

Definition at line 70 of file otbBandMathXImageFilter.h.

◆ ValueType

template<class TImage >
typedef ParserType::ValueType otb::BandMathXImageFilter< TImage >::ValueType

Definition at line 92 of file otbBandMathXImageFilter.h.

Constructor & Destructor Documentation

◆ BandMathXImageFilter() [1/2]

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

◆ ~BandMathXImageFilter()

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

Destructor

Definition at line 75 of file otbBandMathXImageFilter.hxx.

◆ BandMathXImageFilter() [2/2]

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

Member Function Documentation

◆ AddVariable()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::AddVariable ( adhocStruct ahc)
private

Return a pointer on the nth filter input

Definition at line 520 of file otbBandMathXImageFilter.hxx.

References name(), and otb::BandMathXImageFilter< TImage >::adhocStruct::name.

◆ AfterThreadedGenerateData()

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

Return a pointer on the nth filter input

Definition at line 977 of file otbBandMathXImageFilter.hxx.

References otbWarningMacro.

◆ BeforeThreadedGenerateData()

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

Return a pointer on the nth filter input

Definition at line 964 of file otbBandMathXImageFilter.hxx.

◆ CheckImageDimensions()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::CheckImageDimensions ( void  )
private

Return a pointer on the nth filter input

Definition at line 861 of file otbBandMathXImageFilter.hxx.

◆ ClearExpression()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::ClearExpression ( )

Clear all previously set expression

Definition at line 252 of file otbBandMathXImageFilter.hxx.

◆ CreateAnother()

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

◆ ExportContext()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::ExportContext ( const std::string &  filename)

Export constants and expressions to a given filename

Definition at line 332 of file otbBandMathXImageFilter.hxx.

References value().

◆ GenerateInputRequestedRegion()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::GenerateInputRequestedRegion ( void  )
overrideprotected

Return a pointer on the nth filter input

Definition at line 914 of file otbBandMathXImageFilter.hxx.

◆ GenerateOutputInformation()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::GenerateOutputInformation ( void  )
overrideprotected

Return a pointer on the nth filter input

Definition at line 882 of file otbBandMathXImageFilter.hxx.

◆ GetExpression()

template<typename TImage >
std::string otb::BandMathXImageFilter< TImage >::GetExpression ( unsigned int  IDExpression) const

Return the nth expression to be parsed

Definition at line 500 of file otbBandMathXImageFilter.hxx.

◆ GetNameOfClass()

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

Run-time type information (and related methods).

◆ GetNthInput()

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

Return a pointer on the nth filter input

Definition at line 210 of file otbBandMathXImageFilter.hxx.

◆ GetVarNames()

template<typename TImage >
std::vector< std::string > otb::BandMathXImageFilter< TImage >::GetVarNames ( ) const

Return the variable and constant names

Definition at line 509 of file otbBandMathXImageFilter.hxx.

◆ GlobalStatsDetected()

template<class TImage >
bool otb::BandMathXImageFilter< TImage >::GlobalStatsDetected ( ) const
inline

Definition at line 136 of file otbBandMathXImageFilter.h.

◆ ImportContext()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::ImportContext ( const std::string &  filename)

Import constants and expressions from a given filename

Definition at line 403 of file otbBandMathXImageFilter.hxx.

References name(), and value().

◆ New()

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

Method for creation through the object factory.

◆ operator=()

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

◆ OutputsDimensions()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::OutputsDimensions ( )
private

Return a pointer on the nth filter input

Definition at line 812 of file otbBandMathXImageFilter.hxx.

References value().

◆ PrepareParsers()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::PrepareParsers ( )
private

Return a pointer on the nth filter input

Definition at line 533 of file otbBandMathXImageFilter.hxx.

References name(), otb::BandMathXImageFilter< TImage >::adhocStruct::name, and value().

◆ PrepareParsersGlobStats()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::PrepareParsersGlobStats ( )
private

Return a pointer on the nth filter input

Definition at line 739 of file otbBandMathXImageFilter.hxx.

◆ PrintSelf()

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

Return a pointer on the nth filter input

Definition at line 95 of file otbBandMathXImageFilter.hxx.

◆ SetConstant()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::SetConstant ( const std::string &  name,
double  value 
)

◆ SetExpression()

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

Set an expression to be parsed

Definition at line 222 of file otbBandMathXImageFilter.hxx.

◆ SetManyExpressions()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::SetManyExpressions ( bool  flag)

Set an expression to be parsed

Definition at line 216 of file otbBandMathXImageFilter.hxx.

◆ SetMatrix()

template<typename TImage >
void otb::BandMathXImageFilter< TImage >::SetMatrix ( const std::string &  name,
const std::string &  definition 
)

◆ SetNthInput() [1/2]

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

Definition at line 110 of file otbBandMathXImageFilter.hxx.

◆ SetNthInput() [2/2]

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

◆ ThreadedGenerateData()

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

Return a pointer on the nth filter input

Definition at line 1008 of file otbBandMathXImageFilter.hxx.

References value().

Member Data Documentation

◆ m_AImage

template<class TImage >
std::vector<std::vector<adhocStruct> > otb::BandMathXImageFilter< TImage >::m_AImage
private

Definition at line 174 of file otbBandMathXImageFilter.h.

◆ m_Expression

template<class TImage >
std::vector<std::string> otb::BandMathXImageFilter< TImage >::m_Expression
private

Definition at line 172 of file otbBandMathXImageFilter.h.

◆ m_ManyExpressions

template<class TImage >
bool otb::BandMathXImageFilter< TImage >::m_ManyExpressions
private

Definition at line 194 of file otbBandMathXImageFilter.h.

◆ m_NeighDetected

template<class TImage >
std::vector<unsigned int> otb::BandMathXImageFilter< TImage >::m_NeighDetected
private

Definition at line 186 of file otbBandMathXImageFilter.h.

◆ m_NeighExtremaSizes

template<class TImage >
std::vector<RadiusType> otb::BandMathXImageFilter< TImage >::m_NeighExtremaSizes
private

Definition at line 187 of file otbBandMathXImageFilter.h.

◆ m_outputsDimensions

template<class TImage >
std::vector<unsigned int> otb::BandMathXImageFilter< TImage >::m_outputsDimensions
private

Definition at line 180 of file otbBandMathXImageFilter.h.

◆ m_OverflowCount

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

Definition at line 190 of file otbBandMathXImageFilter.h.

◆ m_SizeNeighbourhood

template<class TImage >
unsigned int otb::BandMathXImageFilter< TImage >::m_SizeNeighbourhood
private

Definition at line 182 of file otbBandMathXImageFilter.h.

◆ m_StatsVarDetected

template<class TImage >
std::vector<int> otb::BandMathXImageFilter< TImage >::m_StatsVarDetected
private

Definition at line 184 of file otbBandMathXImageFilter.h.

◆ m_ThreadOverflow

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

Definition at line 192 of file otbBandMathXImageFilter.h.

◆ m_ThreadUnderflow

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

Definition at line 191 of file otbBandMathXImageFilter.h.

◆ m_UnderflowCount

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

Definition at line 189 of file otbBandMathXImageFilter.h.

◆ m_VAllowedVarNameAddedByUser

template<class TImage >
std::vector<adhocStruct> otb::BandMathXImageFilter< TImage >::m_VAllowedVarNameAddedByUser
private

Definition at line 177 of file otbBandMathXImageFilter.h.

◆ m_VAllowedVarNameAuto

template<class TImage >
std::vector<adhocStruct> otb::BandMathXImageFilter< TImage >::m_VAllowedVarNameAuto
private

Definition at line 176 of file otbBandMathXImageFilter.h.

◆ m_VFinalAllowedVarName

template<class TImage >
std::vector<adhocStruct> otb::BandMathXImageFilter< TImage >::m_VFinalAllowedVarName
private

Definition at line 178 of file otbBandMathXImageFilter.h.

◆ m_VNotAllowedVarName

template<class TImage >
std::vector<adhocStruct> otb::BandMathXImageFilter< TImage >::m_VNotAllowedVarName
private

Definition at line 179 of file otbBandMathXImageFilter.h.

◆ m_VParser

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

Definition at line 173 of file otbBandMathXImageFilter.h.

◆ m_VVarName

template<class TImage >
std::vector<adhocStruct> otb::BandMathXImageFilter< TImage >::m_VVarName
private

Definition at line 175 of file otbBandMathXImageFilter.h.


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