ProteoWizard
Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
ralab::base::ms::LocalMinPeakArea< TReal > Struct Template Reference

extends peak to the left and to the right to the next local minimum or a predefined threshol or a maximum allowed extension. More...

#include <peakpickerqtof.hpp>

Public Types

typedef TReal value_type
 

Public Member Functions

 LocalMinPeakArea (TReal integwith, TReal threshold=.1)
 
template<typename Tzerocross , typename Tintensity , typename Tout >
void operator() (Tzerocross beginZ, Tzerocross endZ, Tintensity intensity, Tintensity resampled, Tout area) const
 intagrates the peak intesnities More...
 

Public Attributes

TReal integwith_
 
TReal threshold_
 

Private Member Functions

template<typename TInt >
void mextend (TInt &start, TInt &end, TInt idx) const
 exend peak to left and rigth More...
 

Detailed Description

template<typename TReal>
struct ralab::base::ms::LocalMinPeakArea< TReal >

extends peak to the left and to the right to the next local minimum or a predefined threshol or a maximum allowed extension.

Definition at line 76 of file peakpickerqtof.hpp.

Member Typedef Documentation

§ value_type

template<typename TReal >
typedef TReal ralab::base::ms::LocalMinPeakArea< TReal >::value_type

Definition at line 77 of file peakpickerqtof.hpp.

Constructor & Destructor Documentation

§ LocalMinPeakArea()

template<typename TReal >
ralab::base::ms::LocalMinPeakArea< TReal >::LocalMinPeakArea ( TReal  integwith,
TReal  threshold = .1 
)
inline
Parameters
integwithmaximal allowed peak width +- in pixel

Definition at line 81 of file peakpickerqtof.hpp.

Member Function Documentation

§ operator()()

template<typename TReal >
template<typename Tzerocross , typename Tintensity , typename Tout >
void ralab::base::ms::LocalMinPeakArea< TReal >::operator() ( Tzerocross  beginZ,
Tzerocross  endZ,
Tintensity  intensity,
Tintensity  resampled,
Tout  area 
) const
inline

intagrates the peak intesnities

Definition at line 89 of file peakpickerqtof.hpp.

94  {
95  typedef typename std::iterator_traits<Tout>::value_type AreaType;
96  for( ; beginZ != endZ ; ++beginZ , ++area )
97  {
98  size_t idx = static_cast<size_t>( *beginZ );
99  size_t start = static_cast<size_t>( boost::math::round( idx - integwith_ ) );
100  size_t end = static_cast<size_t>( boost::math::round( idx + integwith_ + 2) );
101 
102  Tintensity st = intensity + start;
103  Tintensity en = intensity + end;
104  Tintensity center = intensity + idx;
105  std::ptrdiff_t x1 = std::distance(st, center);
106  std::ptrdiff_t y1 = std::distance(center,en);
107  mextend(st , en , center);
108  std::ptrdiff_t x2 = std::distance(intensity,st);
109  std::ptrdiff_t y2 = std::distance(intensity,en);
110  std::ptrdiff_t pp = std::distance(st,en);
111  AreaType areav = std::accumulate(resampled+x2,resampled+y2,0.);
112  *area = areav;
113  }
114  }
void mextend(TInt &start, TInt &end, TInt idx) const
exend peak to left and rigth

§ mextend()

template<typename TReal >
template<typename TInt >
void ralab::base::ms::LocalMinPeakArea< TReal >::mextend ( TInt &  start,
TInt &  end,
TInt  idx 
) const
inlineprivate

exend peak to left and rigth

Definition at line 119 of file peakpickerqtof.hpp.

120  {
121  typedef typename std::iterator_traits<TInt>::value_type Intensitytype;
122  //
123  for(TInt intens = idx ; intens >= start; --intens){
124  Intensitytype val1 = *intens;
125  Intensitytype val2 = *(intens-1);
126  if(val1 > threshold_){
127  if(val1 < val2 ){
128  start = intens;
129  break;
130  }
131  }
132  else{
133  start = intens;
134  break;
135  }
136  }
137 
138  for(TInt intens = idx ; intens <= end; ++intens){
139  Intensitytype val1 = *intens;
140  Intensitytype val2 = *(intens+1);
141  if(val1 > threshold_){
142  if(val1 < val2 ){
143  end = intens;
144  break;
145  }
146  }
147  else{
148  end = intens;
149  break;
150  }
151  }
152  }

Member Data Documentation

§ integwith_

template<typename TReal >
TReal ralab::base::ms::LocalMinPeakArea< TReal >::integwith_

Definition at line 78 of file peakpickerqtof.hpp.

§ threshold_

template<typename TReal >
TReal ralab::base::ms::LocalMinPeakArea< TReal >::threshold_

Definition at line 79 of file peakpickerqtof.hpp.


The documentation for this struct was generated from the following file: