Loading...
Searching...
No Matches
pappso::FilterMorphoWindowBase Class Referenceabstract

base class that apply a signal treatment based on a window More...

`#include <filtermorpho.h>`

Inheritance diagram for pappso::FilterMorphoWindowBase:

## Public Member Functions

| FilterMorphoWindowBase (std::size_t half_window_size)
| FilterMorphoWindowBase (const FilterMorphoWindowBase &other)
virtual | ~FilterMorphoWindowBase ()
FilterMorphoWindowBase & | operator= (const FilterMorphoWindowBase &other)
virtual Trace & | filter (Trace &data_points) const override
virtual std::size_t | getHalfWindowSize () const
virtual QString | name () const override
virtual QString | toString () const override
Public Member Functions inherited from pappso::FilterNameInterface
virtual | ~FilterNameInterface ()
Public Member Functions inherited from pappso::FilterInterface
virtual | ~FilterInterface ()

## Protected Member Functions

void | buildFilterFromString (const QString &strBuildParams) override
| build this filter using a string
virtual double | getWindowValue (std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end) const =0

## Protected Attributes

std::size_t | m_halfWindowSize = 0

## Detailed Description

base class that apply a signal treatment based on a window

Definition at line 40 of file filtermorpho.h.

## Constructor & Destructor Documentation

## FilterMorphoWindowBase() [1/2]

FilterMorphoWindowBase::FilterMorphoWindowBase | ( | std::size_t | half_window_size | ) |

Definition at line 36 of file filtermorpho.cpp.

: m_halfWindowSize(half_window_size)
{
}
pappso::FilterMorphoWindowBase::m_halfWindowSize
std::size_t m_halfWindowSize
Definition filtermorpho.h:66

References m_halfWindowSize.

Referenced by pappso::FilterMorphoMax::FilterMorphoMax(), pappso::FilterMorphoMax::FilterMorphoMax(), pappso::FilterMorphoMean::FilterMorphoMean(), pappso::FilterMorphoMean::FilterMorphoMean(), pappso::FilterMorphoMean::FilterMorphoMean(), pappso::FilterMorphoMedian::FilterMorphoMedian(), pappso::FilterMorphoMedian::FilterMorphoMedian(), pappso::FilterMorphoMin::FilterMorphoMin(), pappso::FilterMorphoMin::FilterMorphoMin(), pappso::FilterMorphoSum::FilterMorphoSum(), pappso::FilterMorphoSum::FilterMorphoSum(), FilterMorphoWindowBase(), and operator=().

## FilterMorphoWindowBase() [2/2]

FilterMorphoWindowBase::FilterMorphoWindowBase | ( | const FilterMorphoWindowBase & | other | ) |

Definition at line 40 of file filtermorpho.cpp.

: m_halfWindowSize(other.m_halfWindowSize)
{
}

References FilterMorphoWindowBase(), and m_halfWindowSize.

## ~FilterMorphoWindowBase()

virtual pappso::FilterMorphoWindowBase::~FilterMorphoWindowBase | ( |  | ) |

inline virtual

Definition at line 46 of file filtermorpho.h.

{};

## Member Function Documentation

## buildFilterFromString()

void pappso::FilterMorphoWindowBase::buildFilterFromString | ( | const QString & | strBuildParams | ) |

override protected virtual

build this filter using a string

Parameters

  strBuildParams | a string coding the filter and its parameters "filterName|param1;param2;param3"

Implements pappso::FilterNameInterface.

Definition at line 59 of file filtermorpho.cpp.

{
}

## filter()

Trace & FilterMorphoWindowBase::filter | ( | Trace & | data_points | ) | const

override virtual

Implements pappso::FilterInterface.

Definition at line 78 of file filtermorpho.cpp.

{
qDebug() << " " << m_halfWindowSize << " data_points.size()" << data_points.size();
if(m_halfWindowSize == 0)
return data_points;
if(data_points.size() <= m_halfWindowSize)
return data_points;
Trace old_trace(data_points);
auto it = old_trace.begin();
auto itend = old_trace.end() - m_halfWindowSize - 1;
auto it_target = data_points.begin();
std::size_t loop_begin = 0;
while((it != itend) && (loop_begin < m_halfWindowSize))
{
// maxYDataPoint(it_begin, it + m_halfWindowSize + 1);
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
// << it->x << " " << m_halfWindowSize;
// it_target->x = it->x;
it_target->y = getWindowValue(old_trace.begin(), it + m_halfWindowSize + 1);
it++;
it_target++;
loop_begin++;
}
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
while(it != itend)
{
// it_target->x = it->x;
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
// << it->x;
it_target->y = getWindowValue(it - m_halfWindowSize, it + m_halfWindowSize + 1);
it++;
it_target++;
}
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
while(it != old_trace.end())
{
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__ << " "
// << it->x;
// it_target->x = it->x;
it_target->y = getWindowValue(it - m_halfWindowSize, old_trace.end());
it++;
it_target++;
}
// qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
// problem with move or swap : this lead to segmentation faults in some cases
// data_points = std::move(new_trace);
qDebug();
return data_points;
}
pappso::FilterMorphoWindowBase::getWindowValue
virtual double getWindowValue(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end) const =0

References getWindowValue(), and m_halfWindowSize.

Referenced by pappso::masschroq::CborOutputStream::writeMsRunRetentionTime().

## getHalfWindowSize()

std::size_t FilterMorphoWindowBase::getHalfWindowSize | ( |  | ) | const

virtual

Definition at line 45 of file filtermorpho.cpp.

{
return m_halfWindowSize;
}

References m_halfWindowSize.

Referenced by pappso::FilterMorphoBackground::FilterMorphoBackground(), and pappso::FilterMorphoBackground::operator=().

## getWindowValue()

virtual double pappso::FilterMorphoWindowBase::getWindowValue | ( | std::vector< DataPoint >::const_iterator | begin,
|  | std::vector< DataPoint >::const_iterator | end ) const

protected pure virtual

Implemented in pappso::FilterMorphoMax, pappso::FilterMorphoMean, pappso::FilterMorphoMedian, pappso::FilterMorphoMin, and pappso::FilterMorphoSum.

Referenced by filter().

## name()

QString pappso::FilterMorphoWindowBase::name | ( |  | ) | const

override virtual

Implements pappso::FilterNameInterface.

Reimplemented in pappso::FilterMorphoMean.

Definition at line 65 of file filtermorpho.cpp.

{
return "nose";
}

## operator=()

FilterMorphoWindowBase & FilterMorphoWindowBase::operator= | ( | const FilterMorphoWindowBase & | other | ) |

Definition at line 51 of file filtermorpho.cpp.

{
m_halfWindowSize = other.m_halfWindowSize;
return *this;
}

References FilterMorphoWindowBase(), and m_halfWindowSize.

## toString()

QString pappso::FilterMorphoWindowBase::toString | ( |  | ) | const

override virtual

Implements pappso::FilterNameInterface.

Reimplemented in pappso::FilterMorphoMean.

Definition at line 71 of file filtermorpho.cpp.

{
return "nose";
}

## Member Data Documentation

## m_halfWindowSize

std::size_t pappso::FilterMorphoWindowBase::m_halfWindowSize = 0

protected

Definition at line 66 of file filtermorpho.h.

Referenced by pappso::FilterMorphoMax::FilterMorphoMax(), pappso::FilterMorphoMean::FilterMorphoMean(), pappso::FilterMorphoMedian::FilterMorphoMedian(), pappso::FilterMorphoMin::FilterMorphoMin(), pappso::FilterMorphoSum::FilterMorphoSum(), FilterMorphoWindowBase(), FilterMorphoWindowBase(), pappso::FilterMorphoMean::buildFilterFromString(), filter(), getHalfWindowSize(), pappso::FilterMorphoMax::operator=(), pappso::FilterMorphoMean::operator=(), pappso::FilterMorphoMedian::operator=(), pappso::FilterMorphoMin::operator=(), pappso::FilterMorphoSum::operator=(), operator=(), and pappso::FilterMorphoMean::toString().

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

- pappsomspp/core/processing/filters/filtermorpho.h
- pappsomspp/core/processing/filters/filtermorpho.cpp