Loading...
Searching...
No Matches
pappso::FilterMorphoBackground Class Reference

compute background of a trace compute background noise on a trace More...

`#include <filtermorpho.h>`

Inheritance diagram for pappso::FilterMorphoBackground:

## Public Member Functions

| FilterMorphoBackground (const QString &strBuildParams)
| FilterMorphoBackground (std::size_t median_half_window_size, std::size_t minmax_half_window_size)
| FilterMorphoBackground (const FilterMorphoBackground &other)
virtual | ~FilterMorphoBackground ()
FilterMorphoBackground & | operator= (const FilterMorphoBackground &other)
const FilterMorphoMedian & | getFilterMorphoMedian () const
const FilterMorphoMinMax & | getFilterMorphoMinMax () const
Trace & | filter (Trace &data_points) const override
void | buildFilterFromString (const QString &strBuildParams) override
| build this filter using a string
QString | toString () const override
QString | name () const override
Public Member Functions inherited from pappso::FilterNameInterface
virtual | ~FilterNameInterface ()
Public Member Functions inherited from pappso::FilterInterface
virtual | ~FilterInterface ()

## Private Attributes

FilterMorphoMedian * | mpa_filterMorphoMedian = nullptr
FilterMorphoMinMax * | mpa_filterMorphoMinMax = nullptr

## Detailed Description

compute background of a trace compute background noise on a trace

Definition at line 249 of file filtermorpho.h.

## Constructor & Destructor Documentation

## FilterMorphoBackground() [1/3]

pappso::FilterMorphoBackground::FilterMorphoBackground | ( | const QString & | strBuildParams | ) |

Definition at line 471 of file filtermorpho.cpp.

{
buildFilterFromString(strBuildParams);
}
pappso::FilterMorphoBackground::buildFilterFromString
void buildFilterFromString(const QString &strBuildParams) override
build this filter using a string
Definition filtermorpho.cpp:494

References buildFilterFromString().

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

## FilterMorphoBackground() [2/3]

FilterMorphoBackground::FilterMorphoBackground | ( | std::size_t | median_half_window_size,
|  | std::size_t | minmax_half_window_size )

Definition at line 476 of file filtermorpho.cpp.

{
mpa_filterMorphoMedian = new FilterMorphoMedian(median_half_window_size);
mpa_filterMorphoMinMax = new FilterMorphoMinMax(minmax_half_window_size);
}
pappso::FilterMorphoBackground::mpa_filterMorphoMedian
FilterMorphoMedian * mpa_filterMorphoMedian
Definition filtermorpho.h:272
pappso::FilterMorphoBackground::mpa_filterMorphoMinMax
FilterMorphoMinMax * mpa_filterMorphoMinMax
Definition filtermorpho.h:273

References mpa_filterMorphoMedian, and mpa_filterMorphoMinMax.

## FilterMorphoBackground() [3/3]

FilterMorphoBackground::FilterMorphoBackground | ( | const FilterMorphoBackground & | other | ) |

Definition at line 484 of file filtermorpho.cpp.

{
mpa_filterMorphoMedian =
new FilterMorphoMedian(other.mpa_filterMorphoMedian->getHalfWindowSize());
mpa_filterMorphoMinMax =
new FilterMorphoMinMax(other.mpa_filterMorphoMinMax->getMinMaxHalfEdgeWindows());
}
pappso::FilterMorphoMinMax::getMinMaxHalfEdgeWindows
std::size_t getMinMaxHalfEdgeWindows() const
Definition filtermorpho.cpp:235
pappso::FilterMorphoWindowBase::getHalfWindowSize
virtual std::size_t getHalfWindowSize() const
Definition filtermorpho.cpp:45

References FilterMorphoBackground(), pappso::FilterMorphoWindowBase::getHalfWindowSize(), pappso::FilterMorphoMinMax::getMinMaxHalfEdgeWindows(), mpa_filterMorphoMedian, and mpa_filterMorphoMinMax.

## ~FilterMorphoBackground()

pappso::FilterMorphoBackground::~FilterMorphoBackground | ( |  | ) |

virtual noexcept

Definition at line 567 of file filtermorpho.cpp.

{
delete mpa_filterMorphoMedian;
delete mpa_filterMorphoMinMax;
}

