|
| | PeakFinderAlgos (Allocator *allocator, const size_t &seg=0, const unsigned &pbits=0, const size_t &lim_rank=50, const size_t &lim_peaks=6000) |
| | Class constructor is used for initialization of all paramaters.
|
| |
| virtual | ~PeakFinderAlgos () |
| | Delete the local-maxima, local-minima and connected-pixel maps.
|
| |
| void | printParameters () |
| | Prints memeber data.
|
| |
| void | _initMapsAndVectors_drp () |
| | Initialaise maps and vectors per event; uses m_img_size, m_npksmax, vectors and maps.
|
| |
| void | _evaluateRingIndexes_drp () |
| | Evaluate ring indexes for S/N algorithm.
|
| |
| void | printMatrixOfRingIndexes () |
| | Prints indexes for S/N algorithm.
|
| |
| void | printVectorOfRingIndexes_drp () |
| | Print the (row, col) offsets used for the background ring to stdout, ten per line, computing them first with _evaluateRingIndexes_drp() 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) |
| | Set peak selection parameters.
|
| |
| 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_drp () |
| | Makes vector of selected peaks v_peaks_sel from v_peaks.
|
| |
| void | _printVectorOfPeaks_drp (AllocArray1D< Peak > v) |
| | Prints vector of peaks, i.e. v_peaks_sel or v_peaks.
|
| |
| const Peak & | peakSelected (const int &i=0) |
| | Returns peak from v_peaks_sel by specified index.
|
| |
| const AllocArray1D< Peak > & | vectorOfPeaks () |
| | Returns vector of peaks v_peaks.
|
| |
| const AllocArray1D< Peak > & | vectorOfPeaksSelected_drp () |
| | Returns vector of selected peaks v_peaks_sel.
|
| |
| void | _convPeaksSelected () |
| | Converts selected peaks to arrays of fundamental types, rows, cols, intens.
|
| |
| 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.
|
| |
| void | setAllocator (Allocator *allocator) |
| | Set the stored Allocator pointer (the trailing comment says it is changed for each event).
|
| |
| 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_drp (const T *data) |
| | full peak processing in a right order
|
| |
| template<typename T > |
| RingAvgRms | _evaluateRingAvgRmsV1_drp (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 > |
| void | _findConnectedPixelsForLocalMaximumV2_drp (const T *data, const int &r0, const int &c0) |
| | _findConnectedPixelsForLocalMaximumV2_drp - apply flood filling algorithms to find a group of connected pixels around r0,c0 in constrained by rad region.
|
| |
| template<typename T > |
| void | _findConnectedPixelsInRegionV3_drp (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_drp (const T *data, const RingAvgRms &bkgd, AllocArray1D< 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
|
| |
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.
- Author
- Mikhail Dubrovin
- See also
- ImgAlgos.ImgImgProc
- Interface Description
- Includes and typedefs
#include <cstddef>
#include "psalgos/PeakFinderAlgos.h"
#include "psalgos/Types.h"
Non-owning view of an array of T: a data pointer, a pointer to a shape array and a rank.
Definition Array.hh:27
types::mask_t mask_t
Alias for types::mask_t (uint16_t).
Definition PeakFinderAlgos.hh:40
types::extrim_t extrim_t
Alias for types::extrim_t (uint16_t).
Definition PeakFinderAlgos.hh:42
- Define input parameters and make object
const size_t rows = 1000;
const size_t cols = 1000;
const size_t rank = 5;
const size_t seg=0;
const unsigned&
pbits=0 #
Types.h: NONE=0, DEBUG=1, INFO=2, WARNING=4,
ERROR=8, CRITICAL=16
#define ERROR
Definition PgpCardMod.h:23
PeakFinderAlgos - class contains collection of methods for peak finding algorithms of 2-d image.
Definition PeakFinderAlgos.hh:253
AllocArray1D< float > rows
Row centers of gravity of the selected peaks, filled by _convPeaksSelected().
Definition PeakFinderAlgos.hh:379
AllocArray1D< float > cols
Column centers of gravity of the selected peaks, filled by _convPeaksSelected().
Definition PeakFinderAlgos.hh:380
- Call methods
alg.printVectorOfRingIndexes();
const Peak& p = alg.peak(i)
const std::vector<Peak>
peaks = alg.vectorOfPeaksSelected();
void localMaxima(extrim_t *map, const size_t &rows, const size_t &cols)
Fills-out (returns) array of local maxima.
Definition PeakFinderAlgos.hh:316
void printSelectionPars()
Prints peak selection parameters.
void printMatrixOfRingIndexes()
Prints indexes for S/N algorithm.
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.
Definition PeakFinderAlgos.hh:398
const Peak & peakSelected(const int &i=0)
Returns peak from v_peaks_sel by specified index.
Definition PeakFinderAlgos.hh:304
void connectedPixels(conmap_t *map, const size_t &rows, const size_t &cols)
Fills-out (returns) array of m_conmap.
Definition PeakFinderAlgos.hh:326
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)
Set peak selection parameters.
const AllocArray1D< Peak > & vectorOfPeaks()
Returns vector of peaks v_peaks.
Definition PeakFinderAlgos.hh:307
void localMinima(extrim_t *map, const size_t &rows, const size_t &cols)
Fills-out (returns) array of local minima.
Definition PeakFinderAlgos.hh:321
void printParameters()
Prints memeber data.
Peak parameters.
Definition PeakFinderAlgos.hh:55
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.
- Parameters
-
| [in] | data | - pointer to 2-d array with calibrated intensities |
| [in] | row | - pixel row |
| [in] | col | - pixel column |