NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class is a specialized WeightedLinearFilter used to retouch missing data values. More...
#include <filtering.hpp>
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... | |
FilterBuffer & | getBuffer () |
This method returns the internal filtering buffer queue to store already smoothed points avoiding leakage effects. More... | |
FilterBuffer2D & | get2DBuffer () |
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_type > | m_left |
std::vector< mu::value_type > | m_right |
std::vector< mu::value_type > | m_top |
std::vector< mu::value_type > | m_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 |
This class is a specialized WeightedLinearFilter used to retouch missing data values.
Definition at line 837 of file filtering.hpp.
|
inline |
Filter constructor. Will automatically create the filter kernel.
_row | size_t |
_col | size_t |
_dMedian | const 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.
|
inlineoverridevirtual |
Filter destructor. Will clear the previously calculated filter kernel.
Definition at line 1062 of file filtering.hpp.
References m_filterKernel.
|
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.
i | size_t |
j | size_t |
val | const 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().
|
inlineprivate |
This method will return the correct value for the bottom interval boundary.
i | size_t |
j | size_t |
Definition at line 939 of file filtering.hpp.
References is2D, m_bottom, and validize().
Referenced by apply(), and setBoundaries().
|
inlineprivate |
This method will return the correct value for the bottomleft diagonal interval boundary.
i | size_t |
j | size_t |
Definition at line 993 of file filtering.hpp.
References m_bottom, m_left, NumeRe::Filter::m_windowSize, and validize().
Referenced by apply().
|
inlineprivate |
This method will return the correct value for the bottomright diagonal interval boundary.
i | size_t |
j | size_t |
Definition at line 1011 of file filtering.hpp.
References m_bottom, m_right, NumeRe::Filter::m_windowSize, and validize().
Referenced by apply().
|
inlineprivate |
This method will create the filter's kernel for the selected window size.
Definition at line 856 of file filtering.hpp.
References is2D, m_filterKernel, NumeRe::Filter::m_windowSize, max, and NumeRe::pow2().
Referenced by RetouchRegion().
|
inlineprivate |
This method will return the correct value for the left interval boundary.
i | size_t |
j | size_t |
Definition at line 888 of file filtering.hpp.
References is2D, m_left, and validize().
Referenced by apply(), and setBoundaries().
|
inlineoverridevirtual |
Override for the operator(). Returns the filter kernel at the desired position.
i | size_t |
j | size_t |
Implements NumeRe::Filter.
Definition at line 1076 of file filtering.hpp.
References m_filterKernel, and NumeRe::Filter::m_windowSize.
|
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.
i | size_t |
j | size_t |
val | const mu::value_type& |
med | const mu::value_type& |
Definition at line 1172 of file filtering.hpp.
References apply(), mu::isnan(), and m_fallback.
Referenced by Memory::retouch2D().
|
inlineprivate |
This method will return the correct value for the right interval boundary.
i | size_t |
j | size_t |
Definition at line 905 of file filtering.hpp.
References is2D, m_right, and validize().
Referenced by apply(), and setBoundaries().
|
inline |
This method is used to update the internal filter boundaries.
left | const std::vector<mu::value_type>& |
right | const std::vector<mu::value_type>& |
top | const std::vector<mu::value_type>& |
bottom | const std::vector<mu::value_type>& |
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().
|
inlineprivate |
This method will return the correct value for the top interval boundary.
i | size_t |
j | size_t |
Definition at line 922 of file filtering.hpp.
References is2D, m_top, and validize().
Referenced by apply(), and setBoundaries().
|
inlineprivate |
This method will return the correct value for the topleft diagonal interval boundary.
i | size_t |
j | size_t |
Definition at line 957 of file filtering.hpp.
References m_left, m_top, and validize().
Referenced by apply().
|
inlineprivate |
This method will return the correct value for the topright diagonal interval boundary.
i | size_t |
j | size_t |
Definition at line 975 of file filtering.hpp.
References m_right, m_top, NumeRe::Filter::m_windowSize, and validize().
Referenced by apply().
|
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.
val | 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().
|
private |
Definition at line 844 of file filtering.hpp.
Referenced by apply(), bottom(), createKernel(), left(), RetouchRegion(), right(), and top().
|
private |
Definition at line 843 of file filtering.hpp.
Referenced by bottom(), bottomleft(), bottomright(), and setBoundaries().
|
private |
Definition at line 846 of file filtering.hpp.
Referenced by retouch(), RetouchRegion(), and validize().
|
private |
Definition at line 845 of file filtering.hpp.
Referenced by apply(), createKernel(), operator()(), and ~RetouchRegion().
|
private |
Definition at line 847 of file filtering.hpp.
Referenced by apply(), and RetouchRegion().
|
private |
Definition at line 840 of file filtering.hpp.
Referenced by bottomleft(), left(), setBoundaries(), and topleft().
|
private |
Definition at line 841 of file filtering.hpp.
Referenced by bottomright(), right(), setBoundaries(), and topright().
|
private |
Definition at line 842 of file filtering.hpp.
Referenced by setBoundaries(), top(), topleft(), and topright().