References mpa_filterMorphoMedian, and mpa_filterMorphoMinMax.

## Member Function Documentation

## buildFilterFromString()

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

override 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 494 of file filtermorpho.cpp.

{
if(strBuildParams.startsWith(QString("%1|").arg(name())))
{
QStringList params = strBuildParams.split("|").back().split(";");
mpa_filterMorphoMedian = new FilterMorphoMedian(params.at(0).toDouble());
mpa_filterMorphoMinMax = new FilterMorphoMinMax(params.at(1).toDouble());
}
else
{
throw pappso::ExceptionNotRecognized(
QString("Building of FilterMorphoBackground from string %1 failed").arg(strBuildParams));
}
}
pappso::FilterMorphoBackground::name
QString name() const override
Definition filtermorpho.cpp:523

References mpa_filterMorphoMedian, mpa_filterMorphoMinMax, and name().

Referenced by FilterMorphoBackground().

## filter()

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

override virtual

Implements pappso::FilterInterface.

Definition at line 541 of file filtermorpho.cpp.

{
mpa_filterMorphoMedian->filter(data_points);
mpa_filterMorphoMinMax->filter(data_points);
// finally filter negative values
for(DataPoint &point : data_points)
{
if(point.y < 0)
{
point.y = 0;
}
}
return data_points;
}

References mpa_filterMorphoMedian, and mpa_filterMorphoMinMax.

## getFilterMorphoMedian()

const FilterMorphoMedian & FilterMorphoBackground::getFilterMorphoMedian | ( |  | ) | const

Definition at line 557 of file filtermorpho.cpp.

{
return *mpa_filterMorphoMedian;
}

References mpa_filterMorphoMedian.

## getFilterMorphoMinMax()

const FilterMorphoMinMax & FilterMorphoBackground::getFilterMorphoMinMax | ( |  | ) | const

Definition at line 562 of file filtermorpho.cpp.

{
return *mpa_filterMorphoMinMax;
}

References mpa_filterMorphoMinMax.

## name()

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

override virtual

Implements pappso::FilterNameInterface.

Definition at line 523 of file filtermorpho.cpp.

{
return "morphoBackground";
}

Referenced by buildFilterFromString().

## operator=()

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

Definition at line 529 of file filtermorpho.cpp.

{
mpa_filterMorphoMedian =
new FilterMorphoMedian(other.mpa_filterMorphoMedian->getHalfWindowSize());
mpa_filterMorphoMinMax =
new FilterMorphoMinMax(other.mpa_filterMorphoMinMax->getMinMaxHalfEdgeWindows());
return *this;
}

References FilterMorphoBackground(), pappso::FilterMorphoWindowBase::getHalfWindowSize(), pappso::FilterMorphoMinMax::getMinMaxHalfEdgeWindows(), mpa_filterMorphoMedian, and mpa_filterMorphoMinMax.

## toString()

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

override virtual

Implements pappso::FilterNameInterface.

Definition at line 513 of file filtermorpho.cpp.

{
QString strCode = QString("morphoBackground|%1;%2")
.arg(mpa_filterMorphoMedian->getHalfWindowSize())
.arg(mpa_filterMorphoMinMax->getMinMaxHalfEdgeWindows());
return strCode;
}

References mpa_filterMorphoMedian, and mpa_filterMorphoMinMax.

## Member Data Documentation

## mpa_filterMorphoMedian

FilterMorphoMedian* pappso::FilterMorphoBackground::mpa_filterMorphoMedian = nullptr

private

Definition at line 272 of file filtermorpho.h.

Referenced by FilterMorphoBackground(), FilterMorphoBackground(), ~FilterMorphoBackground(), buildFilterFromString(), filter(), getFilterMorphoMedian(), operator=(), and toString().

## mpa_filterMorphoMinMax

FilterMorphoMinMax* pappso::FilterMorphoBackground::mpa_filterMorphoMinMax = nullptr

private

Definition at line 273 of file filtermorpho.h.

Referenced by FilterMorphoBackground(), FilterMorphoBackground(), ~FilterMorphoBackground(), buildFilterFromString(), filter(), getFilterMorphoMinMax(), operator=(), and toString().

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

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