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

Redefines the ceiling intensity of the Trace. More...

`#include <filterceilingamplitudepercentage.h>`

Inheritance diagram for pappso::FilterCeilingAmplitudePercentage:

## Public Member Functions

| FilterCeilingAmplitudePercentage (double percentage)
| FilterCeilingAmplitudePercentage (const QString &parameters)
| FilterCeilingAmplitudePercentage (const FilterCeilingAmplitudePercentage &other)
virtual | ~FilterCeilingAmplitudePercentage ()
FilterCeilingAmplitudePercentage & | operator= (const FilterCeilingAmplitudePercentage &other)
Trace & | filter (Trace &data_points) const override
double | getPercentage () const
QString | name () const override
QString | toString () const override
| Return a string with the textual representation of the configuration data.
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

## Private Attributes

double | m_percentage

## Detailed Description

Redefines the ceiling intensity of the Trace.

The amplitude of the trace is computed (maxValue - minValue) Its fraction is calculated = amplitude * (percentage / 100) The threshold value is computed as (minValue + fraction)

When the values to be filtered are above that threshold they acquire that threshold value.

When the values to be filtered are below that threshold they remain unchanged.

This effectively re-ceilings the values to threshold.

Definition at line 71 of file filterceilingamplitudepercentage.h.

## Constructor & Destructor Documentation

## FilterCeilingAmplitudePercentage() [1/3]

pappso::FilterCeilingAmplitudePercentage::FilterCeilingAmplitudePercentage | ( | double | percentage | ) |

Definition at line 49 of file filterceilingamplitudepercentage.cpp.

{
m_percentage = percentage;
}
pappso::FilterCeilingAmplitudePercentage::m_percentage
double m_percentage
Definition filterceilingamplitudepercentage.h:96

References m_percentage.

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

## FilterCeilingAmplitudePercentage() [2/3]

pappso::FilterCeilingAmplitudePercentage::FilterCeilingAmplitudePercentage | ( | const QString & | parameters | ) |

Definition at line 78 of file filterceilingamplitudepercentage.cpp.

{
buildFilterFromString(parameters);
}
pappso::FilterCeilingAmplitudePercentage::buildFilterFromString
void buildFilterFromString(const QString &strBuildParams) override
build this filter using a string
Definition filterceilingamplitudepercentage.cpp:85

References buildFilterFromString().

## FilterCeilingAmplitudePercentage() [3/3]

pappso::FilterCeilingAmplitudePercentage::FilterCeilingAmplitudePercentage | ( | const FilterCeilingAmplitudePercentage & | other | ) |

Definition at line 55 of file filterceilingamplitudepercentage.cpp.

{
m_percentage = other.m_percentage;
}

References FilterCeilingAmplitudePercentage(), and m_percentage.

## ~FilterCeilingAmplitudePercentage()

pappso::FilterCeilingAmplitudePercentage::~FilterCeilingAmplitudePercentage | ( |  | ) |

virtual

Definition at line 62 of file filterceilingamplitudepercentage.cpp.

{
}

## Member Function Documentation

## buildFilterFromString()

void pappso::FilterCeilingAmplitudePercentage::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 85 of file filterceilingamplitudepercentage.cpp.

{
// Typical string: "CeilingAmplitudePercentage|15"
if(parameters.startsWith(QString("%1|").arg(name())))
{
QStringList params = parameters.split("|").back().split(";");
m_percentage = params.at(0).toDouble();
}
else
{
throw pappso::ExceptionNotRecognized(
QString("Building of FilterCeilingAmplitudePercentage from string %1 failed")
.arg(parameters));
}
}
pappso::FilterCeilingAmplitudePercentage::name
QString name() const override
Definition filterceilingamplitudepercentage.cpp:154

References m_percentage, and name().

Referenced by FilterCeilingAmplitudePercentage().

## filter()

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

override virtual

Implements pappso::FilterInterface.

Definition at line 104 of file filterceilingamplitudepercentage.cpp.

{
auto it_min = minYDataPoint(data_points.begin(), data_points.end());
auto it_max = maxYDataPoint(data_points.begin(), data_points.end());
if(it_min == data_points.end() || it_max == data_points.end())
return data_points;
double min = it_min->y;
double max = it_max->y;
double amplitude = max - min;
double amplitude_ratio = amplitude * m_percentage / 100;
double threshold = min + amplitude_ratio;
// Since we never remove points, we only change their y value, we can do the
// filtering inplace.
for(auto &&data_point : data_points)
{
// Change the value to be threshold (re-ceiling in action).
if(data_point.y > threshold)
{
data_point.y = threshold;
}
}
return data_points;
}
pappso::Enums::XicExtractMethod::max
@ max
maximum of intensities
Definition types.h:280
pappso::Enums::TimeUnit::min
@ min
Definition types.h:87
pappso::maxYDataPoint
std::vector< DataPoint >::const_iterator maxYDataPoint(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
Definition trace.cpp:169
pappso::minYDataPoint
std::vector< DataPoint >::const_iterator minYDataPoint(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
Definition trace.cpp:152

References m_percentage, pappso::maxYDataPoint(), and pappso::minYDataPoint().

## getPercentage()

double pappso::FilterCeilingAmplitudePercentage::getPercentage | ( |  | ) | const

Definition at line 139 of file filterceilingamplitudepercentage.cpp.

{
return m_percentage;
}

References m_percentage.

## name()

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

override virtual

Implements pappso::FilterNameInterface.

Definition at line 154 of file filterceilingamplitudepercentage.cpp.

{
return "CeilingAmplitudePercentage";
}

Referenced by buildFilterFromString(), and toString().

## operator=()

FilterCeilingAmplitudePercentage & pappso::FilterCeilingAmplitudePercentage::operator= | ( | const FilterCeilingAmplitudePercentage & | other | ) |

Definition at line 67 of file filterceilingamplitudepercentage.cpp.

{
if(&other == this)
return *this;
m_percentage = other.m_percentage;
return *this;
}

References FilterCeilingAmplitudePercentage(), and m_percentage.

## toString()

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

override virtual

Return a string with the textual representation of the configuration data.

Implements pappso::FilterNameInterface.

Definition at line 147 of file filterceilingamplitudepercentage.cpp.

{
return QString("%1|%2").arg(name()).arg(QString::number(m_percentage, 'f', 2));
}

References m_percentage, and name().

## Member Data Documentation

## m_percentage

double pappso::FilterCeilingAmplitudePercentage::m_percentage

private

Definition at line 96 of file filterceilingamplitudepercentage.h.

Referenced by FilterCeilingAmplitudePercentage(), FilterCeilingAmplitudePercentage(), buildFilterFromString(), filter(), getPercentage(), operator=(), and toString().

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

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