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

#include <tracedetectionmoulon.h>

Inheritance diagram for pappso::TraceDetectionMoulon:
pappso::TraceDetectionInterface

Public Member Functions

 TraceDetectionMoulon (unsigned int smoothing_half_window_length, pappso_double tic_start, pappso_double tic_stop)
 
 TraceDetectionMoulon (const TraceDetectionMoulon &other)
 
virtual ~TraceDetectionMoulon ()
 
void setFilterMorphoMean (const FilterMorphoMean &smooth)
 
void setTicStart (double tic_start)
 
void setTicStop (double tic_stop)
 
unsigned int getSmoothingHalfEdgeWindows () const
 
pappso_double getTicStart () const
 
pappso_double getTicStop () const
 
void detect (const Trace &xic, TraceDetectionSinkInterface &sink, bool remove_peak_base) const override
 detect peaks on a trace
 
- Public Member Functions inherited from pappso::TraceDetectionInterface

Private Attributes

FilterMorphoMean m_xicFilterSmoothing
 
pappso_double m_ticStart
 
pappso_double m_ticStop
 

Detailed Description

Definition at line 34 of file tracedetectionmoulon.h.

Constructor & Destructor Documentation

◆ TraceDetectionMoulon() [1/2]

pappso::TraceDetectionMoulon::TraceDetectionMoulon ( unsigned int smoothing_half_window_length,
pappso_double tic_start,
pappso_double tic_stop )

Definition at line 28 of file tracedetectionmoulon.cpp.

32 : m_xicFilterSmoothing(smoothing_half_window_length)
33{
34 m_ticStart = tic_start;
35 m_ticStop = tic_stop;
36}

References m_ticStart, and m_ticStop.

◆ TraceDetectionMoulon() [2/2]

pappso::TraceDetectionMoulon::TraceDetectionMoulon ( const TraceDetectionMoulon & other)

Definition at line 38 of file tracedetectionmoulon.cpp.

39 : m_xicFilterSmoothing(other.m_xicFilterSmoothing)
40{
41 m_ticStart = other.m_ticStart;
42 m_ticStop = other.m_ticStop;
43}

References m_ticStart, and m_ticStop.

◆ ~TraceDetectionMoulon()

pappso::TraceDetectionMoulon::~TraceDetectionMoulon ( )
virtual

Definition at line 45 of file tracedetectionmoulon.cpp.

46{
47}

Member Function Documentation

◆ detect()

void pappso::TraceDetectionMoulon::detect ( const Trace & trace,
TraceDetectionSinkInterface & sink,
bool remove_peak_base ) const
overridevirtual

detect peaks on a trace

Parameters
tracethe trace to detect peaks on
sinkthe object to store peaks or stream it
remove_peak_baseif true, removes the area under the base of the peak

Implements pappso::TraceDetectionInterface.

Definition at line 86 of file tracedetectionmoulon.cpp.

89{
90
91 Trace xic_smoothed(xic);
92
93 m_xicFilterSmoothing.filter(xic_smoothed);
94
95 // detect peaks :
96 bool banked(false);
97 unsigned int nb_tic_start(0);
98
99 std::vector<DataPoint>::const_iterator it_smoothed;
100 std::vector<DataPoint>::const_iterator it, it_begin;
101
102 // TracePeak *p_current_peak = nullptr;
103
104 for(it_smoothed = xic_smoothed.begin(), it = xic.begin();
105 it_smoothed != xic_smoothed.end();
106 ++it_smoothed, ++it)
107 {
108
109 if((nb_tic_start == 0) && (it_begin != xic.end()) && (banked == false))
110 {
111 // delete(p_current_peak);
112 // p_current_peak = nullptr;
113 it_begin = xic.end();
114 }
115
116 if(it_smoothed->y >= m_ticStart)
117 {
118 nb_tic_start++;
119 if(it_begin == xic.end())
120 {
121 // p_current_peak = new TracePeak;
122 // p_current_peak->setLeftBoundary(*it_smoothed);
123 it_begin = it;
124 banked = false;
125 }
126 if((nb_tic_start == 2) && (banked == false))
127 {
128 banked = true;
129 }
130 }
131 else
132 {
133 nb_tic_start = 0;
134 }
135 if(it_smoothed->y <= m_ticStop)
136 {
137 if(it_begin != xic.end())
138 {
139
140 if(banked)
141 {
142 TracePeak peak(it_begin, it + 1, remove_peak_base);
143 sink.setTracePeak(peak);
144 }
145 banked = false;
146 }
147 }
148 }
149}
virtual Trace & filter(Trace &data_points) const override

References pappso::FilterMorphoWindowBase::filter(), m_ticStart, m_ticStop, m_xicFilterSmoothing, and pappso::TraceDetectionSinkInterface::setTracePeak().

◆ getSmoothingHalfEdgeWindows()

unsigned int pappso::TraceDetectionMoulon::getSmoothingHalfEdgeWindows ( ) const

◆ getTicStart()

pappso_double pappso::TraceDetectionMoulon::getTicStart ( ) const

Definition at line 74 of file tracedetectionmoulon.cpp.

75{
76 return m_ticStart;
77}

References m_ticStart.

◆ getTicStop()

pappso_double pappso::TraceDetectionMoulon::getTicStop ( ) const

Definition at line 80 of file tracedetectionmoulon.cpp.

81{
82 return m_ticStop;
83}

References m_ticStop.

◆ setFilterMorphoMean()

void pappso::TraceDetectionMoulon::setFilterMorphoMean ( const FilterMorphoMean & smooth)

Definition at line 51 of file tracedetectionmoulon.cpp.

52{
53 m_xicFilterSmoothing = smooth;
54}

References m_xicFilterSmoothing.

◆ setTicStart()

void pappso::TraceDetectionMoulon::setTicStart ( double tic_start)

Definition at line 57 of file tracedetectionmoulon.cpp.

58{
59 m_ticStart = tic_start;
60}

References m_ticStart.

◆ setTicStop()

void pappso::TraceDetectionMoulon::setTicStop ( double tic_stop)

Definition at line 62 of file tracedetectionmoulon.cpp.

63{
64 m_ticStop = tic_stop;
65}

References m_ticStop.

Member Data Documentation

◆ m_ticStart

pappso_double pappso::TraceDetectionMoulon::m_ticStart
private

◆ m_ticStop

pappso_double pappso::TraceDetectionMoulon::m_ticStop
private

◆ m_xicFilterSmoothing

FilterMorphoMean pappso::TraceDetectionMoulon::m_xicFilterSmoothing
private

Definition at line 37 of file tracedetectionmoulon.h.

Referenced by detect(), getSmoothingHalfEdgeWindows(), and setFilterMorphoMean().


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