29 #include "../../trace/trace.h"
31 #include "../../exception/exceptionoutofrange.h"
32 #include "../../exception/exceptionnotrecognized.h"
37 : m_halfWindowSize(half_window_size)
42 : m_halfWindowSize(other.m_halfWindowSize)
65 << data_points.size();
68 Trace old_trace(data_points);
69 auto it = old_trace.begin();
71 auto it_target = data_points.begin();
74 std::size_t loop_begin = 0;
99 while(it != old_trace.end())
134 std::vector<DataPoint>::const_iterator begin,
135 std::vector<DataPoint>::const_iterator end)
const
161 std::vector<DataPoint>::const_iterator begin,
162 std::vector<DataPoint>::const_iterator end)
const
194 std::vector<DataPoint>::const_iterator begin,
195 std::vector<DataPoint>::const_iterator end)
const
207 : m_filterMax(half_window_size), m_filterMin(half_window_size)
211 : m_filterMax(other.m_filterMax), m_filterMin(other.m_filterMin)
241 : m_filterMin(half_window_size), m_filterMax(half_window_size)
245 : m_filterMin(other.m_filterMin), m_filterMax(other.m_filterMax)
274 : m_halfWindowSize(half_window_size)
279 : m_halfWindowSize(other.m_halfWindowSize)
285 const QString &strBuildParams)
288 if(strBuildParams.startsWith(
"antiSpike|"))
290 QStringList params = strBuildParams.split(
"|").back().split(
";");
292 m_halfWindowSize = params.at(0).toUInt();
297 QString(
"building FilterMorphoAntiSpike from string %1 is not possible")
298 .arg(strBuildParams));
305 QString strCode = QString(
"antiSpike|%1").arg(m_halfWindowSize);
329 Trace old_trace(data_points);
330 auto it = old_trace.begin();
331 auto it_target = data_points.begin();
332 auto itw = old_trace.begin();
337 while((it != old_trace.end()) &&
384 std::vector<DataPoint>::const_iterator begin,
385 std::vector<DataPoint>::const_iterator end)
const
416 std::vector<DataPoint>::const_iterator begin,
417 std::vector<DataPoint>::const_iterator end)
const
424 std::size_t median_half_window_size, std::size_t minmax_half_window_size)
425 : m_filterMorphoMedian(median_half_window_size),
426 m_filterMorphoMinMax(minmax_half_window_size)
432 : m_filterMorphoMedian(other.m_filterMorphoMedian),
433 m_filterMorphoMinMax(other.m_filterMorphoMinMax)
excetion to use when an item type is not recognized
anti spike filter set to zero alone values inside the window
FilterMorphoAntiSpike & operator=(const FilterMorphoAntiSpike &other)
std::size_t getHalfWindowSize() const
void buildFilterFromString(const QString &strBuildParams) override
build this filer using a string
QString toString() const override
FilterMorphoAntiSpike(std::size_t half_window_size)
std::size_t m_halfWindowSize
Trace & filter(Trace &data_points) const override
compute background of a trace compute background noise on a trace
Trace & filter(Trace &data_points) const override
FilterMorphoBackground(std::size_t median_half_window_size, std::size_t minmax_half_window_size)
FilterMorphoMedian m_filterMorphoMedian
const FilterMorphoMedian & getFilterMorphoMedian() const
FilterMorphoBackground & operator=(const FilterMorphoBackground &other)
const FilterMorphoMinMax & getFilterMorphoMinMax() const
FilterMorphoMinMax m_filterMorphoMinMax
transform the trace with the maximum of the minimum equivalent of the erode filter for pictures
Trace & filter(Trace &data_points) const override
FilterMorphoMaxMin(std::size_t half_window_size)
FilterMorphoMax m_filterMax
std::size_t getMaxMinHalfEdgeWindows() const
FilterMorphoMaxMin & operator=(const FilterMorphoMaxMin &other)
FilterMorphoMin m_filterMin
transform the trace into its maximum over a window
double getWindowValue(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end) const override
std::size_t getMaxHalfEdgeWindows() const
FilterMorphoMax(std::size_t half_window_size)
FilterMorphoMax & operator=(const FilterMorphoMax &other)
mean filter apply mean of y values inside the window : this results in a kind of smoothing
FilterMorphoMean(std::size_t half_window_size)
FilterMorphoMean & operator=(const FilterMorphoMean &other)
double getWindowValue(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end) const override
std::size_t getMeanHalfEdgeWindows() const
transform the trace with the minimum of the maximum equivalent of the dilate filter for pictures
FilterMorphoMax m_filterMax
FilterMorphoMin m_filterMin
FilterMorphoMinMax(std::size_t half_window_size)
std::size_t getMinMaxHalfEdgeWindows() const
Trace & filter(Trace &data_points) const override
FilterMorphoMinMax & operator=(const FilterMorphoMinMax &other)
transform the trace into its minimum over a window
std::size_t getMinHalfEdgeWindows() const
FilterMorphoMin(std::size_t half_window_size)
double getWindowValue(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end) const override
FilterMorphoMin & operator=(const FilterMorphoMin &other)
FilterMorphoSum & operator=(const FilterMorphoSum &other)
FilterMorphoSum(std::size_t half_window_size)
double getWindowValue(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end) const override
base class that apply a signal treatment based on a window
virtual Trace & filter(Trace &data_points) const override
virtual double getWindowValue(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end) const =0
std::size_t m_halfWindowSize
FilterMorphoWindowBase(std::size_t half_window_size)
virtual std::size_t getHalfWindowSize() const
FilterMorphoWindowBase & operator=(const FilterMorphoWindowBase &other)
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 findDifferentYvalue(std::vector< DataPoint >::iterator begin, std::vector< DataPoint >::iterator end, const double &y_value)
find the first element in which Y is different of value
std::vector< DataPoint >::const_iterator maxYDataPoint(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
double medianYTrace(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
calculate the median of y value of a trace
double meanYTrace(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
calculate the mean of y value of a trace
double sumYTrace(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end, double init)
calculate the sum of y value of a trace
std::vector< DataPoint >::const_iterator minYDataPoint(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)