libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::SavGolParams Struct Reference

Parameters for the Savitzky-Golay filter. More...

#include <savgolfilter.h>

Public Member Functions

 SavGolParams ()
 
 SavGolParams (const SavGolParams &other)
 
 SavGolParams (int nLParam, int nRParam, int mParam, int lDParam, bool convolveWithNrParam)
 
void initialize (int nLParam, int nRParam, int mParam, int lDParam, bool convolveWithNrParam)
 
void initialize (const SavGolParams &other)
 
void initialize (const QString &parameters)
 
QString toString () const
 

Public Attributes

int nL = 15
 number of data points on the left of the filtered point
 
int nR = 15
 number of data points on the right of the filtered point
 
int m = 4
 
int lD = 0
 
bool convolveWithNr = false
 set to false for best results
 

Detailed Description

Parameters for the Savitzky-Golay filter.

Definition at line 49 of file savgolfilter.h.

Constructor & Destructor Documentation

◆ SavGolParams() [1/3]

pappso::SavGolParams::SavGolParams ( )
inline

Definition at line 64 of file savgolfilter.h.

64{};

◆ SavGolParams() [2/3]

pappso::SavGolParams::SavGolParams ( const SavGolParams & other)
inline

Definition at line 66 of file savgolfilter.h.

67 : nL{other.nL},
68 nR{other.nR},
69 m{other.m},
70 lD{other.lD},
71 convolveWithNr{other.convolveWithNr}
72 {
73 }
int nR
number of data points on the right of the filtered point
int nL
number of data points on the left of the filtered point
bool convolveWithNr
set to false for best results

◆ SavGolParams() [3/3]

pappso::SavGolParams::SavGolParams ( int nLParam,
int nRParam,
int mParam,
int lDParam,
bool convolveWithNrParam )
inline

Definition at line 75 of file savgolfilter.h.

77 {
78 nL = nLParam;
79 nR = nRParam;
80 m = mParam;
81 lD = lDParam;
82 convolveWithNr = convolveWithNrParam;
83 }

Member Function Documentation

◆ initialize() [1/3]

void pappso::SavGolParams::initialize ( const QString & parameters)
inline

Definition at line 107 of file savgolfilter.h.

108 {
109 // Typical string: "15;15;4;0;false"
110
111 QStringList params_list = parameters.split(";");
112
113 nL = params_list.at(0).toInt();
114 nR = params_list.at(1).toInt();
115 m = params_list.at(2).toInt();
116 lD = params_list.at(3).toInt();
117 convolveWithNr = (params_list.at(4) == "true" ? true : false);
118 }

◆ initialize() [2/3]

void pappso::SavGolParams::initialize ( const SavGolParams & other)
inline

Definition at line 97 of file savgolfilter.h.

98 {
99 nL = other.nL;
100 nR = other.nR;
101 m = other.m;
102 lD = other.lD;
103 convolveWithNr = other.convolveWithNr;
104 }

References convolveWithNr, lD, m, nL, and nR.

◆ initialize() [3/3]

void pappso::SavGolParams::initialize ( int nLParam,
int nRParam,
int mParam,
int lDParam,
bool convolveWithNrParam )
inline

Definition at line 86 of file savgolfilter.h.

88 {
89 nL = nLParam;
90 nR = nRParam;
91 m = mParam;
92 lD = lDParam;
93 convolveWithNr = convolveWithNrParam;
94 }

◆ toString()

QString pappso::SavGolParams::toString ( ) const
inline

Definition at line 121 of file savgolfilter.h.

122 {
123 // Typical string: "15;15;4;0;false"
124 return QString("%1;%2;%3;%4;%5")
125 .arg(QString::number(nL))
126 .arg(QString::number(nR))
127 .arg(QString::number(m))
128 .arg(QString::number(lD))
129 .arg(convolveWithNr ? "true" : "false");
130 }

Referenced by pappso::FilterSavitzkyGolay::toString().

Member Data Documentation

◆ convolveWithNr

◆ lD

◆ m

◆ nL

◆ nR


The documentation for this struct was generated from the following file: