CFEL - ASG Software Suite  2.5.0
CASS
image_manipulation.h
Go to the documentation of this file.
1 // Copyright (C) 2012 Lutz Foucar
2 
3 /**
4  * @file image_manipulation.h file contains processors that will manipulate
5  * 2d histograms
6  *
7  * @author Lutz Foucar
8  */
9 
10 #ifndef _IMAGEMANIPULATION_H__
11 #define _IMAGEMANIPULATION_H__
12 
13 #include <utility>
14 #include <string>
15 #include <tr1/functional>
16 
17 #include "processor.h"
18 
19 #include "geom_parser.h"
20 
21 namespace cass
22 {
23 //forward declarations
24 class SegmentCopier;
25 
26 /** matrix rotation struct
27  *
28  * tell how much one has to advance in the destination matrix when one advances
29  * by one in the src matrix
30  *
31  * @author Lutz Foucar
32  */
33 struct Rotor
34 {
35  /** contructor
36  *
37  * intializes the struct in the proper way
38  *
39  * @param cc steps to increase in the dest columns when src column is increased by one
40  * @param cr steps to increase in the dest columns when src row is increased by one
41  * @param rc steps to increase in the dest row when src column is increased by one
42  * @param rr steps to increase in the dest row when src row is increased by one
43  */
44  Rotor(char cc, char cr, char rc, char rr)
45  : incDestColPerSrcCol(cc),
49  {}
50 
51  /** steps to increase in the dest columns when src column is increased by one*/
53 
54  /** steps to increase in the dest columns when src row is increased by one*/
56 
57  /** steps to increase in the dest row when src column is increased by one*/
59 
60  /** steps to increase in the dest row when src row is increased by one*/
62 };
63 
64 
65 
66 
67 
68 /** rotate, transpose, invert axis on 2d result.
69  *
70  * @PPList "55": rotate, transpose or invert axis on 2d result
71  *
72  * @see Processor for a list of all commonly available cass.ini
73  * settings.
74  *
75  * @cassttng Processor/\%name\%/{ImageName} \n
76  * the processor name that contain the first histogram. Default
77  * is "".
78  * @cassttng Processor/\%name\%/{Operation} \n
79  * the operation that one wants to perform on the 2d histogram.
80  * Default is "90DegCCW". Possible values are:
81  * - "90DegCCW" or "270DegCW": rotate the 2d hist by 90 deg counter
82  * clock wise bzw. 270 deg clock wise
83  * - "270DegCCW" or "90DegCW": rotate the 2d hist by 270 deg counter
84  * clock wise bzw. 90 deg clock wise
85  * - "180Deg": rotate the 2d hist by 180 deg
86  * - "Transpose": transpose x and y axis of the 2d hist
87  * - "FlipVertical": flip the 2d hist vertically
88  * - "FlipHorizontal": flip the 2d hist horizontally
89  *
90  * @author Lutz Foucar
91  */
92 class pp55 : public Processor
93 {
94 public:
95  /** constructor */
96  pp55(const name_t &);
97 
98  /** process event
99  *
100  * @param evt the event to process
101  * @param result the histogram where the result will be written to
102  */
103  virtual void process(const CASSEvent& evt, result_t&);
104 
105  /** load the settings of this pp
106  *
107  * @param unused this parameter is not used
108  */
109  virtual void loadSettings(size_t /*unused*/);
110 
111 protected:
112  /** functions to calc the index of source from the indizes of the destination */
113  typedef std::tr1::function<size_t(size_t, size_t, const std::pair<size_t,size_t>&)> func_t;
114 
115  /** pp containing 2d histogram */
117 
118  /** the size of the original histogram */
119  std::pair<size_t,size_t> _size;
120 
121  /** function that will calc the corresponding bin */
123 
124  /** container for all functions */
125  std::map<std::string, std::pair<func_t,bool> > _functions;
126 
127  /** the user chosen operation */
128  std::string _operation;
129 };
130 
131 
132 
133 
134 
135 
136 /** convert cspad 2d histogram into cheetah layout
137  *
138  * @PPList "1600": convert cass to cheetah layout
139  *
140  * The CASS layout is just every segement on top of each other as follows:
141  *
142 @verbatim
143  +-------------+
144  | 31 |
145  +-------------+
146  | 30 |
147  +-------------+
148  | 29 |
149  +-------------+
150  .
151  .
152  .
153  +-------------+
154  | 02 |
155  +-------------+
156 ^ | 01 |
157 | +-------------+
158 y | 00 |
159 | +-------------+
160 +---x--->
161 @endverbatim
162  * wheras the Cheetah layout puts the segemtns of the quadrant into one column as
163  * follows:
164 @verbatim
165  +-------------+-------------+-------------+-------------+
166  | 07 | 15 | 23 | 31 |
167  +-------------+-------------+-------------+-------------+
168  | 06 | 14 | 22 | 30 |
169  +-------------+-------------+-------------+-------------+
170  | 05 | 13 | 21 | 29 |
171  +-------------+-------------+-------------+-------------+
172  | 04 | 12 | 20 | 28 |
173  +-------------+-------------+-------------+-------------+
174  | 03 | 11 | 19 | 27 |
175  +-------------+-------------+-------------+-------------+
176  | 02 | 10 | 18 | 26 |
177  +-------------+-------------+-------------+-------------+
178 ^ | 01 | 09 | 17 | 25 |
179 | +-------------+-------------+-------------+-------------+
180 y | 00 | 08 | 16 | 24 |
181 | +-------------+-------------+-------------+-------------+
182 +---x--->
183 @endverbatim
184  *
185  *
186  * @see Processor for a list of all commonly available cass.ini
187  * settings.
188  *
189  * @cassttng Processor/\%name\%/{ImageName} \n
190  * the processor name that contains the histogram containing the
191  * cspad image in cass layout. Default is "".
192  *
193  * @author Lutz Foucar
194  */
195 class pp1600 : public Processor
196 {
197 public:
198  /** constructor */
199  pp1600(const name_t &);
200 
201  /** process event */
202  virtual void process(const CASSEvent& evt, result_t&);
203 
204  /** load the settings of this pp
205  *
206  * @param unused this parameter is not used
207  */
208  virtual void loadSettings(size_t unused);
209 
210 protected:
211  /** pp containing 2d histogram */
213 
214  /** nbr bins in x of asic */
215  const size_t _nx;
216 
217  /** nbr bins in y of asic */
218  const size_t _ny;
219 
220  /** magic cheetah number */
221  const size_t _na;
222 };
223 
224 
225 
226 
227 
228 /** convert cspad 2d histogram into a quasi oriented layout
229  *
230  * @PPList "12": Constant Value
231  *
232  * Converts the cass representation of the CsPad where all segments are in a
233  * linearized matrix on top of each other where the origin is in the lower left
234  * corner like follows (see also cass::pixeldetector::Converter). There are
235  * 2*194 pixels along the x-axis and 185 pixels along y in one segment.
236 @verbatim
237  +-------------+
238  | 31 |
239  +-------------+
240  | 30 |
241  +-------------+
242  | 29 |
243  +-------------+
244  .
245  .
246  .
247  +-------------+
248  | 02 |
249  +-------------+
250 ^ | 01 |
251 | +-------------+
252 y | 00 |
253 | +-------------+
254 +---x--->
255 @endverbatim
256  * These segments have to be rearranged to get the quasi physical layout of the
257  * CsPad. Following the description given in ElementIterator.hh. One has to
258  * arrange the segments as follows. The arrows denote the origin of the segment
259  * in the source. The x axis of the source follows always the longer edge of the
260  * rectangular segment shape. The y axis of the source matrix the shorter edge.
261  * With this one looks at the detector from upstream, thus having a left handed
262  * coordinate system since increasing x values go from left to right, where in
263  * an right handed coordinates system it should go from right to left.
264 @verbatim
265  <---+ <---+ +---> <---+ <---+
266  +----+| +----+| |+-------------+ +----+| +----+| +-------------+
267  | |v | |v v| 06 | | |v | |V | 13 |^
268  | | | | +-------------+ | | | | +-------------+|
269  | | | | | | | | <---+
270  | 05 | | 04 | | 11 | | 10 |
271  | | | | +---> | | | |
272  | | | | |+-------------+ | | | | +-------------+
273  | | | | V| 07 | | | | | | 12 |^
274  +----+ +----+ +-------------+ +----+ +----+ +-------------+|
275  <---+
276  quadrant 0 quadrant 1
277  +---> +---> <---+ <---+
278  |+------------ + +----+ +----+ |+------------ + +----+| +----+|
279  v| 02 | | | | | v| 08 | | |v | |v
280  +-------------+ | | | | +-------------+ | | | |
281  | | | | | | | |
282  | 00 | | 01 | | 15 | | 14 |
283  +---> | | | | +---> | | | |
284  |+-------------+ | | | | |+-------------+ | | | |
285  v| 03 | ^| | ^| | v| 09 | | | | |
286  +-------------+ |+----+ |+----+ +-------------+ +----+ +----+
287  +---> +--->
288 
289 
290  X
291 
292  <---+ <---+
293  +----+ +----+ +-------------+ +----+| +----+| +-------------+
294  | | | | | 25 |^ | |v | |v | 19 |^
295  | | | | +-------------+| | | | | +-------------+|
296  | | | | <---+ | | | | <---+
297  | 30 | | 31 | | 17 | | 16 |
298  | | | | | | | |
299  | | | | +-------------+ | | | | +-------------+
300  ^| | ^| | | 24 |^ | | | | | 18 |^
301  |+----+ |+----+ +-------------+| +----+ +----+ +-------------+|
302  +---> +---> <---+ <---+
303  quadrant 3 quadrant 2
304  +--->
305  |+------------ + +----+ +----+ +------------ + +----+ +----+
306  v| 28 | | | | | | 23 |^ | | | |
307  +-------------+ | | | | +-------------+| | | | |
308  | | | | <---+ | | | |
309  | 26 | | 27 | | 20 | | 21 |
310  +---> | | | | | | | |
311  |+-------------+ | | | | +-------------+ | | | |
312  v| 29 | ^| | ^| | | 22 |^ ^| | ^| |
313  +-------------+ |+----+ |+----+ +-------------+| |+----+ |+----+
314  +---> +---> <---+ +---> +--->
315 @endverbatim
316  * @see Processor for a list of all commonly available cass.ini
317  * settings.
318  *
319  * @cassttng Processor/\%name\%/{ImageName} \n
320  * the processor name that contains the histogram containing the
321  * cspad image in cass layout. Default is "".
322  *
323  * @author Lutz Foucar
324  */
325 class pp1601 : public Processor
326 {
327 public:
328  /** constructor */
329  pp1601(const name_t &);
330 
331  /** process event */
332  virtual void process(const CASSEvent& evt, result_t&);
333 
334  /** load the settings of this pp
335  *
336  * @param unused this parameter is not used
337  */
338  virtual void loadSettings(size_t unused);
339 
340 protected:
341  /** pp containing 2d histogram */
343 
344 private:
345  std::tr1::shared_ptr<SegmentCopier> _copyMatrixSegment;
346  /** the rotation matrix if x of src goes from (L)eft to (R)ight in dest and
347  * y of the src goes from (T)op to (B)ottom in destination
348  */
349  const Rotor _LRTB;
350 
351  /** the rotation matrix if x of src goes from (R)ight to (L)eft in dest and
352  * y of the src goes from (B)ottom to (T)op in destination
353  */
354  const Rotor _RLBT;
355 
356  /** the rotation matrix if x of src goes from (T)op to (B)ottom in dest and
357  * y of the src goes from (R)ight to (L)eft in destination
358  */
359  const Rotor _TBRL;
360 
361  /** the rotation matrix if x of src goes from (B)ottom to (T)op in dest and
362  * y of the src goes from (L)eft to (R)ight in destination
363  */
364  const Rotor _BTLR;
365 
366  /** nbr bins in x of asic */
367  const size_t _nx;
368 
369  /** nbr bins in y of asic */
370  const size_t _ny;
371 };
372 
373 
374 
375 
376 
377 
378 
379 
380 
381 
382 /** convert cspad data into laboratory frame using crystfel geometry files
383  *
384  * @PPList "1602": convert cspad data into labframe with geom file
385  *
386  * generates a lookup table of where in the result image will go which pixel
387  *
388  * to generate a right handed corrdinate system one has to arrange the tiles
389  * that are in the CASS layout as follows:
390 @verbatim
391  +-------------+
392  | 31 |
393  +-------------+
394  | 30 |
395  +-------------+
396  | 29 |
397  +-------------+
398  .
399  .
400  .
401  +-------------+
402  | 02 |
403  +-------------+
404 ^ | 01 |
405 | +-------------+
406 y | 00 |
407 | +-------------+
408 +---x--->
409 @endverbatim
410  * to the following layout. The gaps in between the different segments are non
411  * equi distant!
412 @verbatim
413  +---> +---> <---+ +---> +--->
414  +------------ + |+----+ |+----+ +------------ +| |+----+ |+----+
415  ^| 13 | V| | V| | | 06 |V V| | V| |
416  |+-------------+ | | | | +-------------+ | | | |
417  +---> | | | | | | | |
418  | 10 | | 11 | | 04 | | 05 |
419  | | | | <---+ | | | |
420  +-------------+ | | | | +-------------+| | | | |
421  ^| 12 | | | | | | 07 |V | | | |
422  |+-------------+ +----+ +----+ +-------------+ +----+ +----+
423  +--->
424  quadrant 1 quadrant 0
425  +---> +---> <---+ <---+
426  |+----+ |+----+ +-------------+| +----+ +----+ +-------------+|
427  V| | V| | | 08 |V | | | | | 02 |V
428  | | | | +-------------+ | | | | +-------------+
429  | | | | | | | |
430  | 14 | | 15 | | 01 | | 00 |
431  | | | | <---+ | | | | <---+
432  | | | | +-------------+| | | | | +-------------+|
433  | | | | | 09 |V | |^ | |^ | 03 |V
434  +----+ +----+ +-------------+ +----+| +----+| +-------------+
435  <---+ <---+
436 
437  .
438 
439  +---> +--->
440  +------------ + |+----+ |+----+ +------------ + +----+ +----+
441  ^| 19 | V| | V| | ^| 25 | | | | |
442  |+-------------+ | | | | |+-------------+ | | | |
443  +---> | | | | +---> | | | |
444  | 16 | | 17 | | 31 | | 30 |
445  | | | | | | | |
446  +-------------+ | | | | +-------------+ | | | |
447  ^| 18 | | | | | ^| 24 | | |^ | |^
448  |+-------------+ +----+ +----+ |+-------------+ +----+| +----+|
449  +---> +---> <---+ <---+
450  quadrant 2 quadrant 3
451  <---+
452  +----+ +----+ +-------------+ +----+ +----+ +-------------+|
453  | | | | ^| 23 | | | | | | 28 |V
454  | | | | |+-------------+ | | | | +-------------+
455  | | | | +---> | | | |
456  | 21 | | 20 | | 27 | | 26 |
457  | | | | | | | | <---+
458  | | | | +-------------+ | | | | +-------------+|
459  | |^ | |^ ^| 22 | | |^ | |^ | 29 |V
460  +----+| +----+| |+-------------+ +----+| +----+| +-------------+
461  <---+ <---+ +---> <---+ <---+
462 @endverbatim
463  * One can assume that the geom file doesn't translate from the cass layout shown
464  * above, but from the cheetah layout (see cass::pp1600). In this case one has
465  * to set the ConvertCheetahToCASSLayout to true (default)
466  *
467  * @see Processor for a list of all commonly available cass.ini
468  * settings.
469  *
470  * @cassttng Processor/\%name\%/{ImageName} \n
471  * the processor name that contains the histogram containing the
472  * cspad image in cass layout. Default is "".
473  * @cassttng Processor/\%name\%/{GeometryFilename} \n
474  * @cassttng Processor/\%name\%/{ConvertCheetahToCASSLayout} \n
475  * @cassttng Processor/\%name\%/{BackgroundValue} \n
476  *
477  * @author Lutz Foucar
478  */
479 class pp1602 : public Processor
480 {
481 public:
482  /** constructor */
483  pp1602(const name_t &);
484 
485  /** process event */
486  virtual void process(const CASSEvent& evt, result_t&);
487 
488  /** load the settings of this pp
489  *
490  * @param unused this parameter is not used
491  */
492  virtual void loadSettings(size_t unused);
493 
494 protected:
495  /** generate the lookup table by parsing the geom file */
496  void setup(const result_t &srcImageHist);
497 
498  /** pp containing 2d histogram */
500 
501  /** the lookup table */
503 
504  /** flag whether to convert the positions in the src from cheetah to cass layout */
506 
507  /** the value with wich the background should be filled */
509 
510  /** filename of the geometry file */
511  std::string _filename;
512 };
513 
514 
515 
516 
517 
518 
519 
520 
521 
522 
523 
524 /** Create a radial average of q values from a raw detector image
525  *
526  * @PPList "90": Radial average from detector image using geom
527  *
528  * calculate the Q value for each Pixel using the geom file.
529  *
530  * @see Processor for a list of all commonly available cass.ini
531  * settings.
532  *
533  * @cassttng Processor/\%name\%/{ImageName} \n
534  * the processor name that contains the histogram containing the
535  * cspad image in cass layout. Default is "".
536  * @cassttng Processor/\%name\%/{GeometryFilename} \n
537  * The geom file to use. Default is "cspad.geom".
538  * @cassttng Processor/\%name\%/{ConvertCheetahToCASSLayout} \n
539  * Set this true if the geom file is for a cheetah layout of the data,
540  * but the image in ImageName is the image in CASS layout.
541  * @cassttng Processor/\%name\%/{Wavelength_A} \n
542  * The wavelength in Angstroem. Can also be the name of a PP that
543  * contains the Wavelength. Default is 1.
544  * @cassttng Processor/\%name\%/{DetectorDistance_m} \n
545  * The detector distance in m. Can also be the name of a PP that
546  * contains the detector distance. Default is 60e-2.
547  * @cassttng Processor/\%name\%/{PixelSize_m} \n
548  * The pixel size in m. Default is 110e-6
549  * @cassttng Processor/\%name\%/{XNbrBins|XLow|XUp}\n
550  * properties of the resulting 1D histogram
551  * @cassttng Processor/\%name\%/{BadPixelValue}\n
552  * value of the bad pixel in the image. Default is 0
553  * @cassttng Processor/\%name\%/{Output}\n
554  * One can choose the type of radial average that one wants to have.
555  * Default is "Q". Possible values are:
556  * - "Q": the q-averge in the defintion of q that SAXS people are
557  * using. See pp90::Q for details.
558  * - "Resolution": the radial average in resultion values as defined
559  * by the crystallographers. See pp90::R for details.
560  * - "Radius": the radial average in radii, where the Pixelsize_m
561  * parameter is used to determine the radius. If one wants
562  * to have the radius in pixel units, one just has to set
563  * the PixelSize_m parameter to 1.
564  *
565  * @author Lutz Foucar
566  */
567 class pp90 : public Processor
568 {
569 public:
570  /** constructor */
571  pp90(const name_t &);
572 
573  /** process event */
574  virtual void process(const CASSEvent& evt, result_t&);
575 
576  /** load the settings of this pp
577  *
578  * @param unused this parameter is not used
579  */
580  virtual void loadSettings(size_t unused);
581 
582 protected:
583  /** define the table row of a single output */
584  struct temp_t
585  {
586  temp_t(): weight(0), fill(0), bin(0) {}
589  size_t bin;
590  };
591 
592  /** define the matrix */
593  typedef std::vector<temp_t> tempArray_t;
594 
595 protected:
596  /** retrieve the constant wavelength
597  *
598  * @param id unused
599  */
600  double wlFromConstant(const CASSEvent::id_t&) {return _wavelength;}
601 
602  /** retrieve the wavelength from the processor
603  *
604  * @param id the id of the event to get the wavelength from
605  */
606  double wlFromProcessor(const CASSEvent::id_t& id);
607 
608  /** retrieve the constant detector distance
609  *
610  * @param id unused
611  */
612  double ddFromConstant(const CASSEvent::id_t&) {return _detdist;}
613 
614  /** retrieve the detector distance from the processor
615  *
616  * @param id the id of the event to get the detector distance from
617  */
618  double ddFromProcessor(const CASSEvent::id_t& id);
619 
620  /** get the bin when the q-value of the pixel is asked
621  *
622  * the q-value will be calculated using formula
623  * \f[
624  * Q = \frac{4\pi}{\lambda} \sin\left(\frac{1}{2}\arctan\left(\frac{r}{d}\right)\right)
625  * \f]
626  * with \f$\lambda\f$ being the wavelength in \f$\AA\f$, \f$r\f$ the radius
627  * of the pixel and \f$d\f$ the detector distance.
628  *
629  * @return the struct that tell the bin, value, fill combination
630  * @param lambda the wavelength
631  * @param D the detector distance
632  * @param pixval the value of the pixel
633  * @param pixpos the position of the pixel in m
634  */
635  temp_t Q(const double lambda, const double D, const result_t::value_t& pixval,
636  const GeometryInfo::pos_t& pixpos);
637 
638  /** get the bin when the resolution value of the pixel is asked
639  *
640  * the resultion will be calculated as follows
641  * \f[
642  * R = \frac{1}{\frac{2}{\lambda}\sin\left(\frac{1}{2}\arctan\left(\frac{r}{d}\right)\right)}
643  * \f]
644  * with \f$\lambda\f$ being the wavelength in \f$\AA\f$, \f$r\f$ the radius
645  * of the pixel and \f$d\f$ the detector distance.
646  *
647  * @return the struct that tell the bin, value, fill combination
648  * @param lambda the wavelength
649  * @param D the detector distance
650  * @param pixval the value of the pixel
651  * @param pixpos the position of the pixel in m
652  */
653  temp_t R(const double lambda, const double D, const result_t::value_t& pixval,
654  const GeometryInfo::pos_t& pixpos);
655 
656  /** get the bin when the radius of the pixel is asked
657  *
658  *
659  * @return the struct that tell the bin, value, fill combination
660  * @param lambda unused
661  * @param D unused
662  * @param pixval the value of the pixel
663  * @param pixpos the position of the pixel in m
664  */
665  temp_t Rad(const double lambda, const double D,
666  const result_t::value_t& pixval,
667  const GeometryInfo::pos_t& pixpos);
668 
669 protected:
670  /** pp containing 2d histogram */
672 
673  /** define the normalization factors */
674  typedef std::vector<result_t::value_t> normfactors_t;
675 
676  /** flag whether to convert the positions in the src from cheetah to cass layout */
678 
679  /** filename of the geometry file */
680  std::string _filename;
681 
682  /** the pixel positions */
684 
685  /** the wavelength in case its fixed */
686  double _wavelength;
687 
688  /** pp containing wavelength in case its not fixed */
690 
691  /** function that gets the wavelength */
692  std::tr1::function<double(const CASSEvent::id_t&)> _getWavelength;
693 
694  /** the detector distance in case its fixed */
695  double _detdist;
696 
697  /** pp containing detector distance in case its not fixed */
699 
700  /** function that gets the detectordistance */
701  std::tr1::function<double(const CASSEvent::id_t&)> _getDetectorDistance;
702 
703  /** the size of one pixel in m */
704  double _np_m;
705 
706  /** value of the bad pixels */
707  float _badPixVal;
708 
709  /** function to map the pixel to histogram bin, value and fill flag */
710  std::tr1::function<temp_t(const double,const double,const result_t::value_t&,
712 
713  /** the axis of the result */
715 };
716 
717 
718 
719 }//end namspace cass
720 #endif
double _np_m
the size of one pixel in m
GeometryInfo::lookupTable_t _lookupTable
the lookup table
std::string _filename
filename of the geometry file
const size_t _nx
nbr bins in x of asic
std::pair< size_t, size_t > _size
the size of the original histogram
Create a radial average of q values from a raw detector image.
Event to store all LCLS Data.
Definition: cass_event.h:32
pp1600(const name_t &)
constructor
virtual void process(const CASSEvent &evt, result_t &)
process event
pp55(const name_t &)
constructor
shared_pointer _one
pp containing 2d histogram
result_t::value_t weight
virtual void process(const CASSEvent &evt, result_t &)
process event
result_t::axe_t _axis
the axis of the result
float value_t
the values of this container
Definition: result.hpp:326
virtual void loadSettings(size_t unused)
load the settings of this pp
const Rotor _TBRL
the rotation matrix if x of src goes from (T)op to (B)ottom in dest and y of the src goes from (R)igh...
double _wavelength
the wavelength in case its fixed
float _badPixVal
value of the bad pixels
std::map< std::string, std::pair< func_t, bool > > _functions
container for all functions
std::string _operation
the user chosen operation
uint64_t id_t
define the id type
Definition: cass_event.h:52
func_t _pixIdx
function that will calc the corresponding bin
std::vector< pos_t > conversion_t
define the conversion table type
Definition: geom_parser.h:29
convert cspad 2d histogram into cheetah layout
std::tr1::function< temp_t(const double, const double, const result_t::value_t &, const GeometryInfo::pos_t &)> _getBin
function to map the pixel to histogram bin, value and fill flag
double _detdist
the detector distance in case its fixed
const Rotor _LRTB
the rotation matrix if x of src goes from (L)eft to (R)ight in dest and y of the src goes from (T)op ...
Axis< double > axe_t
the axis descriptions of this container
Definition: result.hpp:353
combine the position in the lab into a struct
Definition: geom_parser.h:20
std::tr1::function< double(const CASSEvent::id_t &)> _getDetectorDistance
function that gets the detectordistance
const size_t _nx
nbr bins in x of asic
char incDestRowPerSrcCol
steps to increase in the dest row when src column is increased by one
float _backgroundValue
the value with wich the background should be filled
temp_t Rad(const double lambda, const double D, const result_t::value_t &pixval, const GeometryInfo::pos_t &pixpos)
get the bin when the radius of the pixel is asked
bool _convertCheetahToCASSLayout
flag whether to convert the positions in the src from cheetah to cass layout
matrix rotation struct
virtual void loadSettings(size_t unused)
load the settings of this pp
shared_pointer _imagePP
pp containing 2d histogram
base class for processors.
Definition: processor.h:39
virtual void process(const CASSEvent &evt, result_t &)
process event
temp_t R(const double lambda, const double D, const result_t::value_t &pixval, const GeometryInfo::pos_t &pixpos)
get the bin when the resolution value of the pixel is asked
virtual void loadSettings(size_t unused)
load the settings of this pp
define the table row of a single output
Rotor(char cc, char cr, char rc, char rr)
contructor
pp90(const name_t &)
constructor
result_t::value_t fill
pp1602(const name_t &)
constructor
const size_t _ny
nbr bins in y of asic
pp1601(const name_t &)
constructor
char incDestColPerSrcRow
steps to increase in the dest columns when src row is increased by one
std::vector< temp_t > tempArray_t
define the matrix
GeometryInfo::conversion_t _pixPositions_m
the pixel positions
class to parse and retrieve info from geom files.
file contains processors baseclass declaration
char incDestRowPerSrcRow
steps to increase in the dest row when src row is increased by one
std::tr1::function< size_t(size_t, size_t, const std::pair< size_t, size_t > &)> func_t
functions to calc the index of source from the indizes of the destination
std::vector< result_t::value_t > normfactors_t
define the normalization factors
convert cspad data into laboratory frame using crystfel geometry files
std::string _filename
filename of the geometry file
double wlFromConstant(const CASSEvent::id_t &)
retrieve the constant wavelength
void setup(const result_t &srcImageHist)
generate the lookup table by parsing the geom file
combine info needed for the lookuptable
Definition: geom_parser.h:32
virtual void process(const CASSEvent &evt, result_t &)
process event
const Rotor _RLBT
the rotation matrix if x of src goes from (R)ight to (L)eft in dest and y of the src goes from (B)ott...
rotate, transpose, invert axis on 2d result.
std::tr1::shared_ptr< SegmentCopier > _copyMatrixSegment
virtual void loadSettings(size_t unused)
load the settings of this pp
bool _convertCheetahToCASSLayout
flag whether to convert the positions in the src from cheetah to cass layout
shared_pointer _one
pp containing 2d histogram
char incDestColPerSrcCol
steps to increase in the dest columns when src column is increased by one
const size_t _na
magic cheetah number
virtual void loadSettings(size_t)
load the settings of this pp
virtual void process(const CASSEvent &evt, result_t &)
process event
double ddFromProcessor(const CASSEvent::id_t &id)
retrieve the detector distance from the processor
shared_pointer _imagePP
pp containing 2d histogram
shared_pointer _wavelengthPP
pp containing wavelength in case its not fixed
std::string name_t
define the name type
Definition: processor.h:46
shared_pointer _one
pp containing 2d histogram
std::tr1::shared_ptr< Processor > shared_pointer
a shared pointer of this
Definition: processor.h:43
convert cspad 2d histogram into a quasi oriented layout
temp_t Q(const double lambda, const double D, const result_t::value_t &pixval, const GeometryInfo::pos_t &pixpos)
get the bin when the q-value of the pixel is asked
shared_pointer _detdistPP
pp containing detector distance in case its not fixed
std::tr1::function< double(const CASSEvent::id_t &)> _getWavelength
function that gets the wavelength
double wlFromProcessor(const CASSEvent::id_t &id)
retrieve the wavelength from the processor
const size_t _ny
nbr bins in y of asic
double ddFromConstant(const CASSEvent::id_t &)
retrieve the constant detector distance
const Rotor _BTLR
the rotation matrix if x of src goes from (B)ottom to (T)op in dest and y of the src goes from (L)eft...