CFEL - ASG Software Suite  2.5.0
CASS
hitfinder.h
Go to the documentation of this file.
1 // Copyright (C) 2013 Lutz Foucar
2 
3 /** @file hitfinder.h contains processors that will extract pixels of
4  * interrest from 2d histograms.
5  * @author Lutz Foucar
6  */
7 
8 #ifndef _HITFINDER_H_
9 #define _HITFINDER_H_
10 
11 #include <tr1/functional>
12 
13 #include "processor.h"
14 #include "cass_event.h"
16 
17 
18 
19 namespace cass
20 {
21 
22 
23 /** get the local background from image.
24  *
25  * @PPList "203": get the local background from image
26  *
27  * splits up the image into sections of user choosable size. In each of these
28  * sections the local background is determined by taking a box of a user
29  * choosable size and determining the median of the pixel values inside this
30  * box.
31  *
32  * @see Processor for a list of all commonly available cass.ini
33  * settings.
34  *
35  * @cassttng Processor/\%name\%/{ImageName} \n
36  * the processor name that contain the 2d histogram. Default
37  * is "blubb".
38  * @cassttng Processor/\%name\%/{SectionSizeX|SectionSizeY} \n
39  * Size of the subsection of the image. Default is 1024|512.
40  * @cassttng Processor/\%name\%/{BoxSizeX|BoxSizeY} \n
41  * size in x and y of the box that is used for determining the median
42  * background. Default is 10|10.
43  *
44  * @author Lutz Foucar
45  * @author Wolfgang Kabsch
46  */
47 class pp203 : public Processor
48 {
49 public:
50  /** constructor */
51  pp203(const name_t &);
52 
53  /** process event */
54  virtual void process(const CASSEvent&, result_t&);
55 
56  /** load the settings of this pp */
57  virtual void loadSettings(size_t);
58 
59 protected:
60  /** pp containing 2d histogram */
62 
63  /** the size of the box used for the median filter */
64  std::pair<size_t,size_t> _boxSize;
65 
66  /** size of a image section */
67  std::pair<size_t,size_t> _sectionSize;
68 };
69 
70 
71 
72 
73 
74 
75 /** find bragg peaks and store them in a list
76  *
77  * @PPList "204": find bragg peaks and store them in a list
78  *
79  * @see Processor for a list of all commonly available cass.ini
80  * settings.
81  *
82  * @cassttng Processor/\%name\%/{ImageName} \n
83  * the processor name that contain the 2d histogram. Default
84  * is "blubb".
85  * @cassttng Processor/\%name\%/{SectionSizeX|SectionSizeY} \n
86  * Size of the subsection of the image. Default is 1024|512.
87  * @cassttng Processor/\%name\%/{BoxSizeX|BoxSizeY} \n
88  * size in x and y of the box that is used for determining the median
89  * background. Default is 10|10.
90  * @cassttng Processor/\%name\%/{Threshold} \n
91  * @cassttng Processor/\%name\%/{MinSignalToNoiseRatio} \n
92  * @cassttng Processor/\%name\%/{MinNbrBackgrndPixels} \n
93  * @cassttng Processor/\%name\%/{BraggPeakRadius} \n
94  *
95  * @author Lutz Foucar
96  */
97 class pp204 : public Processor
98 {
99 public:
100  /** constructor */
101  pp204(const name_t &name);
102 
103  /** process event */
104  virtual void process(const CASSEvent&, result_t&);
105 
106  /** load the settings of this pp */
107  virtual void loadSettings(size_t);
108 
109 protected:
110  /** processor containing the image to find the bragg peaks in */
112 
113  /** definition of the table */
115 
116 public:
117  /** enum describing the contents of the resulting table */
119  {
125  Index = 5,
126  Column = 6,
127  Row = 7,
131  MaxRadius = 11,
132  MinRadius = 12,
133  MaxADU = 13,
135  };
136 
137 protected:
138  /** define the values of the pixels */
140 
141  /** define the positions in the image */
142  typedef int imagepos_t;
143 
144  /** check highest pixel and generate the mean and standart deviation
145  *
146  * function is used in SNR peak finder
147  *
148  * Check if the center pixel is heigher than all other pixels in the box. If
149  * this is the case return 0. If there is at least one pixel whos value is
150  * higher than the center pixel return 1.
151  *
152  * Generate the mean and standart deviation within the box around the center
153  * pixel. Only take pixels into account that are outside of the peak radius.
154  *
155  * @return 0 if all pixels in the box are lower than the center pixel, 1 otherwise
156  * @param centerPixel iterator to the center pixel
157  * @param nColumns the number of columns in the image
158  * @param[out] mean contains the mean value
159  * @param[out] stdv contains the standart deviation
160  * @param[out] count contains the number of pixels that were used to calculate
161  * mean and stdv
162  */
164  const imagepos_t nColumns,
165  pixelval_t &mean, pixelval_t &stdv, int &count);
166 
167  /** the size of the box within which the peak should lie */
168  std::pair<imagepos_t,imagepos_t> _box;
169 
170  /** size of a image section */
171  std::pair<imagepos_t,imagepos_t> _section;
172 
173  /** pixel threshold to be exceeded */
174  float _threshold;
175 
176  /** the square size of bragg peak radius */
178 
179  /** the min signal to noise ratio that needs to be exceeded */
180  float _minSnr;
181 
182  /** the min signal to noise ratio that needs to be exceeded */
184 
185  /** min amount of pixels for the background calc */
187 };
188 
189 
190 
191 
192 
193 /** visualize the peaks that were found in the image itself
194  *
195  * @PPList "205": visualize the peaks that were found in the image itself
196  *
197  * @see Processor for a list of all commonly available cass.ini
198  * settings.
199  *
200  * @cassttng Processor/\%name\%/{ImageName} \n
201  * the processor name that contain the 2d histogram. Default
202  * is "blubb".
203  * @cassttng Processor/\%name\%/{TableName} \n
204  * name of processor that contains the table like histogram that
205  * the pixels of interest are taken from
206  * @cassttng Processor/\%name\%/{BoxSizeX|BoxSizeY} \n
207  * size in x and y of the box that should be drawn around the found
208  * peak
209  * @cassttng Processor/\%name\%/{DrawPixelValue} \n
210  * The value of the border pixels
211  * @cassttng Processor/\%name\%/{DrawInnerPixel} \n
212  * flag to tell whether the inner pixel values should be overwritten
213  * @cassttng Processor/\%name\%/{InnerPixelValue} \n
214  * The value of the inner pixels.
215  * @cassttng Processor/\%name\%/{Radius} \n
216  * @cassttng Processor/\%name\%/{IndexColumn} \n
217  * @cassttng Processor/\%name\%/{DrawCircle} \n
218  * @cassttng Processor/\%name\%/{DrawBox} \n
219  *
220  *
221  * @author Lutz Foucar
222  * @author Wolfgang Kabsch
223  */
224 class pp205 : public Processor
225 {
226 public:
227  /** constructor */
228  pp205(const name_t &name);
229 
230  /** process event */
231  virtual void process(const CASSEvent&, result_t&);
232 
233  /** load the settings of this pp */
234  virtual void loadSettings(size_t);
235 
236 protected:
237  /** pp containing 2d histogram */
239 
240  /** pp containing the results */
242 
243  /** draw flags as bitmask */
245  float _radius;
246  std::pair<int,int> _boxsize;
248 
249  /** the number of the column where the global index of the pixel is */
250  size_t _idxCol;
251 };
252 
253 
254 
255 
256 
257 /** find pixels of bragg peaks and store them in a list
258  *
259  * @PPList "206": find pixels of bragg peaks and store them in a list
260  *
261  * @see Processor for a list of all commonly available cass.ini
262  * settings.
263  *
264  * @cassttng Processor/\%name\%/{ImageName} \n
265  * the processor name that contain the 2d histogram. Default
266  * is "blubb".
267  * @cassttng Processor/\%name\%/{SectionSizeX|SectionSizeY} \n
268  * Size of the subsection of the image. Default is 1024|512.
269  * @cassttng Processor/\%name\%/{BoxSizeX|BoxSizeY} \n
270  * size in x and y of the box that is used for determining the median
271  * background. Default is 10|10.
272  * @cassttng Processor/\%name\%/{Threshold} \n
273  * @cassttng Processor/\%name\%/{Multiplier} \n
274  *
275  * @author Lutz Foucar
276  */
277 class pp206 : public Processor
278 {
279 public:
280  /** constructor */
281  pp206(const name_t &name);
282 
283  /** process event */
284  virtual void process(const CASSEvent&, result_t&);
285 
286  /** load the settings of this pp */
287  virtual void loadSettings(size_t);
288 
289 protected:
290  /** processor containing the image to find the bragg peaks in */
292 
293  /** processor containing the noise image for thresholding */
295 
296  /** definition of the table */
298 
299 protected:
300  /** the size of the box within which the peak should lie */
301  std::pair<int,int> _box;
302 
303  /** size of a image section */
304  std::pair<int,int> _section;
305 
306  /** pixel threshold to be exceeded */
307  float _threshold;
308 
309  /** multiplier for the noise threshold */
310  float _multiplier;
311 };
312 
313 
314 
315 
316 
317 
318 
319 
320 /** find bragg peaks and store them in list
321  *
322  * @PPList "208": find bragg peaks and store them in list
323  *
324  * Finds bragg peaks by checking how many pixels that are connected are above
325  * the given singal to noise ratio. The mean and standart deviation for
326  * calculating the SNR is determined by a local box size. Here the statistics
327  * is cleaned from the outliers so that pixels that are potentially part of the
328  * peak are not included in the background and stdv calculation. If the ratio
329  * between outliers of the distribution and pixel that are part of the
330  * distribution does not satisfy the user setting, the box size will be
331  * increased and the process to determine the local background and std is
332  * repeated.
333  *
334  * This algorithm was inspired by an algorithm described in
335  * Zhang et al. J. Appl. Cryst. (2006). 39, 112-119
336  * [ doi:10.1107/S0021889805040677 ]
337  *
338  * @see Processor for a list of all commonly available cass.ini
339  * settings.
340  *
341  * @cassttng Processor/\%name\%/{ImageName} \n
342  * the processor name that contain the 2d histogram. Default
343  * is "blubb".
344  * @cassttng Processor/\%name\%/{SectionSizeX|SectionSizeY} \n
345  * Size of the subsection of the image. Default is 1024|512.
346  * @cassttng Processor/\%name\%/{BraggPeakDiameter} \n
347  * Minimum Diameter of a Bragg Peak. Used for determining the optimal
348  * box size and nbr of pixels in the Bragg Peak. Default is 2.
349  * @cassttng Processor/\%name\%/{MinRatio} \n
350  * The minimum ratio of pixel that are outliers of the distribution
351  * in the box to the pixels that are part of the distribution in the
352  * box. 3 mean that there have to be at least 3 times as meany pixels
353  * that are part of the distribution than outliers of the distribution.
354  * Default is 3.
355  * @cassttng Processor/\%name\%/{Threshold} \n
356  * Threshold of pixel in adu to be exeeded. Can also be the name of a
357  * Processor that contains the Threshold value.
358  * @cassttng Processor/\%name\%/{MinSignalToNoiseRatio} \n
359  * Signal to noise ratio of a pixel. Value needs to be exceeded in
360  * order for the pixel to be part of a bragg peak. Default is 4.
361  * @cassttng Processor/\%name\%/{MinNbrPixels} \n
362  * Minimum Nbr of Pixels to be part of a Bragg Peak. Default is
363  * determined by BraggPeakRadius.
364  * \f$ nbr = (2 \times BraggPeakRadius)^2 \f$
365  * @cassttng Processor/\%name\%/{BoxSizeX|BoxSizeY} \n
366  * col (x) and rows (y) of the box that is used for determining the
367  * background. The box is going from -BoxSizeX ... BoxSizeX in x and
368  * same in y. Default is determined by the BraggPeakRadius.
369  * \f$ size = \sqrt{\pi} \times BraggPeakRadius \f$
370  * @cassttng Processor/\%name\%/{GeometryFilename} \n
371  * The geom file to use. Default is "wrong_file" in which case the
372  * resolution will be calculated completely wrong
373  * @cassttng Processor/\%name\%/{ConvertCheetahToCASSLayout} \n
374  * Set this true if the geom file is for a cheetah layout of the data,
375  * but the image in ImageName is the image in CASS layout.
376  * @cassttng Processor/\%name\%/{Wavelength_A} \n
377  * The wavelength in Angstroem. Can also be the name of a Processor
378  * that contains the Wavelength. Default is 1.
379  * @cassttng Processor/\%name\%/{DetectorDistance_m} \n
380  * The detector distance in m. Can also be the name of a Processor
381  * that contains the detector distance. Default is 60e-2.
382  * @cassttng Processor/\%name\%/{PixelSize_m} \n
383  * The pixel size in m. Default is 109.92-6
384  *
385  * @author Lutz Foucar
386  */
387 class pp208 : public Processor
388 {
389 public:
390  /** constructor */
391  pp208(const name_t &name);
392 
393  /** process event */
394  virtual void process(const CASSEvent&, result_t&);
395 
396  /** load the settings of this pp */
397  virtual void loadSettings(size_t);
398 
399 protected:
400  /** processor containing the image to find the bragg peaks in */
402 
403  /** definition of the table */
405 
406  /** define the type of the pixel in image */
407  typedef result_t::storage_t::value_type pixelval_t;
408 
409  /** define the type of statistics used */
411 
412  /** define the index in the image */
413  typedef int64_t index_t;
414 
415  /** define the shape of the image */
416  typedef std::pair<index_t,index_t> shape_t;
417 
418  /** define the list of neighbours */
419  typedef std::vector<index_t> neighbourList_t;
420 
421  /** enum describing the contents of the resulting table */
423  {
429  Index = 5,
430  Column = 6,
431  Row = 7,
434  MaxRadius = 10,
435  MinRadius = 11,
436  MaxADU = 12,
441  };
442 
443 protected:
444  /** retrieve the box statistics
445  *
446  * Details:
447  *
448  * @return 0 when all non bad pixels have been added to the statistics.
449  * 1 if one of the pixels in the box was higher than the center pixel
450  * @param pixel const iterator to the center pixel
451  * @param linIdx the linearized index of the pixel
452  * @param box the shape of the box to check
453  * @param stat the statistics calculator used to determine mean and stdv of
454  * pixels in box
455  */
457  const index_t linIdx, const shape_t &box, stat_t &stat);
458 
459  /** check if pixel is not highest within box
460  *
461  * Details:
462  *
463  * @return 0 if pixel is heighest, 1 otherwise
464  * @param pixel const iterator to the pixel to be checked
465  * @param linIdx the linearized index of the pixel
466  * @param box the shape of the box to be checked (cols x rows)
467  * @param stat the statistics calculator used to determine mean and stdv of
468  * pixels in box
469  */
471  const index_t linIdx, shape_t box, stat_t &stat);
472 
473  /** retrieve the constant wavelength
474  *
475  * @param id unused
476  */
477  double lambdaFromConstant(const CASSEvent::id_t& /*id*/) {return _wavelength;}
478 
479  /** retrieve the wavelength from the processor
480  *
481  * @param id the id of the event to get the wavelength from
482  */
483  double lambdaFromProcessor(const CASSEvent::id_t& id);
484 
485  /** retrieve the constant detector distance
486  *
487  * @param id unused
488  */
489  double distanceFromConstant(const CASSEvent::id_t& /*id*/) {return _detdist;}
490 
491  /** retrieve the detector distance from the processor
492  *
493  * @param id the id of the event to get the detector distance from
494  */
495  double distanceFromProcessor(const CASSEvent::id_t& id);
496 
497  /** retrieve the threshold from the processor
498  *
499  * @param id the id of the event to get the detector distance from
500  */
501  pixelval_t thresholdFromProcessor(const CASSEvent::id_t& id);
502 
503  /** retrieve the threshold constant
504  *
505  * @param id the id of the event to get the detector distance from
506  */
507  pixelval_t thresholdFromConstant(const CASSEvent::id_t& id);
508 
509 protected:
510  /** the size of the box within which the peak should lie */
511  shape_t _box;
512 
513  /** size of a image section */
514  shape_t _section;
515 
516  /** size of the incomming image */
517  shape_t _imageShape;
518 
519  /** minimum Signal to Noise Ratio thats is needed for a pixel to be an outlier */
521 
522  /** minimum ratio of nbr of points used for statistics to nbr of outliers */
523  float _minRatio;
524 
525  /** the minimum nbr of pixels in the bragg peak*/
527 
528  /** the list of offsets to next neighbours */
529  neighbourList_t _neighbourOffsets;
530 
531  /** the conversion table from raw to lab */
532  std::vector<double> _src2labradius;
533 
534  /** the wavelength in case its fixed */
535  double _wavelength;
536 
537  /** pp containing wavelength in case its not fixed */
539 
540  /** function that gets the wavelength */
541  std::tr1::function<double(const CASSEvent::id_t&)> _getLambda;
542 
543  /** the detector distance in case its fixed */
544  double _detdist;
545 
546  /** pp containing detector distance in case its not fixed */
548 
549  /** function that gets the detectordistance */
550  std::tr1::function<double(const CASSEvent::id_t&)> _getDistance;
551 
552  /** pixel threshold to be exceeded */
553  pixelval_t _threshold;
554 
555  /** pp containing threshold in case its not fixed */
557 
558  /** function that gets the detectordistance */
559  std::tr1::function<pixelval_t(const CASSEvent::id_t&)> _thresh;
560 
561 };
562 
563 
564 
565 
566 
567 
568 
569 
570 /** find connected pixels, coalesce them and store them in a list
571  *
572  * @PPList "209": cluster connected pixels and store them in list
573  *
574  *
575  * @see Processor for a list of all commonly available cass.ini
576  * settings.
577  *
578  * @cassttng Processor/\%name\%/{ImageName} \n
579  * the processor name that contain the 2d histogram. Default
580  * is "Unknown".
581  * @cassttng Processor/\%name\%/{Threshold} \n
582  * name of the processor that contains the pixelwise thresholds. Must
583  * be the same dimension as the image.
584  * @cassttng Processor/\%name\%/{Factor} \n
585  * Factor to multiply the pixelwise threshold with, so that one can
586  * use a noise map as a threshold. Default is 1.
587  *
588  * @author Lutz Foucar
589  */
590 class pp209 : public Processor
591 {
592 public:
593  /** constructor */
594  pp209(const name_t &name);
595 
596  /** process event */
597  virtual void process(const CASSEvent&, result_t&);
598 
599  /** load the settings of this pp */
600  virtual void loadSettings(size_t);
601 
602 protected:
603  /** definition of the table */
605 
606  /** define the type of the pixel in image */
607  typedef result_t::storage_t::value_type pixelval_t;
608 
609  /** define the index in the image */
610  typedef int64_t index_t;
611 
612  /** define the shape of the image */
613  typedef std::pair<index_t,index_t> shape_t;
614 
615  /** define the list of neighbours */
616  typedef std::vector<index_t> neighbourList_t;
617 
618  /** enum describing the contents of the resulting table */
620  {
621  Integral = 0,
624  MaxADU = 3,
625  Index = 4,
626  Column = 5,
627  Row = 6,
631  MaxRow = 10,
632  MinRow = 11,
633  RowSize = 12,
636  };
637 
638 protected:
639  /** processor containing the image */
641 
642  /** processor containing the threshold for each pixel of the image */
644 
645  /** size of the incomming image */
646  shape_t _imageShape;
647 
648  /** the list of offsets to next neighbours */
649  neighbourList_t _neighbourOffsets;
650 
651  /** the factor that the pixelwise threshold is multuplied with */
652  pixelval_t _factor;
653 };
654 
655 
656 
657 
658 
659 
660 /********** processor 210: find bragg peaks using MAD************
661  *
662  * @PPList "210": find bragg peaks using MAD.
663  *
664  *
665  * @see Processor for a list of all commonly available cass.ini
666  * settings.
667  *
668  * @cassttng Processor/\%name\%/{ImageName} \n
669  * the processor name that contain the 2d histogram. Default
670  * is "Unknown".
671  * @cassttng Processor/\%name\%/{Threshold} \n
672  * The threshold in ADU. All pixels with a value below that will be
673  * disregarded. Should be set so that only pixels that will never ever
674  * be part of a bragg peak are excluded. Is put in to speed up the
675  * analysis. Default is 10.
676  * @cassttng Processor/\%name\%/{MinSignalToNoiseRatio} \n
677  * The signal to noise ratio that is used as main criteria to
678  * disregard a bright pixel from being a bragg spot. Default is 8
679  * @cassttng Processor/\%name\%/{MinSignalToNoiseRatioForNeighbours} \n
680  * Once a bright pixel is found the algorithm looks for neighbouring
681  * pixels that are also bright and will use this value for the
682  * criteria which is \f$(pixval - median / mad < snr)\f$. Default is
683  * 4.
684  * @cassttng Processor/\%name\%/{MaxAdditionalPixels} \n
685  * Within the box that we check the bright pixels for all the bright
686  * pixels will be counted. If there are too many bright pixlels that
687  * are not a neighbour of the main spot, the spot will be
688  * disregardeded of being a bragg spot. Default is 2.
689  * @cassttng Processor/\%name\%/{MinNbrPixels} \n
690  * The minimum number of pixels that the bragg spot should consist
691  * of.If the number of bright connected spots is smaller than this
692  * value the potential spot will be disregarded. Default is 2.
693  * @cassttng Processor/\%name\%/{BadPixelValue} \n
694  * The ADU value that all the bad pixels are set to. If a bad pixel is
695  * a neighbour of a potential spot the spot will be disregarded.
696  * @cassttng Processor/\%name\%/{BoxSizeX|BoxSizeY} \n
697  * The size of the box around the bright pixel that will be used to
698  * dertermine the median and the mad. Default is 5|5.
699  * @cassttng Processor/\%name\%/{SectionSizeX|SectionSizeY} \n
700  * The size of a section of the image. Usually one uses a the size of
701  * a tile of the detector, since the edges of the tiles are somhow
702  * brighter than the central pixels. The box around the bright pixel
703  * is not allowed to cross the section. Default is 1024|512.
704  *
705  *
706  * @author Lutz Foucar
707  */
708 class pp210 : public Processor
709 {
710 public:
711  /** constructor */
712  pp210(const name_t &name);
713 
714  /** load the settings for this processor */
715  virtual void loadSettings(size_t);
716 
717  /** process event */
718  virtual void process(const CASSEvent&, result_t&);
719 
720  /** definition of the table */
722 
723  /** define the type of the pixel in image */
724  typedef result_t::storage_t::value_type pixelval_t;
725 
726  /** define the type of statistics used */
728 
729  /** define the index in the image */
730  typedef int64_t index_t;
731 
732  /** define the shape of the image */
733  typedef std::pair<index_t,index_t> shape_t;
734 
735  /** define the list of neighbours */
736  typedef std::vector<index_t> neighbourList_t;
737 
738  /** enum describing the contents of the resulting table */
740  {
746  Index = 5,
747  Column = 6,
748  Row = 7,
751  MaxRadius = 10,
752  MinRadius = 11,
753  MaxADU = 12,
759  };
760 
761 protected:
762  /** the size of the box within which the peak should lie */
763  shape_t _box;
764 
765  /** processor containing the image to find the bragg peaks in */
767 
768  /** size of a image section */
769  shape_t _section;
770 
771  /** size of the incomming image */
772  shape_t _imageShape;
773 
774  /** minimum Signal to Noise Ratio thats is needed for a pixel to be an outlier */
776 
777  /** minimum snr when pixel is an neighbour */
778  pixelval_t _minNbrSnr;
779 
780  /** the minimum nbr of pixels in the bragg peak*/
782 
783  /** the list of offsets to next neighbours */
784  neighbourList_t _neighbourOffsets;
785 
786  /** pixel threshold to be exceeded */
787  pixelval_t _threshold;
788 
789  /** pixel value of a bad pixel */
790  pixelval_t _badPixVal;
791 
792  /** pixel value of a bad pixel */
794 };
795 
796 }//end namespace cass
797 
798 #endif
result_t::storage_t::value_type pixelval_t
define the type of the pixel in image
Definition: hitfinder.h:724
shared_pointer _noisePP
processor containing the noise image for thresholding
Definition: hitfinder.h:294
shared_pointer _wavelengthPP
pp containing wavelength in case its not fixed
Definition: hitfinder.h:538
storage_t::const_iterator const_iterator
a const iterator on the storage
Definition: result.hpp:338
virtual void loadSettings(size_t)
load the settings of this pp
Definition: hitfinder.cpp:407
double _detdist
the detector distance in case its fixed
Definition: hitfinder.h:544
pixelval_t _threshold
pixel threshold to be exceeded
Definition: hitfinder.h:553
float _minSnr
the min signal to noise ratio that needs to be exceeded
Definition: hitfinder.h:180
std::tr1::function< double(const CASSEvent::id_t &)> _getLambda
function that gets the wavelength
Definition: hitfinder.h:541
double lambdaFromProcessor(const CASSEvent::id_t &id)
retrieve the wavelength from the processor
Definition: hitfinder.cpp:881
size_t _idxCol
the number of the column where the global index of the pixel is
Definition: hitfinder.h:250
double distanceFromProcessor(const CASSEvent::id_t &id)
retrieve the detector distance from the processor
Definition: hitfinder.cpp:888
pp209(const name_t &name)
constructor
Definition: hitfinder.cpp:1150
Event to store all LCLS Data.
Definition: cass_event.h:32
float _minNeighbourSNR
the min signal to noise ratio that needs to be exceeded
Definition: hitfinder.h:183
find bragg peaks and store them in a list
Definition: hitfinder.h:97
result_t::value_t pixelval_t
define the values of the pixels
Definition: hitfinder.h:139
shared_pointer _table
pp containing the results
Definition: hitfinder.h:241
std::vector< value_t > storage_t
the storage of this container
Definition: result.hpp:332
std::tr1::function< double(const CASSEvent::id_t &)> _getDistance
function that gets the detectordistance
Definition: hitfinder.h:550
neighbourList_t _neighbourOffsets
the list of offsets to next neighbours
Definition: hitfinder.h:784
double _wavelength
the wavelength in case its fixed
Definition: hitfinder.h:535
shape_t _box
the size of the box within which the peak should lie
Definition: hitfinder.h:511
pp204(const name_t &name)
constructor
Definition: hitfinder.cpp:144
float _threshold
pixel threshold to be exceeded
Definition: hitfinder.h:307
float _multiplier
multiplier for the noise threshold
Definition: hitfinder.h:310
virtual void process(const CASSEvent &, result_t &)
process event
Definition: hitfinder.cpp:235
result_t::storage_t table_t
definition of the table
Definition: hitfinder.h:721
ColumnNames
enum describing the contents of the resulting table
Definition: hitfinder.h:619
virtual void process(const CASSEvent &, result_t &)
process event
Definition: hitfinder.cpp:985
const name_t name() const
retrieve the name of this processor
Definition: processor.h:167
file contains declaration of the CASSEvent
float value_t
the values of this container
Definition: result.hpp:326
result_t::storage_t table_t
definition of the table
Definition: hitfinder.h:114
stat_t::value_type _minSnr
minimum Signal to Noise Ratio thats is needed for a pixel to be an outlier
Definition: hitfinder.h:775
virtual void loadSettings(size_t)
load the settings for this processor
Definition: hitfinder.cpp:1388
shared_pointer _hist
pp containing 2d histogram
Definition: hitfinder.h:61
std::pair< int, int > _box
the size of the box within which the peak should lie
Definition: hitfinder.h:301
statistics calculator for a cummulative statistic, removes outliers
ColumnNames
enum describing the contents of the resulting table
Definition: hitfinder.h:118
pixelval_t thresholdFromProcessor(const CASSEvent::id_t &id)
retrieve the threshold from the processor
Definition: hitfinder.cpp:895
std::pair< index_t, index_t > shape_t
define the shape of the image
Definition: hitfinder.h:733
uint64_t id_t
define the id type
Definition: cass_event.h:52
std::pair< size_t, size_t > _sectionSize
size of a image section
Definition: hitfinder.h:67
std::pair< int, int > _boxsize
Definition: hitfinder.h:246
virtual void loadSettings(size_t)
load the settings of this pp
Definition: hitfinder.cpp:1156
find connected pixels, coalesce them and store them in a list
Definition: hitfinder.h:590
int getBoxStatistics(result_t::const_iterator centerPixel, const imagepos_t nColumns, pixelval_t &mean, pixelval_t &stdv, int &count)
check highest pixel and generate the mean and standart deviation
Definition: hitfinder.cpp:195
virtual void process(const CASSEvent &, result_t &)
process event
Definition: hitfinder.cpp:448
shared_pointer _detdistPP
pp containing detector distance in case its not fixed
Definition: hitfinder.h:547
ColumnNames
enum describing the contents of the resulting table
Definition: hitfinder.h:739
stat_t::count_type _minNbrPixels
the minimum nbr of pixels in the bragg peak
Definition: hitfinder.h:526
bool _drawBox
Definition: hitfinder.h:247
int64_t index_t
define the index in the image
Definition: hitfinder.h:413
std::pair< int, int > _section
size of a image section
Definition: hitfinder.h:304
shared_pointer _imagePP
processor containing the image to find the bragg peaks in
Definition: hitfinder.h:766
visualize the peaks that were found in the image itself
Definition: hitfinder.h:224
virtual void process(const CASSEvent &, result_t &)
process event
Definition: hitfinder.cpp:1442
double distanceFromConstant(const CASSEvent::id_t &)
retrieve the constant detector distance
Definition: hitfinder.h:489
std::tr1::function< pixelval_t(const CASSEvent::id_t &)> _thresh
function that gets the detectordistance
Definition: hitfinder.h:559
pp210(const name_t &name)
constructor
Definition: hitfinder.cpp:1382
shared_pointer _hist
processor containing the image to find the bragg peaks in
Definition: hitfinder.h:111
base class for processors.
Definition: processor.h:39
shape_t _imageShape
size of the incomming image
Definition: hitfinder.h:517
pixelval_t _minNbrSnr
minimum snr when pixel is an neighbour
Definition: hitfinder.h:778
result_t::value_t _drawInnerValue
Definition: hitfinder.h:244
std::pair< imagepos_t, imagepos_t > _section
size of a image section
Definition: hitfinder.h:171
result_t::value_t _drawVal
draw flags as bitmask
Definition: hitfinder.h:244
std::vector< double > _src2labradius
the conversion table from raw to lab
Definition: hitfinder.h:532
float _radius
Definition: hitfinder.h:245
virtual void process(const CASSEvent &, result_t &)
process event
Definition: hitfinder.cpp:64
neighbourList_t _neighbourOffsets
the list of offsets to next neighbours
Definition: hitfinder.h:529
result_t::storage_t table_t
definition of the table
Definition: hitfinder.h:604
shape_t _imageShape
size of the incomming image
Definition: hitfinder.h:646
virtual void loadSettings(size_t)
load the settings of this pp
Definition: hitfinder.cpp:697
neighbourList_t _neighbourOffsets
the list of offsets to next neighbours
Definition: hitfinder.h:649
double lambdaFromConstant(const CASSEvent::id_t &)
retrieve the constant wavelength
Definition: hitfinder.h:477
shape_t _section
size of a image section
Definition: hitfinder.h:769
pp203(const name_t &)
constructor
Definition: hitfinder.cpp:28
result_t::storage_t::value_type pixelval_t
define the type of the pixel in image
Definition: hitfinder.h:407
bool _drawInner
Definition: hitfinder.h:247
bool _drawCircle
Definition: hitfinder.h:247
size_t _maxAdditionalPixels
pixel value of a bad pixel
Definition: hitfinder.h:793
CummulativeStatisticsNoOutlier< pixelval_t > stat_t
define the type of statistics used
Definition: hitfinder.h:727
pp206(const name_t &name)
constructor
Definition: hitfinder.cpp:563
float _minRatio
minimum ratio of nbr of points used for statistics to nbr of outliers
Definition: hitfinder.h:523
find pixels of bragg peaks and store them in a list
Definition: hitfinder.h:277
shared_pointer _hist
pp containing 2d histogram
Definition: hitfinder.h:238
file contains processors baseclass declaration
std::pair< index_t, index_t > shape_t
define the shape of the image
Definition: hitfinder.h:613
result_t::storage_t table_t
definition of the table
Definition: hitfinder.h:297
std::vector< index_t > neighbourList_t
define the list of neighbours
Definition: hitfinder.h:419
std::pair< index_t, index_t > shape_t
define the shape of the image
Definition: hitfinder.h:416
shared_pointer _imagePP
processor containing the image to find the bragg peaks in
Definition: hitfinder.h:401
virtual void process(const CASSEvent &, result_t &)
process event
Definition: hitfinder.cpp:607
ColumnNames
enum describing the contents of the resulting table
Definition: hitfinder.h:422
int64_t index_t
define the index in the image
Definition: hitfinder.h:730
stat_t::count_type _minNbrPixels
the minimum nbr of pixels in the bragg peak
Definition: hitfinder.h:781
pp205(const name_t &name)
constructor
Definition: hitfinder.cpp:401
std::pair< imagepos_t, imagepos_t > _box
the size of the box within which the peak should lie
Definition: hitfinder.h:168
contains declarations of statistic calculators
std::vector< index_t > neighbourList_t
define the list of neighbours
Definition: hitfinder.h:736
shared_pointer _threshPP
processor containing the threshold for each pixel of the image
Definition: hitfinder.h:643
std::pair< size_t, size_t > _boxSize
the size of the box used for the median filter
Definition: hitfinder.h:64
pixelval_t _factor
the factor that the pixelwise threshold is multuplied with
Definition: hitfinder.h:652
shape_t _imageShape
size of the incomming image
Definition: hitfinder.h:772
result_t::storage_t::value_type pixelval_t
define the type of the pixel in image
Definition: hitfinder.h:607
std::vector< index_t > neighbourList_t
define the list of neighbours
Definition: hitfinder.h:616
pp208(const name_t &name)
constructor
Definition: hitfinder.cpp:690
int _minBckgndPixels
min amount of pixels for the background calc
Definition: hitfinder.h:186
int imagepos_t
define the positions in the image
Definition: hitfinder.h:142
int isNotHighest(result_t::const_iterator pixel, const index_t linIdx, shape_t box, stat_t &stat)
check if pixel is not highest within box
Definition: hitfinder.cpp:946
shape_t _box
the size of the box within which the peak should lie
Definition: hitfinder.h:763
float _threshold
pixel threshold to be exceeded
Definition: hitfinder.h:174
shape_t _section
size of a image section
Definition: hitfinder.h:514
pixelval_t thresholdFromConstant(const CASSEvent::id_t &id)
retrieve the threshold constant
Definition: hitfinder.cpp:902
get the local background from image.
Definition: hitfinder.h:47
pixelval_t _threshold
pixel threshold to be exceeded
Definition: hitfinder.h:787
shared_pointer _imagePP
processor containing the image to find the bragg peaks in
Definition: hitfinder.h:291
std::string name_t
define the name type
Definition: processor.h:46
shared_pointer _imagePP
processor containing the image
Definition: hitfinder.h:640
virtual void loadSettings(size_t)
load the settings of this pp
Definition: hitfinder.cpp:569
int16_t pixel
define a pixel
Definition: hlltypes.hpp:27
std::tr1::shared_ptr< Processor > shared_pointer
a shared pointer of this
Definition: processor.h:43
stat_t::value_type _minSnr
minimum Signal to Noise Ratio thats is needed for a pixel to be an outlier
Definition: hitfinder.h:520
virtual void loadSettings(size_t)
load the settings of this pp
Definition: hitfinder.cpp:34
result_t::storage_t table_t
definition of the table
Definition: hitfinder.h:404
virtual void loadSettings(size_t)
load the settings of this pp
Definition: hitfinder.cpp:150
find bragg peaks and store them in list
Definition: hitfinder.h:387
virtual void process(const CASSEvent &, result_t &)
process event
Definition: hitfinder.cpp:1223
CummulativeStatisticsNoOutlier< pixelval_t > stat_t
define the type of statistics used
Definition: hitfinder.h:410
int64_t index_t
define the index in the image
Definition: hitfinder.h:610
pixelval_t _badPixVal
pixel value of a bad pixel
Definition: hitfinder.h:790
shared_pointer _threshPP
pp containing threshold in case its not fixed
Definition: hitfinder.h:556
std::iterator_traits< iterator_t >::difference_type count_type
define number of elements
int _peakRadiusSq
the square size of bragg peak radius
Definition: hitfinder.h:177
int getBoxStatistics(result_t::const_iterator pixel, const index_t linIdx, const shape_t &box, stat_t &stat)
retrieve the box statistics
Definition: hitfinder.cpp:907