Page History
...
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 datakey
(default: "") – key for input image datapeaksKey
(default: "peaks") – key for output list of peaksthreshold_low
(default: 15010) – low threshold on pixel amplitudethreshold_high
(default: 250100) – high threshold on pixel amplitudesigma
(default: 1.5) – width of the Gaussian for smearingsmear_radius
(default: 21) – radius in pixel for smearingpeak_radius
(default: 3) – radius in pixel for peak findingxmin
(default: 0) – minimal column numberxmax
(default: 100000) – maximal column numberymin
(default: 0) – minimal row numberymax
(default: 100000) – maximal row numberfilterIsOn
(default: true) – On/Off algorithmtestEvent
(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:
...
- 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 algorithmprint_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:
- raw image,
- 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,
- 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 datakey
(default: "peaks") – key for output list of peaksthreshold_peak
(default: 0) – threshold on peak amplitudethreshold_total
(default: 0) – threshold on total peak intensity (in the matrix around peak)n_peaks_min
(default: 1) – minimal number of peaks above all thresholdsfilterIsOn
(default: true) – On/Off the filterprint_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
...