pappsomspp
Library for mass spectrometry
filterpass.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/filers/filterpass.h
3  * \date 26/04/2019
4  * \author Olivier Langella
5  * \brief collection of filters concerned by Y selection
6  */
7 
8 /*******************************************************************************
9  * Copyright (c) 2019 Olivier Langella <Olivier.Langella@u-psud.fr>.
10  *
11  * This file is part of the PAPPSOms++ library.
12  *
13  * PAPPSOms++ is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * PAPPSOms++ is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25  *
26  ******************************************************************************/
27 
28 #pragma once
29 
30 #include "filterinterface.h"
31 #include <cstddef>
32 #include "../../exportinmportconfig.h"
33 
34 
35 namespace pappso
36 {
37 
38 class PMSPP_LIB_DECL FilterLowPass : public FilterInterface
39 {
40  private:
41  double m_y_pass = 0;
42 
43  public:
44  FilterLowPass(double y_pass);
45  FilterLowPass(const FilterLowPass &other);
46  virtual ~FilterLowPass(){};
47  Trace &filter(Trace &data_points) const override;
48 };
49 
50 class PMSPP_LIB_DECL FilterHighPass : public FilterInterface
51 {
52  private:
53  double m_y_pass = 0;
54 
55  public:
56  FilterHighPass(double y_pass);
57  FilterHighPass(const FilterHighPass &other);
58  virtual ~FilterHighPass(){};
59  Trace &filter(Trace &data_points) const override;
60 };
61 
62 
63 class PMSPP_LIB_DECL FilterHighPassPercentage : public FilterInterface
64 {
65  private:
66  double m_y_pass_ratio = 0;
67 
68  public:
69  FilterHighPassPercentage(double y_ratio);
71  virtual ~FilterHighPassPercentage(){};
72  Trace &filter(Trace &data_points) const override;
73 };
74 
75 
77 {
78  private:
79  std::size_t m_number_of_points = 0;
80 
81  public:
82  FilterGreatestY(std::size_t number_of_points = 0);
83  FilterGreatestY(const FilterGreatestY &other);
84  virtual ~FilterGreatestY(){};
85  Trace &filter(Trace &data_points) const override;
86 
87  std::size_t getNumberOfPoints() const;
88 };
89 
91 {
92  private:
93  const FilterGreatestY m_filterGreatestY;
94 
95  public:
96  MassSpectrumFilterGreatestItensities(std::size_t number_of_points = 0);
100  MassSpectrum &filter(MassSpectrum &spectrum) const override;
101 };
102 
104 {
105 
106  public:
107  FilterFloorY();
108  FilterFloorY(const FilterFloorY &other);
109  virtual ~FilterFloorY(){};
110  Trace &filter(Trace &data_points) const override;
111 };
112 
113 
114 class PMSPP_LIB_DECL FilterRoundY : public FilterInterface
115 {
116 
117  public:
118  FilterRoundY();
119  FilterRoundY(const FilterRoundY &other);
120  virtual ~FilterRoundY(){};
121  Trace &filter(Trace &data_points) const override;
122 };
123 
124 /** @brief rescales Y values into a dynamic range
125  * if the dynamic range is set to 0, this filter is ignored
126  */
128 {
129  private:
130  double m_dynamic = 0;
131 
132  public:
133  FilterRescaleY(double dynamic);
134  FilterRescaleY(const FilterRescaleY &other);
135  virtual ~FilterRescaleY(){};
136  Trace &filter(Trace &data_points) const override;
137 
138  double getDynamicRange() const;
139 };
140 
141 
142 /** @brief rescales Y values given a tranformation factor
143  */
145 {
146  private:
147  double m_factor = 0;
148 
149  public:
150  FilterScaleFactorY(double m_factor);
152  virtual ~FilterScaleFactorY(){};
153  Trace &filter(Trace &data_points) const override;
154 
155  double getScaleFactorY() const;
156 };
157 
158 } // namespace pappso
pappso::FilterGreatestY
Definition: filterpass.h:92
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition: exportinmportconfig.h:12
pappso
Definition: aa.cpp:38
pappso::MassSpectrum
Class to represent a mass spectrum.
Definition: massspectrum.h:89
pappso::FilterHighPassPercentage
Definition: filterpass.h:79
pappso::MassSpectrumFilterGreatestItensities
Definition: filterpass.h:106
pappso::FilterHighPass
Definition: filterpass.h:66
pappso::FilterInterface
generic interface to apply a filter on a trace
Definition: filterinterface.h:55
pappso::FilterRoundY
Definition: filterpass.h:130
pappso::Trace
A simple container of DataPoint instances.
Definition: trace.h:125
filterinterface.h
pappso::MassSpectrumFilterInterface
generic interface to apply a filter on a MassSpectrum This is the same as FilterInterface,...
Definition: filterinterface.h:70
pappso::FilterRescaleY
rescales Y values into a dynamic range if the dynamic range is set to 0, this filter is ignored
Definition: filterpass.h:143
pappso::FilterScaleFactorY
rescales Y values given a tranformation factor
Definition: filterpass.h:160
pappso::FilterFloorY
Definition: filterpass.h:119