|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
PeakFinderAlgos - class contains collection of methods for peak finding algorithms of 2-d image. More...
#include <PeakFinderAlgosLCLS1.hh>
Public Member Functions | |
| PeakFinderAlgos (const size_t &seg=0, const unsigned &pbits=0) | |
| Class constructor is used for initialization of all paramaters. | |
| virtual | ~PeakFinderAlgos () |
| Delete the local-maxima, local-minima and connected-pixel maps, logging a message first if the DEBUG bit of the print bits is set. | |
| void | printParameters () |
| Prints memeber data. | |
| void | _initMapsAndVectors () |
| Initialaise maps and vectors per event; uses m_img_size, m_npksmax, vectors and maps. | |
| void | _evaluateRingIndexes () |
| Evaluate ring indexes for S/N algorithm. | |
| void | printMatrixOfRingIndexes () |
| Prints indexes for S/N algorithm. | |
| void | printVectorOfRingIndexes () |
| Print the (row, col) offsets used for the background ring to stdout, ten per line, computing them first with _evaluateRingIndexes() if the list is empty. | |
| void | setPeakSelectionPars (const float &npix_min=0, const float &npix_max=1e6, const float &amax_thr=0, const float &atot_thr=0, const float &son_min=0) |
| Recursive method finding connected pixels in constrained region and filling vector of indexes for V3r3. | |
| void | printSelectionPars () |
| Prints peak selection parameters. | |
| bool | _peakIsSelected (const Peak &peak) |
| Decide if peak should be included or not in the output v_peaks. | |
| void | _makeVectorOfSelectedPeaks () |
| Makes vector of selected peaks v_peaks_sel from v_peaks. | |
| void | _printVectorOfPeaks (const std::vector< Peak > &v) |
| Prints vector of peaks, i.e. v_peaks_sel or v_peaks. | |
| const Peak & | peak (const int &i=0) |
| Returns peak from v_peaks by specified index. | |
| const Peak & | peakSelected (const int &i=0) |
| Returns peak from v_peaks_sel by specified index. | |
| const std::vector< Peak > & | vectorOfPeaks () |
| Returns vector of peaks v_peaks. | |
| const std::vector< Peak > & | vectorOfPeaksSelected () |
| Returns vector of selected peaks v_peaks_sel. | |
| void | localMaxima (extrim_t *map, const size_t &rows, const size_t &cols) |
| Fills-out (returns) array of local maxima. | |
| void | localMinima (extrim_t *map, const size_t &rows, const size_t &cols) |
| Fills-out (returns) array of local minima. | |
| void | connectedPixels (conmap_t *map, const size_t &rows, const size_t &cols) |
| Fills-out (returns) array of m_conmap. | |
| template<typename T > | |
| void | peakFinderV3r3 (const T *data, const mask_t *mask, const size_t &rows, const size_t &cols, const size_t &rank, const double &r0=7.0, const double &dr=2.0, const double &nsigm=0) |
| peakFinderV3r3 - "Ranker" - further development of ImgAlgos.peakFinderV3r2. | |
| template<typename T > | |
| void | _makeMapOfConnectedPixelsForLocalMaximums (const T *data) |
| full peak processing in a right order | |
| template<typename T > | |
| RingAvgRms | _evaluateRingAvgRmsV1 (const T *data, const int &row, const int &col) |
| Evaluate background average and rms in the ring around pixel using data, mask, and map of local intensity extremes. | |
| template<typename T > | |
| RingAvgRms | _evaluateRingAvgRmsForDroplet (const T *data, const int &row, const int &col) |
| The same as _evaluateRingAvgRmsV1, but selection of pixel is for Droplet. | |
| template<typename T > | |
| void | _findConnectedPixelsForLocalMaximumV2 (const T *data, const int &r0, const int &c0) |
| _findConnectedPixelsForLocalMaximumV2 - apply flood filling algorithms to find a group of connected pixels around r0,c0 in constrained by rad region. | |
| template<typename T > | |
| void | _findConnectedPixelsInRegionV3 (const T *data, const int &r, const int &c) |
| Recursively add pixel (r, c) and its 4-connected neighbours to the current pixel group: a pixel is taken if it is unmasked, not yet in the connected-pixel map and not below the region threshold, and it is marked there with the current region number. | |
| template<typename T > | |
| void | _procPixGroupV1 (const T *data, const RingAvgRms &bkgd, const std::vector< TwoIndexes > &vinds) |
| _procPixGroupV1 - process a pixel group for peakFinderV3r3 further development of ImgAlgos::AlgImgProc::_procPixGroup V1 news: get rid of ndarray, use member data to pass parameters, subtract base level brfore processing | |
| template<typename T > | |
| void | peakFinderV4r3 (const T *data, const mask_t *mask, const size_t &rows, const size_t &cols, const double &thr_low, const double &thr_high, const size_t &rank=5, const double &r0=7.0, const double &dr=2.0) |
| peakFinderV4r3 - further development of ImgAlgos.peakFinderV4r2. | |
| template<typename T > | |
| void | _makeMapOfConnectedPixelsForDroplets (const T *data) |
| full peak processing in a right order | |
| void | _findConnectedPixelsForDroplet (const int &r0, const int &c0) |
| _findConnectedPixelsForDroplet - apply flood filling algorithms to find a group of connected pixels news: rank is passed as member data | |
| void | _findConnectedPixelsInDroplet (const int &r, const int &c) |
| Recursively add pixel (r, c) and its 4-connected neighbours to the current pixel group when their value in the local-maxima map is at least 2 (the code comment says 0 is masked and 1 below the low threshold) and they are not yet in the connected-pixel map; each is marked with the current region number. | |
PeakFinderAlgos - class contains collection of methods for peak finding algorithms of 2-d image.
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
Class constructor is used for initialization of all paramaters.
| [in] | seg | - ROI segment index in the ndarray |
| [in] | pbits | - print control bit-word; =0-print nothing, =1 debug, =2 info, ... |
|
virtual |
Delete the local-maxima, local-minima and connected-pixel maps, logging a message first if the DEBUG bit of the print bits is set.
|
inline |
The same as _evaluateRingAvgRmsV1, but selection of pixel is for Droplet.
|
inline |
Evaluate background average and rms in the ring around pixel using data, mask, and map of local intensity extremes.
development of ImgAlgos.Alg.imgProc._evaluateBkgdAvgRmsV3 _evaluateRingAvgRmsV1 news: get rid of ndarray, mask, m_r0, m_dr etc are passed as member data, RingAvgRms is created at return.
Background average and rms are evaluated for any pixel specified by the (row,col). Uses mask. Good non-extreme pixels are used. This algorithm uses pixels in the ring m_r0, m_dr.
| [in] | data | - pointer to 2-d array with calibrated intensities |
| [in] | row | - pixel row |
| [in] | col | - pixel column |
| void psalg1::PeakFinderAlgos::_evaluateRingIndexes | ( | ) |
Evaluate ring indexes for S/N algorithm.
|
inline |
_findConnectedPixelsForDroplet - apply flood filling algorithms to find a group of connected pixels news: rank is passed as member data
| [in] | r0 | - droplet central pixel row-coordinate |
| [in] | c0 | - droplet central pixel column-coordinate |
|
inline |
_findConnectedPixelsForLocalMaximumV2 - apply flood filling algorithms to find a group of connected pixels around r0,c0 in constrained by rad region.
| [in] | data | - pointer to 2-d array with calibrated intensities |
| [in] | r0 | - droplet central pixel row-coordinate |
| [in] | c0 | - droplet central pixel column-coordinate |
Recursively add pixel (r, c) and its 4-connected neighbours to the current pixel group when their value in the local-maxima map is at least 2 (the code comment says 0 is masked and 1 below the low threshold) and they are not yet in the connected-pixel map; each is marked with the current region number.
The search stays inside the current region limits.
|
inline |
Recursively add pixel (r, c) and its 4-connected neighbours to the current pixel group: a pixel is taken if it is unmasked, not yet in the connected-pixel map and not below the region threshold, and it is marked there with the current region number.
The search stays inside the current region limits.
| void psalg1::PeakFinderAlgos::_initMapsAndVectors | ( | ) |
Initialaise maps and vectors per event; uses m_img_size, m_npksmax, vectors and maps.
full peak processing in a right order
| [in] | data | - pointer to 2-d array with calibrated intensities |
full peak processing in a right order
| [in] | data | - pointer to 2-d array with calibrated intensities |
| void psalg1::PeakFinderAlgos::_makeVectorOfSelectedPeaks | ( | ) |
Makes vector of selected peaks v_peaks_sel from v_peaks.
Decide if peak should be included or not in the output v_peaks.
Prints vector of peaks, i.e. v_peaks_sel or v_peaks.
|
inline |
_procPixGroupV1 - process a pixel group for peakFinderV3r3 further development of ImgAlgos::AlgImgProc::_procPixGroup V1 news: get rid of ndarray, use member data to pass parameters, subtract base level brfore processing
| [in] | data | - pointer to data array with calibrated intensities |
| [in] | bkgd | - structure of base level ave, rms, npix |
| [in] | vinds | - vector of connected pixel indexes |
|
inline |
Fills-out (returns) array of m_conmap.
|
inline |
Fills-out (returns) array of local maxima.
|
inline |
Fills-out (returns) array of local minima.
Returns peak from v_peaks by specified index.
|
inline |
peakFinderV3r3 - "Ranker" - further development of ImgAlgos.peakFinderV3r2.
Changes:
|
inline |
peakFinderV4r3 - further development of ImgAlgos.peakFinderV4r2.
Changes:
Returns peak from v_peaks_sel by specified index.
| void psalg1::PeakFinderAlgos::printMatrixOfRingIndexes | ( | ) |
Prints indexes for S/N algorithm.
| void psalg1::PeakFinderAlgos::printParameters | ( | ) |
Prints memeber data.
| void psalg1::PeakFinderAlgos::printSelectionPars | ( | ) |
Prints peak selection parameters.
| void psalg1::PeakFinderAlgos::printVectorOfRingIndexes | ( | ) |
Print the (row, col) offsets used for the background ring to stdout, ten per line, computing them first with _evaluateRingIndexes() if the list is empty.
| void psalg1::PeakFinderAlgos::setPeakSelectionPars | ( | const float & | npix_min = 0, |
| const float & | npix_max = 1e6, |
||
| const float & | amax_thr = 0, |
||
| const float & | atot_thr = 0, |
||
| const float & | son_min = 0 |
||
| ) |
Recursive method finding connected pixels in constrained region and filling vector of indexes for V3r3.
Set peak selection parameters
Returns vector of peaks v_peaks.
Returns vector of selected peaks v_peaks_sel.