Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add info about ImgAlgos::ImgPeakFilter

...

Module ImgAlgos::ImgPeakFinder

(Development in progress)
This algorithm was motivated by users of amo42112:
1. Select the pixels in the window xmin, xmax, ymin, ymax
with amplitudes above the threshold_low.
2. Smear image for selected pixels, using 2-d matrix of weights over pixels
from -smear_radius to +smear_radius around each smeared pixel amplitude.
The matrix of weights is defined by the 2-d Gaussian function of width sigma.
3. Find peaks as pixels with absolute-maximal amplitude above the threshold_high in the center of the matrix
-peak_radius to +peak_radius. The peak amplitude should exceed the threshold_high. (There might be a requirement on number of non-zero amplitude pixels in the matrix around the peak position.)
4. Put the vector of the found peaks in the event with key peaksKey. Each entry of this vector has an object of the struct Peak, containing x, y positions, peak pixel amplitude, and the total amplitude in the matrix, defined by the peak_radius., and the number of pixels in the matrix above threshold_low:

Code Block
struct Peak{
   double x;
   double y; 
   double ampmax
;  // doubleamplitude amptot;
in the peak //masimum ?   
   double amptot;  // total amplitude in the range of {{peak_radius}}
   unsigned npix;  // number of pixels in the range of {{peak_radius}}
   // ? double s1;
   // ? double s2; 
   // ? double tilt_angle;  
} ;

...

  • source (default: "DetInfo()") – source of data
  • key (default: "") – key for input image data
  • peaksKey (default: "peaks") – key for output list of peaks
  • threshold_low (default: 15010) – low threshold on pixel amplitude
  • threshold_high (default: 250100) – high threshold on pixel amplitude
  • sigma (default: 1.5) – width of the Gaussian for smearing
  • smear_radius (default: 21) – radius in pixel for smearing
  • peak_radius (default: 3) – radius in pixel for peak finding
  • xmin (default: 0) – minimal column number
  • xmax (default: 100000) – maximal column number
  • ymin (default: 0) – minimal row number
  • ymax (default: 100000) – maximal row number
  • filterIsOn (default: true) – On/Off algorithm
  • testEvent (default: 0) – event number to save images and print info for test purpose

Remarks:

  • This algorithm consumes ~25 ms/event on psana0205 for full Opal1000 (1024x1024) camera image.
  • Smearing algorithm use a "safety margin" which is currently set to 10 pixels (offset from each boarder of the full image size).

Image on different stages of this algorithm:
Image RemovedImage RemovedImage Removed

...

  • few peaks at the edges were discarded by the window limits,
  • image still contains many 1-photon pixels, which need to be eliminated,
  • finderIsOn (default: true) – On/Off algorithm
  • print_bits (default: 0) – finder verbosity:
    • 0 - print nothing,
    • 1 bit (1) - input pars,
    • 2 bit (2) - summary,
    • 3 bit (4) - number of peaks in the event,
    • 4 bit (8) - each peak parameters,
    • 5 bit (16)- info about input image format.

Remarks:

  • This algorithm consumes ~15 ms/event on psana0101 for full Opal1000 (1024x1024) camera image.
  • Smearing algorithm use a "safety margin" which is currently set to 10 pixels (offset from each boarder of the full image size).

Image on different stages of this algorithm:
Image AddedImage AddedImage Added

  1. raw image,
  2. image in the window with amplitudes above the threshold_low
    • few peaks at the edges were discarded by the window limits,
    • image still contains many 1-photon pixels, which need to be eliminated,
  3. smeared image.

Module ImgAlgos::ImgPeakFilter

This module use results and should work after the ImgAlgos::ImgPeakFinder.
It gets the vector of peaks for the source and key, loops over all founded peaks and counts the number of peaks above the thresholds threshold_peak and threshold_total. If the filterIsOn is "on" (true or yes state) and the number of found peaks exceeds the n_peaks_min the event is passed for further analysis/processing.

Module configuration parameters:

  • source (default: "DetInfo()") – source of data
  • key (default: "peaks") – key for output list of peaks
  • threshold_peak (default: 0) – threshold on peak amplitude
  • threshold_total(default: 0) – threshold on total peak intensity (in the matrix around peak)
  • n_peaks_min (default: 1) – minimal number of peaks above all thresholds
  • filterIsOn (default: true) – On/Off the filter
  • print_bits (default: 0) – finder verbosity:
    • 0 - print nothing,
    • 1 bit (1) - input pars,
    • 2 bit (2) - summary,
    • 3 bit (4) - peaks' info,
    • 4 bit (8) - event ID

...

    • .

Module ImgAlgos::EventNumberFilter

...