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

`#include <filterresample.h>`

Inheritance diagram for pappso::FilterResampleKeepPointInPolygon:

## Public Member Functions

| FilterResampleKeepPointInPolygon ()
| FilterResampleKeepPointInPolygon (IntegrationScopeBaseSPtr integration_scope_sp, DataKind data_kind)
| FilterResampleKeepPointInPolygon (const IntegrationScopeSpecVector &integration_scope_specs)
| FilterResampleKeepPointInPolygon (const FilterResampleKeepPointInPolygon &other)
virtual | ~FilterResampleKeepPointInPolygon ()
void | newSelectionPolygonSpec (const IntegrationScopeSpec &integration_scope_spec)
FilterResampleKeepPointInPolygon & | operator= (const FilterResampleKeepPointInPolygon &other)
Trace & | filter (Trace &trace) const override
Trace & | filter (Trace &trace, double dt_value, double rt_value) const
virtual Trace & | filter (Trace &data_points) const=0
Public Member Functions inherited from pappso::FilterInterface
virtual | ~FilterInterface ()

## Private Attributes

IntegrationScopeSpecVector | m_integrationScopeSpecs
double | m_lowestMz = std::numeric_limits<double>::max()
double | m_greatestMz = std::numeric_limits<double>::min()

## Detailed Description

Definition at line 107 of file filterresample.h.

## Constructor & Destructor Documentation

## FilterResampleKeepPointInPolygon() [1/4]

pappso::FilterResampleKeepPointInPolygon::FilterResampleKeepPointInPolygon | ( |  | ) |

Definition at line 244 of file filterresample.cpp.

{
}

## FilterResampleKeepPointInPolygon() [2/4]

pappso::FilterResampleKeepPointInPolygon::FilterResampleKeepPointInPolygon | ( | IntegrationScopeBaseSPtr | integration_scope_sp,
|  | DataKind | data_kind
| ) |  |

Definition at line 249 of file filterresample.cpp.

{
m_integrationScopeSpecs.push_back(
IntegrationScopeSpec(integration_scope_sp, data_kind));
QPointF point;
if(!m_integrationScopeSpecs.front().integrationScopeSPtr->getPoint(point))
qFatal("Failed to get point.");
m_lowestMz = point.y();
double height;
if(!m_integrationScopeSpecs.front().integrationScopeSPtr->getHeight(height))
qFatal("Failed to get height.");
m_greatestMz = m_lowestMz + height;
}
pappso::FilterResampleKeepPointInPolygon::m_lowestMz
double m_lowestMz
Definition filterresample.h:136
pappso::FilterResampleKeepPointInPolygon::m_greatestMz
double m_greatestMz
Definition filterresample.h:137
pappso::FilterResampleKeepPointInPolygon::m_integrationScopeSpecs
IntegrationScopeSpecVector m_integrationScopeSpecs
Definition filterresample.h:135

References m_greatestMz, m_integrationScopeSpecs, and m_lowestMz.

## FilterResampleKeepPointInPolygon() [3/4]

pappso::FilterResampleKeepPointInPolygon::FilterResampleKeepPointInPolygon | ( | const IntegrationScopeSpecVector & | integration_scope_specs | ) |

Definition at line 267 of file filterresample.cpp.

