27 #include "../../exception/exceptionoutofrange.h"
28 #include "../../exception/exceptionnotpossible.h"
36 unsigned int smoothing_half_window_length,
37 unsigned int minmax_half_window_length,
38 unsigned int maxmin_half_window_length,
41 : m_smooth(smoothing_half_window_length),
42 m_minMax(minmax_half_window_length),
43 m_maxMin(maxmin_half_window_length)
70 double detectionThresholdOnMinMax)
76 double detectionThresholdOnMaxMin)
111 bool remove_peak_base)
const
119 std::size_t size = xic.size();
122 qDebug() << QObject::tr(
123 "The original XIC is too small to detect peaks (%1)")
132 Trace xic_minmax(xic);
140 Trace xic_maxmin(xic_minmax);
153 qDebug() << QObject::tr(
154 "The original XIC is too small to detect peaks (%1) :\n%2")
161 std::vector<DataPoint>::const_iterator previous_rt = xic_minmax.begin();
162 std::vector<DataPoint>::const_iterator current_rt = (previous_rt + 1);
163 std::vector<DataPoint>::const_iterator last_rt = (xic_minmax.end() - 1);
165 std::vector<DataPoint>::const_iterator current_rt_on_maxmin =
166 (xic_maxmin.begin() + 1);
168 std::vector<DataPoint>::const_iterator xic_position = xic.begin();
170 while(current_rt != last_rt)
174 if((previous_rt->y < current_rt->y) &&
181 if(current_rt->y < (current_rt + 1)->y)
184 previous_rt = current_rt;
186 current_rt_on_maxmin++;
189 else if(current_rt->y > (current_rt + 1)->y)
194 std::vector<DataPoint>::const_iterator it_left =
201 std::vector<DataPoint>::const_iterator it_right =
218 TracePeak peak(it, xic_position, remove_peak_base);
222 previous_rt = current_rt;
224 current_rt_on_maxmin++;
232 current_rt_on_maxmin++;
241 previous_rt = current_rt;
243 current_rt_on_maxmin++;
transform the trace with the maximum of the minimum equivalent of the erode filter for pictures
Trace & filter(Trace &data_points) const override
std::size_t getMaxMinHalfEdgeWindows() const
mean filter apply mean of y values inside the window : this results in a kind of smoothing
std::size_t getMeanHalfEdgeWindows() const
transform the trace with the minimum of the maximum equivalent of the dilate filter for pictures
std::size_t getMinMaxHalfEdgeWindows() const
Trace & filter(Trace &data_points) const override
virtual Trace & filter(Trace &data_points) const override
virtual const QString & qwhat() const
virtual void setTracePeak(TracePeak &xic_peak)=0
void setFilterMorphoMinMax(const FilterMorphoMinMax &m_minMax)
void setDetectionThresholdOnMaxmin(double detectionThresholdOnMaxMin)
unsigned int getMinMaxHalfEdgeWindows() const
void detect(const Trace &xic, TraceDetectionSinkInterface &sink, bool remove_peak_base) const override
detect peaks on a trace
FilterMorphoMaxMin m_maxMin
unsigned int getSmoothingHalfEdgeWindows() const
pappso_double getDetectionThresholdOnMinmax() const
pappso_double getDetectionThresholdOnMaxmin() const
void setFilterMorphoMaxMin(const FilterMorphoMaxMin &maxMin)
TraceDetectionZivy(unsigned int smoothing_half_window_length, unsigned int minmax_half_window_length, unsigned int maxmin_half_window_length, pappso_double detection_threshold_on_minmax, pappso_double detection_threshold_on_maxmin)
FilterMorphoMinMax m_minMax
virtual ~TraceDetectionZivy()
pappso_double m_detectionThresholdOnMaxMin
void setFilterMorphoMean(const FilterMorphoMean &smooth)
pappso_double m_detectionThresholdOnMinMax
FilterMorphoMean m_smooth
unsigned int getMaxMinHalfEdgeWindows() const
void setDetectionThresholdOnMinmax(double detectionThresholdOnMinMax)
A simple container of DataPoint instances.
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
std::vector< DataPoint >::iterator findFirstEqualOrGreaterX(std::vector< DataPoint >::iterator begin, std::vector< DataPoint >::iterator end, const double &value)
find the first element in which X is equal or greater than the value searched important : it implies ...
std::vector< DataPoint >::const_iterator moveLowerYLeftDataPoint(const Trace &trace, std::vector< DataPoint >::const_iterator begin)
Move left to the lower value.
double pappso_double
A type definition for doubles.
std::vector< DataPoint >::const_iterator moveLowerYRigthDataPoint(const Trace &trace, std::vector< DataPoint >::const_iterator begin)
Move right to the lower value.