helper to filter a single MS1 spectrum Returns true if filtered spectrum contains data
| 50 | // helper to filter a single MS1 spectrum |
| 51 | // Returns true if filtered spectrum contains data |
| 52 | bool filterSpectrum(const MSSpectrum& in, MSSpectrum& out, const RangeAllType& visible_range, const DataFilters& layer_filters) |
| 53 | { |
| 54 | out = in; |
| 55 | out.clear(false); // keep metadata |
| 56 | auto it_end = in.MZEnd(visible_range.getMaxMZ()); |
| 57 | for (auto it = in.MZBegin(visible_range.getMinMZ()); it != it_end; ++it) |
| 58 | { |
| 59 | if (layer_filters.passes(in, it - in.begin())) |
| 60 | { |
| 61 | out.push_back(*it); |
| 62 | } |
| 63 | } |
| 64 | return !out.empty(); |
| 65 | } |
| 66 | |
| 67 | void LayerStoreDataPeakMapVisible::storeVisibleSpectrum(const MSSpectrum& spec, const RangeAllType& visible_range, const DataFilters& layer_filters) |
| 68 | { |