CFEL - ASG Software Suite  2.5.0
CASS
pixel_finder_simple.h
Go to the documentation of this file.
1 // Copyright (C) 2011 Lutz Foucar
2 
3 /**
4  * @file pixel_finder_simple.h contains pixel finder that works like Per Johnsons
5  *
6  * @author Lutz Foucar
7  */
8 
9 #ifndef _PIXELFINDER_SIMPLE_H_
10 #define _PIXELFINDER_SIMPLE_H_
11 
12 #include "pixel_finder_base.h"
13 #include "pixeldetector.hpp"
14 
15 namespace cass
16 {
17 namespace pixeldetector
18 {
19 /** simple algorithm to find pixels of interest
20  *
21  * the algorithm is taken from Per Johnsons code and is just put into a functor.
22  *
23  * @cassttng PixelDetectors/\%name\%/SimpleFinder/{Threshold}\n
24  * The threshold above which the pixels have to be. Default is 0.
25  *
26  * @author Per Johnson
27  * @author Lutz Foucar
28  */
30 {
31 public:
32  /** constructor */
34 
35  /** find the pixels
36  *
37  * take the input frame and search it for pixels which are put into the
38  * list of pixels.\n
39  * Go through the whole frame and check wether a pixel is above the
40  * threshold. If so then check whether the sourrounding pixels all have
41  * a smaller value. If this is the case and the pixel is not at the edge of
42  * the frame add the pixel to the list of pixels
43  *
44  * @return reference to the pixel list
45  * @param frame the frame containing the pixels of interest
46  * @param pixels the list of pixels that should be found
47  */
48  pixels_t& operator() (const Frame &frame, pixels_t &pixels);
49 
50  /** load the settings of this
51  *
52  * @param s the CASSSettings object to read the information from
53  */
54  void loadSettings(CASSSettings &s);
55 
56 private:
57  /** the threshold above which the pixels have to be */
59 };
60 
61 
62 /** same as simple, but with adjustable box size
63  *
64  * the algorithm is an enhanced version of pers code where one can choose the
65  * size of the box to be checked.
66  *
67  * @cassttng PixelDetectors/\%name\%/SimpleFinder/{SquareSize}\n
68  * The size of the box.
69  * @cassttng PixelDetectors/\%name\%/SimpleFinder/{Threshold}\n
70  * The threshold above which the pixels have to be. Default is 0.
71  *
72  * @author Per Johnson
73  * @author Lutz Foucar
74  */
76 {
77 public:
78  /** constructor */
80 
81  /** find the pixels
82  *
83  * take the input frame and search it for pixels which are put into the
84  * list of pixels.\n
85  * Go through the whole frame and check wether a pixel is above the
86  * threshold. If so then check whether the sourrounding pixels in a box
87  * all have a smaller value. If this is the case and the pixel is not
88  * at the edge of the frame add the pixel to the list of pixels
89  *
90  * @return reference to the pixel list
91  * @param frame the frame containing the pixels of interest
92  * @param pixels the list of pixels that should be found
93  */
94  pixels_t& operator() (const Frame &frame, pixels_t &pixels);
95 
96  /** load the settings of this
97  *
98  * @param s the CASSSettings object to read the information from
99  */
100  void loadSettings(CASSSettings &s);
101 
102 private:
103  /** the threshold above which the pixels have to be */
105 
106  /** the size of the square to check */
108 };
109 
110 
111 /** within range
112  *
113  * will check whether pixels are within a user set range.
114  *
115  * @cassttng PixelDetectors/\%name\%/InRangeFinder/{LowerThreshold}\n
116  * The threshold above which the pixels have to be. Default is 0.
117  * @cassttng PixelDetectors/\%name\%/InRangeFinder/{UpperThreshold}\n
118  * The threshold above which the pixels have to be. Default is 1e6.
119  *
120  * @author Lutz Foucar
121  */
123 {
124 public:
125  /** constructor */
126  WithinRange();
127 
128  /** find the pixels
129  *
130  * checks whether the pixel is in the user set range. If so add it to the
131  * pixel list.
132  *
133  * @return reference to the pixel list
134  * @param frame the frame containing the pixels of interest
135  * @param pixels the list of pixels that should be found
136  */
137  pixels_t& operator() (const Frame &frame, pixels_t &pixels);
138 
139  /** load the settings of this
140  *
141  * @param s the CASSSettings object to read the information from
142  */
143  void loadSettings(CASSSettings &s);
144 
145 private:
146  /** the threshold above which the pixels have to be */
147  std::pair<Detector::pixel_t,Detector::pixel_t> _range;
148 };
149 }//end namespace pixeldetector
150 }//end namespace cass
151 
152 #endif
same as simple, but with adjustable box size
Settings for CASS.
Definition: cass_settings.h:30
void loadSettings(CASSSettings &s)
load the settings of this
simple algorithm to find pixels of interest
void loadSettings(CASSSettings &s)
load the settings of this
pixels_t & operator()(const Frame &frame, pixels_t &pixels)
find the pixels
float pixel_t
define a pixel of the pixel detector
std::pair< Detector::pixel_t, Detector::pixel_t > _range
the threshold above which the pixels have to be
Detector::pixel_t _threshold
the threshold above which the pixels have to be
std::vector< Pixel > pixels_t
the list of pixels
Detector::pixel_t _threshold
the threshold above which the pixels have to be
contains base class for all pixel finders.
pixels_t & operator()(const Frame &frame, pixels_t &pixels)
find the pixels
int _squaresize
the size of the square to check
A Frame of an advance Pixel Detector.
contains container for simple pixel detector data
base class for pixel finders
pixels_t & operator()(const Frame &frame, pixels_t &pixels)
find the pixels
void loadSettings(CASSSettings &s)
load the settings of this