NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
NumeRe::RetouchRegion Class Reference

This class is a specialized WeightedLinearFilter used to retouch missing data values. More...

#include <filtering.hpp>

Inheritance diagram for NumeRe::RetouchRegion:
Collaboration diagram for NumeRe::RetouchRegion:

Public Member Functions

 RetouchRegion (size_t _row, size_t _col, const mu::value_type &_dMedian)
 Filter constructor. Will automatically create the filter kernel. More...
 
virtual ~RetouchRegion () override
 Filter destructor. Will clear the previously calculated filter kernel. More...
 
virtual double operator() (size_t i, size_t j) const override
 Override for the operator(). Returns the filter kernel at the desired position. More...
 
virtual mu::value_type apply (size_t i, size_t j, const mu::value_type &val) const override
 Override for the abstract apply method of the base class. Applies the filter to the value at the selected position and returns the new value. More...
 
void setBoundaries (const std::vector< mu::value_type > &left, const std::vector< mu::value_type > &right, const std::vector< mu::value_type > &top=std::vector< mu::value_type >(), const std::vector< mu::value_type > &bottom=std::vector< mu::value_type >())
 This method is used to update the internal filter boundaries. More...
 
mu::value_type retouch (size_t i, size_t j, const mu::value_type &val, const mu::value_type &med)
 This method is a wrapper to retouch only invalid values. The default value of invalid values is the median value declared at construction time. More...
 
- Public Member Functions inherited from NumeRe::Filter
 Filter (size_t row, size_t col)
 Filter base constructor. Will set the used window sizes. More...
 
virtual ~Filter ()
 Empty virtual abstract destructor. More...
 
virtual double operator() (size_t i, size_t j) const =0
 Virtual operator() override. Has to be implemented in the child classes and shall return the kernel value at position (i,j). More...
 
virtual mu::value_type apply (size_t i, size_t j, const mu::value_type &val) const =0
 Virtual method for applying the filter to a distinct value. Has to be implemented in all child classes. More...
 
bool isConvolution () const
 This method returns, whether the current filter is a convolution, ie. whether the returned value may be used directly or if all values of a window have to be accumulated first. More...
 
FilterSettings::FilterType getType () const
 This method returns the type of the current filter as a value of the FilterType enumeration. More...
 
std::pair< size_t, size_t > getWindowSize () const
 This method returns the window size of the current filter as a std::pair in the order (row,col). More...
 
FilterBuffergetBuffer ()
 This method returns the internal filtering buffer queue to store already smoothed points avoiding leakage effects. More...
 
FilterBuffer2Dget2DBuffer ()
 This method returns the internal filtering buffer queue for 2D data to store already smoothed points avoiding leakage effects. More...
 

Private Member Functions

void createKernel ()
 This method will create the filter's kernel for the selected window size. More...
 
mu::value_type left (size_t i, size_t j) const
 This method will return the correct value for the left interval boundary. More...
 
mu::value_type right (size_t i, size_t j) const
 This method will return the correct value for the right interval boundary. More...
 
mu::value_type top (size_t i, size_t j) const
 This method will return the correct value for the top interval boundary. More...
 
mu::value_type bottom (size_t i, size_t j) const
 This method will return the correct value for the bottom interval boundary. More...
 
mu::value_type topleft (size_t i, size_t j) const
 This method will return the correct value for the topleft diagonal interval boundary. More...
 
mu::value_type topright (size_t i, size_t j) const
 This method will return the correct value for the topright diagonal interval boundary. More...
 
mu::value_type bottomleft (size_t i, size_t j) const
 This method will return the correct value for the bottomleft diagonal interval boundary. More...
 
mu::value_type bottomright (size_t i, size_t j) const
 This method will return the correct value for the bottomright diagonal interval boundary. More...
 
mu::value_type validize (mu::value_type val) const
 This method checks, whether the passed value is a valid value and returns it. If it is not, it will be replaced by the fallback value. More...
 

Private Attributes

std::vector< mu::value_typem_left
 
std::vector< mu::value_typem_right
 
std::vector< mu::value_typem_top
 
std::vector< mu::value_typem_bottom
 
bool is2D
 
std::vector< std::vector< double > > m_filterKernel
 
mu::value_type m_fallback
 
bool m_invertedKernel
 

Additional Inherited Members

- Protected Attributes inherited from NumeRe::Filter
FilterSettings::FilterType m_type
 
std::pair< size_t, size_t > m_windowSize
 
bool m_isConvolution
 
FilterBuffer m_buffer
 
FilterBuffer2D m_buffer2D
 

Detailed Description

This class is a specialized WeightedLinearFilter used to retouch missing data values.

Definition at line 837 of file filtering.hpp.

Constructor & Destructor Documentation

◆ RetouchRegion()