{
// qDebug();
m_integrationScopeSpecs.assign(integration_scope_specs.begin(),
integration_scope_specs.end());
for(auto &&item : m_integrationScopeSpecs)
{
if(item.integrationScopeSPtr->isRectangle())
{
// qDebug() << "item is Rectangle.";
QPointF point;
if(!item.integrationScopeSPtr->getPoint(point))
qFatal("Failed to get point.");
m_lowestMz = std::min(m_lowestMz, point.y());
double height;
if(!item.integrationScopeSPtr->getHeight(height))
qFatal("Failed to get height.");
m_greatestMz = std::max(m_greatestMz, m_lowestMz + height);
}
else
{
if(!item.integrationScopeSPtr->isRhomboid())
qFatal(
"If integration scope is not Rectangle, then it must be "
"Rhomboid.");
// qDebug() << "item is Rhomboid.";
QPointF point;
// Because the mz scale is on the coordinate, we ask for
// bottom-most and top-most points of the rhomboid polygon.
if(!item.integrationScopeSPtr->getBottomMostPoint(point))
qFatal("Failed to get point.");
m_lowestMz = std::min(m_lowestMz, point.y());
if(!item.integrationScopeSPtr->getTopMostPoint(point))
qFatal("Failed to get point.");
m_greatestMz = std::max(m_greatestMz, point.y());
}
}
}

References m_greatestMz, m_integrationScopeSpecs, and m_lowestMz.

## FilterResampleKeepPointInPolygon() [4/4]

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

Definition at line 317 of file filterresample.cpp.

{
// qDebug();
m_integrationScopeSpecs.assign(other.m_integrationScopeSpecs.begin(),
other.m_integrationScopeSpecs.end());
for(auto &&item : m_integrationScopeSpecs)
{
QPointF point;
if(!item.integrationScopeSPtr->getPoint(point))
qFatal("Failed to get point.");
m_lowestMz = std::min(m_lowestMz, point.y());
double height;
if(!item.integrationScopeSPtr->getHeight(height))
qFatal("Failed to get height.");
m_greatestMz = std::max(m_greatestMz, m_lowestMz + height);
}
}

References m_greatestMz, m_integrationScopeSpecs, and m_lowestMz.

## ~FilterResampleKeepPointInPolygon()

virtual pappso::FilterResampleKeepPointInPolygon::~FilterResampleKeepPointInPolygon | ( |  | ) |

inline virtual

Definition at line 121 of file filterresample.h.

{};

## Member Function Documentation

## filter() [1/3]

virtual Trace & pappso::FilterInterface::filter | ( | Trace & | data_points | ) | const

virtual

Implements pappso::FilterInterface.

## filter() [2/3]

Trace & pappso::FilterResampleKeepPointInPolygon::filter | ( | Trace & | trace | ) | const

override virtual

Implements pappso::FilterInterface.

Definition at line 377 of file filterresample.cpp.

{
qFatal("Programming error.");
return trace;
}

## filter() [3/3]

Trace & pappso::FilterResampleKeepPointInPolygon::filter | ( | Trace & | trace,
|  | double | dt_value,
|  | double | rt_value
| ) |  | const

Definition at line 385 of file filterresample.cpp.

{
// Each time a new integration scope spec is added, the lowest and greatest
// m/z values are computed. We use these values to remove from the spectrum
// all the points that are outside of that lowest-gratest range.
// Find the iterator to the most front of the DataPoint vector (mass
// spectrum).
// Note that the m_lowestMz and m_greatestMz are set during construction of
// this FilterResampleKeepPointInPolygon filter using the
// integration scope specs.
// qDebug() << "The lowest and greatest m/z values:" << m_lowestMz << "and"
//<< m_greatestMz;
// Start by filtering away all the data points outside of the
// [m_lowestMz--m_greatestMz] range.
FilterResampleKeepXRange the_filter(m_lowestMz, m_greatestMz);
trace = the_filter.filter(trace);
// Now iterate in all the data points remaining in the trace and for each
// point craft a "virtual" point using the dt|rt value and the m/z value of
// the data point (data_point.x).
auto begin_it = trace.begin();
auto end_it = trace.end();
// qDebug() << "Iterating in the m/z range:" << begin_it->x << "-"
//<< std::prev(end_it)->x;
// Start at the end of the range. The iter is outside of the requested range,
// in fact, as shown using iter-- below.
auto iter = end_it;
while(iter > begin_it)
{
// Immediately go to the last data point of the desired iteration range of
// the trace that we need to filter. Remember that end() is not pointing
// to any vector item, but past the last one.
iter--;
// qDebug() << "Iterating in trace data point with m/z value:" << iter->x;
// Now that we have the m/z value, we can check it, in combination with
// the value in the selection polygon spec (to make a point) against the
// various selection polygon specs in our member vector.
double checked_value;
for(auto &&spec : m_integrationScopeSpecs)
{
// qDebug() << "Iterating in selection polygon spec:" <<
// spec.toString();
if(spec.dataKind == DataKind::dt)
{
if(dt_value == -1)
qFatal("Programming error.");
checked_value = dt_value;
// qDebug() << "The data kind: dt.";
}
else if(spec.dataKind == DataKind::rt)
{
checked_value = rt_value;
// qDebug() << "The data kind: rt.";
}
else
qFatal("Programming error.");
// First version doing the whole computation on the basis of the
// selection polygon's all faces.
//
if(!spec.integrationScopeSPtr->contains(
QPointF(checked_value, iter->x)))
iter = trace.erase(iter);
}
// End of
// for(auto &&spec : m_selectionPolygonSpecs)
}
// End of
// while(iter > begin_it)
return trace;
}
pappso::DataKind::dt
@ dt
Drift time.
pappso::DataKind::rt
@ rt
Retention time.

References pappso::dt, pappso::FilterResampleKeepXRange::filter(), m_greatestMz, m_integrationScopeSpecs, m_lowestMz, and pappso::rt.

## newSelectionPolygonSpec()

void pappso::FilterResampleKeepPointInPolygon::newSelectionPolygonSpec | ( | const IntegrationScopeSpec & | integration_scope_spec | ) |

Definition at line 341 of file filterresample.cpp.

{
m_integrationScopeSpecs.push_back(integration_scope_spec);
QPointF point;
if(!m_integrationScopeSpecs.back().integrationScopeSPtr->getPoint(point))
qFatal("Failed to get point.");
m_lowestMz = std::min(m_lowestMz, point.y());
double height;
if(!m_integrationScopeSpecs.back().integrationScopeSPtr->getHeight(height))
qFatal("Failed to get height.");
m_greatestMz = std::max(m_greatestMz, m_lowestMz + height);
}

References m_greatestMz, m_integrationScopeSpecs, and m_lowestMz.

## operator=()

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

Definition at line 360 of file filterresample.cpp.

{
if(this == &other)
return *this;
m_integrationScopeSpecs.assign(other.m_integrationScopeSpecs.begin(),
other.m_integrationScopeSpecs.end());
m_lowestMz = other.m_lowestMz;
m_greatestMz = other.m_greatestMz;
return *this;
}

References m_greatestMz, m_integrationScopeSpecs, and m_lowestMz.

## Member Data Documentation

## m_greatestMz

double pappso::FilterResampleKeepPointInPolygon::m_greatestMz = std::numeric_limits<double>::min()

private

Definition at line 137 of file filterresample.h.

Referenced by FilterResampleKeepPointInPolygon(), FilterResampleKeepPointInPolygon(), FilterResampleKeepPointInPolygon(), filter(), newSelectionPolygonSpec(), and operator=().

## m_integrationScopeSpecs

IntegrationScopeSpecVector pappso::FilterResampleKeepPointInPolygon::m_integrationScopeSpecs

private

Definition at line 135 of file filterresample.h.

Referenced by FilterResampleKeepPointInPolygon(), FilterResampleKeepPointInPolygon(), FilterResampleKeepPointInPolygon(), filter(), newSelectionPolygonSpec(), and operator=().

## m_lowestMz

double pappso::FilterResampleKeepPointInPolygon::m_lowestMz = std::numeric_limits<double>::max()

private

Definition at line 136 of file filterresample.h.

Referenced by FilterResampleKeepPointInPolygon(), FilterResampleKeepPointInPolygon(), FilterResampleKeepPointInPolygon(), filter(), newSelectionPolygonSpec(), and operator=().

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

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