pappso::FilterQuantileBasedRemoveY Class Reference

removes a value found by quantile to all Y values More...

`#include <filterpass.h>`

Inheritance diagram for pappso::FilterQuantileBasedRemoveY:

## Public Member Functions

| FilterQuantileBasedRemoveY (double quantile_threshold)
| FilterQuantileBasedRemoveY (const QString &strBuildParams)
| FilterQuantileBasedRemoveY (const FilterQuantileBasedRemoveY &other)
virtual | ~FilterQuantileBasedRemoveY ()
FilterQuantileBasedRemoveY & | operator= (const FilterQuantileBasedRemoveY &other)
Trace & | filter (Trace &data_points) const override
double | getQuantileThreshold () const
virtual QString | name () const override
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 More...

## Private Attributes

double | m_quantile = 0

## Detailed Description

removes a value found by quantile to all Y values

sort all values by Y intensity and take the iest value located at the defined quantile the use it to remove this value to all Y intensities

Definition at line 257 of file filterpass.h.

## Constructor & Destructor Documentation

## FilterQuantileBasedRemoveY() [1/3]

FilterQuantileBasedRemoveY::FilterQuantileBasedRemoveY | ( | double | quantile_threshold | ) |

Definition at line 501 of file filterpass.cpp.

: m_quantile(quantile)
{
}
pappso::FilterQuantileBasedRemoveY::m_quantile
double m_quantile
Definition: filterpass.h:285

## FilterQuantileBasedRemoveY() [2/3]

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

Parameters

  strBuildParams | string to build the filter "passQuantileBasedRemoveY|0.6"

Definition at line 543 of file filterpass.cpp.

{
buildFilterFromString(strBuildParams);
}
pappso::FilterQuantileBasedRemoveY::buildFilterFromString
void buildFilterFromString(const QString &strBuildParams) override
build this filter using a string
Definition: filterpass.cpp:551

## FilterQuantileBasedRemoveY() [3/3]

FilterQuantileBasedRemoveY::FilterQuantileBasedRemoveY | ( | const FilterQuantileBasedRemoveY & | other | ) |

Definition at line 506 of file filterpass.cpp.

: m_quantile(other.m_quantile)
{
}

## ~FilterQuantileBasedRemoveY()

virtual pappso::FilterQuantileBasedRemoveY::~FilterQuantileBasedRemoveY | ( |  | ) |

inline virtual

Definition at line 269 of file filterpass.h.

{};

## Member Function Documentation

## buildFilterFromString()

void pappso::FilterQuantileBasedRemoveY::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 551 of file filterpass.cpp.

{
//"passQuantileBasedRemoveY|0.6"
qDebug();
if(strBuildParams.startsWith("passQuantileBasedRemoveY|"))
{
QStringList params =
strBuildParams.split("|").back().split(";", Qt::SkipEmptyParts);
QString value = params.at(0);
m_quantile = value.toDouble();
}
else
{
throw pappso::ExceptionNotRecognized(
QString(
"building passQuantileBasedRemoveY from string %1 is not possible")
.arg(strBuildParams));
}
qDebug();
}
pappso::ExceptionNotRecognized
excetion to use when an item type is not recognized
Definition: exceptionnotrecognized.h:42

## filter()

Trace & pappso::FilterQuantileBasedRemoveY::filter | ( | pappso::Trace & | data_points | ) | const

override virtual

Implements pappso::FilterInterface.

Definition at line 526 of file filterpass.cpp.

{
if(data_points.size() == 0)
return data_points;
double value_to_temove =
quantileYTrace(data_points.begin(), data_points.end(), m_quantile);
for(auto &&dataPoint : data_points)
{
if(dataPoint.y < value_to_temove)
dataPoint.y = 0;
else
dataPoint.y = dataPoint.y - value_to_temove;
}
return data_points;
}
pappso::quantileYTrace
double quantileYTrace(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end, double quantile)
calculate the quantile of y value of a trace
Definition: trace.cpp:224

References pappso::quantileYTrace().

## getQuantileThreshold()

double FilterQuantileBasedRemoveY::getQuantileThreshold | ( |  | ) | const

Definition at line 520 of file filterpass.cpp.

{
return m_quantile;
}

References m_quantile.

## name()

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

override virtual

Implements pappso::FilterNameInterface.

Definition at line 576 of file filterpass.cpp.

{
return "passQuantileBasedRemoveY";
}

## operator=()

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

Definition at line 513 of file filterpass.cpp.

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

References m_quantile.

## toString()

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

override virtual

Implements pappso::FilterNameInterface.

Definition at line 583 of file filterpass.cpp.

{
QString strCode = QString("%1|%2").arg(name()).arg(m_quantile);
return strCode;
}
pappso::FilterQuantileBasedRemoveY::name
virtual QString name() const override
Definition: filterpass.cpp:576

## Member Data Documentation

## m_quantile

double pappso::FilterQuantileBasedRemoveY::m_quantile = 0

private

Definition at line 285 of file filterpass.h.

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

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

- pappsomspp/processing/filters/filterpass.h
- pappsomspp/processing/filters/filterpass.cpp