NumeRe::RetouchRegion::RetouchRegion ( size_t  _row,
size_t  _col,
const mu::value_type _dMedian 
)
inline

Filter constructor. Will automatically create the filter kernel.

Parameters
_rowsize_t
_colsize_t
_dMedianconst mu::value_type&

Definition at line 1047 of file filtering.hpp.

References createKernel(), NumeRe::FilterSettings::FILTER_WEIGHTED_LINEAR, is2D, m_fallback, m_invertedKernel, NumeRe::Filter::m_isConvolution, and NumeRe::Filter::m_type.

Here is the call graph for this function:

◆ ~RetouchRegion()

virtual NumeRe::RetouchRegion::~RetouchRegion ( )
inlineoverridevirtual

Filter destructor. Will clear the previously calculated filter kernel.

Definition at line 1062 of file filtering.hpp.

References m_filterKernel.

Member Function Documentation

◆ apply()

virtual mu::value_type NumeRe::RetouchRegion::apply ( size_t  i,
size_t  j,
const mu::value_type val 
) const
inlineoverridevirtual

Override for the abstract apply method of the base class. Applies the filter to the value at the selected position and returns the new value.

Parameters
isize_t
jsize_t
valconst mu::value_type&
Returns
virtual mu::value_type

Implements NumeRe::Filter.

Definition at line 1096 of file filtering.hpp.

References bottom(), bottomleft(), bottomright(), is2D, left(), m_filterKernel, m_invertedKernel, NumeRe::Filter::m_windowSize, right(), top(), topleft(), and topright().

Referenced by retouch().

Here is the call graph for this function:

◆ bottom()

mu::value_type NumeRe::RetouchRegion::bottom ( size_t  i,
size_t  j 
) const
inlineprivate

This method will return the correct value for the bottom interval boundary.

Parameters
isize_t
jsize_t
Returns
mu::value_type

Definition at line 939 of file filtering.hpp.

References is2D, m_bottom, and validize().

Referenced by apply(), and setBoundaries().

Here is the call graph for this function:

◆ bottomleft()

mu::value_type NumeRe::RetouchRegion::bottomleft ( size_t  i,
size_t  j 
) const
inlineprivate

This method will return the correct value for the bottomleft diagonal interval boundary.

Parameters
isize_t
jsize_t
Returns
mu::value_type

Definition at line 993 of file filtering.hpp.

References m_bottom, m_left, NumeRe::Filter::m_windowSize, and validize().

Referenced by apply().

Here is the call graph for this function:

◆ bottomright()

mu::value_type NumeRe::RetouchRegion::bottomright ( size_t  i,
size_t  j 
) const
inlineprivate

This method will return the correct value for the bottomright diagonal interval boundary.

Parameters
isize_t
jsize_t
Returns
mu::value_type

Definition at line 1011 of file filtering.hpp.

References m_bottom, m_right, NumeRe::Filter::m_windowSize, and validize().

Referenced by apply().

Here is the call graph for this function:

◆ createKernel()

void NumeRe::RetouchRegion::createKernel ( )
inlineprivate

This method will create the filter's kernel for the selected window size.

Returns
void

Definition at line 856 of file filtering.hpp.

References is2D, m_filterKernel, NumeRe::Filter::m_windowSize, max, and NumeRe::pow2().

Referenced by RetouchRegion().

Here is the call graph for this function:

◆ left()

mu::value_type NumeRe::RetouchRegion::left ( size_t  i,
size_t  j 
) const
inlineprivate

This method will return the correct value for the left interval boundary.

Parameters
isize_t
jsize_t
Returns
mu::value_type

Definition at line 888 of file filtering.hpp.

References is2D, m_left, and validize().

Referenced by apply(), and setBoundaries().

Here is the call graph for this function:

◆ operator()()

virtual double NumeRe::RetouchRegion::operator() ( size_t  i,
size_t  j 
) const
inlineoverridevirtual

Override for the operator(). Returns the filter kernel at the desired position.

Parameters
isize_t
jsize_t
Returns
double

Implements NumeRe::Filter.

Definition at line 1076 of file filtering.hpp.

References m_filterKernel, and NumeRe::Filter::m_windowSize.

◆ retouch()

mu::value_type NumeRe::RetouchRegion::retouch ( size_t  i,
size_t  j,
const mu::value_type val,
const mu::value_type med 
)
inline

This method is a wrapper to retouch only invalid values. The default value of invalid values is the median value declared at construction time.

Parameters
isize_t
jsize_t
valconst mu::value_type&
medconst mu::value_type&
Returns
mu::value_type

Definition at line 1172 of file filtering.hpp.

References apply(), mu::isnan(), and m_fallback.

Referenced by Memory::retouch2D().

Here is the call graph for this function:

