libpappsomspp
Library for mass spectrometry
filterresample.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/filers/filterresample.h
3  * \date 28/04/2019
4  * \author Olivier Langella
5  * \brief collection of filters concerned by X 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 "../../mzrange.h"
33 #include "../../exportinmportconfig.h"
34 
35 namespace pappso
36 {
37 
38 class PMSPP_LIB_DECL FilterResampleKeepSmaller : public FilterInterface
39 {
40  private:
41  double m_value;
42 
43  public:
44  FilterResampleKeepSmaller(double x_value);
45  FilterResampleKeepSmaller(const FilterResampleKeepSmaller &other);
46  virtual ~FilterResampleKeepSmaller(){};
47  Trace &filter(Trace &trace) const override;
48 };
49 
50 class PMSPP_LIB_DECL FilterResampleKeepGreater : public FilterInterface
51 {
52  private:
53  double m_value;
54 
55  public:
56  FilterResampleKeepGreater(double x_value);
58  virtual ~FilterResampleKeepGreater(){};
59 
61  Trace &filter(Trace &trace) const override;
62 
63  double getThresholdX() const;
64 };
65 
66 class PMSPP_LIB_DECL FilterResampleRemoveXRange : public FilterInterface
67 {
68  private:
69  double m_minX;
70  double m_maxX;
71 
72  public:
73  FilterResampleRemoveXRange(double min_x, double max_x);
75  virtual ~FilterResampleRemoveXRange(){};
76 
78  Trace &filter(Trace &trace) const override;
79 };
80 
82 {
83  private:
84  double m_minX;
85  double m_maxX;
86 
87  public:
88  FilterResampleKeepXRange(double min_x = 0, double max_x = 0);
90  virtual ~FilterResampleKeepXRange(){};
91 
92  FilterResampleKeepXRange &operator=(const FilterResampleKeepXRange &other);
93 
94  Trace &filter(Trace &trace) const override;
95 };
96 
99 {
100  private:
101  const FilterResampleRemoveXRange m_filterRange;
102 
103  public:
108  MassSpectrum &filter(MassSpectrum &spectrum) const override;
109 };
110 
111 
114 {
115  private:
116  const FilterResampleKeepXRange m_filterRange;
117 
118  public:
123  MassSpectrum &filter(MassSpectrum &spectrum) const override;
124 };
125 } // namespace pappso
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition: exportinmportconfig.h:14
pappso
Definition: aa.cpp:38
pappso::MassSpectrum
Class to represent a mass spectrum.
Definition: massspectrum.h:91
pappso::FilterResampleKeepGreater
Definition: filterresample.h:68
pappso::FilterInterface
generic interface to apply a filter on a trace
Definition: filterinterface.h:57
pappso::MassSpectrumFilterResampleKeepMzRange
Definition: filterresample.h:130
pappso::MassSpectrumFilterResampleRemoveMzRange
Definition: filterresample.h:115
pappso::MzRange
Definition: mzrange.h:66
pappso::Trace
A simple container of DataPoint instances.
Definition: trace.h:126
filterinterface.h
pappso::MassSpectrumFilterInterface
generic interface to apply a filter on a MassSpectrum This is the same as FilterInterface,...
Definition: filterinterface.h:72
pappso::FilterResampleKeepXRange
Definition: filterresample.h:99
pappso::FilterResampleRemoveXRange
Definition: filterresample.h:84