libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::FilterMorphoMean Class Reference

mean filter apply mean of y values inside the window : this results in a kind of smoothing More...

#include <filtermorpho.h>

Inheritance diagram for pappso::FilterMorphoMean:
pappso::FilterMorphoWindowBase pappso::FilterNameInterface pappso::FilterInterface

Public Member Functions

 FilterMorphoMean (const QString &strBuildParams)
 
 FilterMorphoMean (std::size_t half_window_size)
 
 FilterMorphoMean (const FilterMorphoMean &other)
 
virtual ~FilterMorphoMean ()
 
FilterMorphoMeanoperator= (const FilterMorphoMean &other)
 
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::FilterMorphoWindowBase
 FilterMorphoWindowBase (std::size_t half_window_size)
 
 FilterMorphoWindowBase (const FilterMorphoWindowBase &other)
 
virtual ~FilterMorphoWindowBase ()
 
FilterMorphoWindowBaseoperator= (const FilterMorphoWindowBase &other)
 
virtual Tracefilter (Trace &data_points) const override
 
virtual std::size_t getHalfWindowSize () const
 
- Public Member Functions inherited from pappso::FilterNameInterface
virtual ~FilterNameInterface ()
 
- Public Member Functions inherited from pappso::FilterInterface
virtual ~FilterInterface ()
 

Protected Member Functions

double getWindowValue (std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end) const override
 
- Protected Member Functions inherited from pappso::FilterMorphoWindowBase
void buildFilterFromString (const QString &strBuildParams) override
 build this filter using a string
 

Additional Inherited Members

- Protected Attributes inherited from pappso::FilterMorphoWindowBase
std::size_t m_halfWindowSize = 0
 

Detailed Description

mean filter apply mean of y values inside the window : this results in a kind of smoothing

Definition at line 224 of file filtermorpho.h.

Constructor & Destructor Documentation

◆ FilterMorphoMean() [1/3]

pappso::FilterMorphoMean::FilterMorphoMean ( const QString & strBuildParams)

Definition at line 463 of file filtermorpho.cpp.

465{
466 buildFilterFromString(strBuildParams);
467}
void buildFilterFromString(const QString &strBuildParams) override
build this filter using a string
FilterMorphoWindowBase(std::size_t half_window_size)

References pappso::FilterMorphoWindowBase::FilterMorphoWindowBase(), and buildFilterFromString().

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

◆ FilterMorphoMean() [2/3]

FilterMorphoMean::FilterMorphoMean ( std::size_t half_window_size)

Definition at line 439 of file filtermorpho.cpp.

440 : FilterMorphoWindowBase(half_window_size)
441{
442}

References pappso::FilterMorphoWindowBase::FilterMorphoWindowBase().

◆ FilterMorphoMean() [3/3]

◆ ~FilterMorphoMean()

virtual pappso::FilterMorphoMean::~FilterMorphoMean ( )
inlinevirtual

Definition at line 231 of file filtermorpho.h.

231{};

Member Function Documentation

◆ buildFilterFromString()

void pappso::FilterMorphoMean::buildFilterFromString ( const QString & strBuildParams)
overridevirtual

build this filter using a string

Parameters
strBuildParamsa string coding the filter and its parameters "filterName|param1;param2;param3"

Implements pappso::FilterNameInterface.

Definition at line 393 of file filtermorpho.cpp.

394{
395 if(strBuildParams.startsWith(QString("%1|").arg(name())))
396 {
397 QStringList params = strBuildParams.split("|").back().split(";");
398
399 m_halfWindowSize = params.at(0).toDouble();
400 }
401 else
402 {
403 throw pappso::ExceptionNotRecognized(
404 QString("Building of FilterMorphoMean from string %1 failed").arg(strBuildParams));
405 }
406}
QString name() const override

References pappso::FilterMorphoWindowBase::m_halfWindowSize, and name().

Referenced by FilterMorphoMean().

◆ getWindowValue()

double FilterMorphoMean::getWindowValue ( std::vector< DataPoint >::const_iterator begin,
std::vector< DataPoint >::const_iterator end ) const
overrideprotectedvirtual

Implements pappso::FilterMorphoWindowBase.

Definition at line 457 of file filtermorpho.cpp.

459{
460 return meanYTrace(begin, end);
461}
double meanYTrace(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
calculate the mean of y value of a trace
Definition trace.cpp:239

References pappso::meanYTrace().

◆ name()

QString pappso::FilterMorphoMean::name ( ) const
overridevirtual

Reimplemented from pappso::FilterMorphoWindowBase.

Definition at line 417 of file filtermorpho.cpp.

418{
419 return "morphoMean";
420}

Referenced by buildFilterFromString(), and toString().

◆ operator=()

FilterMorphoMean & FilterMorphoMean::operator= ( const FilterMorphoMean & other)

Definition at line 449 of file filtermorpho.cpp.

450{
452
453 return *this;
454}

References FilterMorphoMean(), and pappso::FilterMorphoWindowBase::m_halfWindowSize.

◆ toString()

QString pappso::FilterMorphoMean::toString ( ) const
overridevirtual

Reimplemented from pappso::FilterMorphoWindowBase.

Definition at line 409 of file filtermorpho.cpp.

410{
411 QString strCode = QString("%1|%2").arg(name()).arg(m_halfWindowSize);
412
413 return strCode;
414}

References pappso::FilterMorphoWindowBase::m_halfWindowSize, and name().


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