◆ right()

mu::value_type NumeRe::RetouchRegion::right ( size_t  i,
size_t  j 
) const
inlineprivate

This method will return the correct value for the right interval boundary.

Parameters
isize_t
jsize_t
Returns
mu::value_type

Definition at line 905 of file filtering.hpp.

References is2D, m_right, and validize().

Referenced by apply(), and setBoundaries().

Here is the call graph for this function:

◆ setBoundaries()

void NumeRe::RetouchRegion::setBoundaries ( const std::vector< mu::value_type > &  left,
const std::vector< mu::value_type > &  right,
const std::vector< mu::value_type > &  top = std::vector<mu::value_type>(),
const std::vector< mu::value_type > &  bottom = std::vector<mu::value_type>() 
)
inline

This method is used to update the internal filter boundaries.

Parameters
leftconst std::vector<mu::value_type>&
rightconst std::vector<mu::value_type>&
topconst std::vector<mu::value_type>&
bottomconst std::vector<mu::value_type>&
Returns
void

Definition at line 1151 of file filtering.hpp.

References bottom(), left(), m_bottom, m_left, m_right, m_top, right(), and top().

Referenced by Memory::retouch2D().

Here is the call graph for this function:

◆ top()

mu::value_type NumeRe::RetouchRegion::top ( size_t  i,
size_t  j 
) const
inlineprivate

This method will return the correct value for the top interval boundary.

Parameters
isize_t
jsize_t
Returns
mu::value_type

Definition at line 922 of file filtering.hpp.

References is2D, m_top, and validize().

Referenced by apply(), and setBoundaries().

Here is the call graph for this function:

◆ topleft()

mu::value_type NumeRe::RetouchRegion::topleft ( size_t  i,
size_t  j 
) const
inlineprivate

This method will return the correct value for the topleft diagonal interval boundary.

Parameters
isize_t
jsize_t
Returns
mu::value_type

Definition at line 957 of file filtering.hpp.

References m_left, m_top, and validize().

Referenced by apply().

Here is the call graph for this function:

◆ topright()

mu::value_type NumeRe::RetouchRegion::topright ( size_t  i,
size_t  j 
) const
inlineprivate

This method will return the correct value for the topright diagonal interval boundary.

Parameters
isize_t
jsize_t
Returns
mu::value_type

Definition at line 975 of file filtering.hpp.

References m_right, m_top, NumeRe::Filter::m_windowSize, and validize().

Referenced by apply().

Here is the call graph for this function:

◆ validize()

mu::value_type NumeRe::RetouchRegion::validize ( mu::value_type  val) const
inlineprivate

This method checks, whether the passed value is a valid value and returns it. If it is not, it will be replaced by the fallback value.

Parameters
valmu::value_type
Returns
mu::value_type

Definition at line 1029 of file filtering.hpp.

References mu::isnan(), and m_fallback.

Referenced by bottom(), bottomleft(), bottomright(), left(), right(), top(), topleft(), and topright().

Here is the call graph for this function:

Member Data Documentation

◆ is2D

bool NumeRe::RetouchRegion::is2D
private

Definition at line 844 of file filtering.hpp.

Referenced by apply(), bottom(), createKernel(), left(), RetouchRegion(), right(), and top().

◆ m_bottom

std::vector<mu::value_type> NumeRe::RetouchRegion::m_bottom
private

Definition at line 843 of file filtering.hpp.

Referenced by bottom(), bottomleft(), bottomright(), and setBoundaries().

◆ m_fallback

mu::value_type NumeRe::RetouchRegion::m_fallback
private

Definition at line 846 of file filtering.hpp.

Referenced by retouch(), RetouchRegion(), and validize().

◆ m_filterKernel

std::vector<std::vector<double> > NumeRe::RetouchRegion::m_filterKernel
private

Definition at line 845 of file filtering.hpp.

Referenced by apply(), createKernel(), operator()(), and ~RetouchRegion().

◆ m_invertedKernel

bool NumeRe::RetouchRegion::m_invertedKernel
private

Definition at line 847 of file filtering.hpp.

Referenced by apply(), and RetouchRegion().

◆ m_left

std::vector<mu::value_type> NumeRe::RetouchRegion::m_left
private

Definition at line 840 of file filtering.hpp.

Referenced by bottomleft(), left(), setBoundaries(), and topleft().

◆ m_right

std::vector<mu::value_type> NumeRe::RetouchRegion::m_right
private

Definition at line 841 of file filtering.hpp.

Referenced by bottomright(), right(), setBoundaries(), and topright().

◆ m_top

std::vector<mu::value_type> NumeRe::RetouchRegion::m_top
private

Definition at line 842 of file filtering.hpp.

Referenced by setBoundaries(), top(), topleft(), and topright().


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