|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Local-extremum search functions for 1-d and 2-d arrays (maps of local minima and maxima, lists of extremum indexes) used by the peak finders. More...
Typedefs | |
| typedef types::mask_t | mask_t |
| LocalExtrema - methods for 2-d image processing algorithms. | |
| typedef types::extrim_t | extrim_t |
| Alias for types::extrim_t (uint16_t). | |
| typedef types::TwoIndexes | TwoIndexes |
| Alias for types::TwoIndexes. | |
Functions | |
| AllocArray1D< TwoIndexes > | evaluateDiagIndexes_drp (const size_t &rank, Allocator *allocator) |
| Return the (i, j) offsets with -rank <= i, j <= rank and both nonzero (the square around a pixel without its central row and column), in an AllocArray1D allocated from allocator. | |
| void | printMatrixOfDiagIndexes (const size_t &rank) |
| Print to stdout a (2*rank+1) x (2*rank+1) matrix of the offsets used by evaluateDiagIndexes(): 1 for used, 0 for the central row and column, and + at the center. | |
| void | printVectorOfDiagIndexes (const size_t &rank) |
| Print the size and the (i, j) pairs of evaluateDiagIndexes(rank) to stdout, ten pairs per line. | |
| size_t | numberOfExtrema (const extrim_t *map, const size_t &rows, const size_t &cols, const extrim_t &vsel=7) |
| Return how many of the rows*cols entries of map equal vsel. | |
| std::vector< TwoIndexes > | evaluateDiagIndexes (const size_t &rank) |
| Return the (i, j) offsets with -rank <= i, j <= rank and both nonzero, as a std::vector. | |
| std::vector< TwoIndexes > | vectorOfExtremeIndexes (const extrim_t *map, const size_t &rows, const size_t &cols, const extrim_t &vsel=7, const size_t &maxlen=0) |
| Return the (row, col) indexes of all entries of map equal to vsel, in row-major order. | |
| template<typename T > | |
| size_t | localMinima1d (const T *data, const mask_t *mask, const size_t &cols, const size_t &stride=1, const size_t &rank=5, extrim_t *local_minima=0) |
| returns number of found minima and array local_minima of local minimums of requested rank, where rank defins a square region [cols-rank, cols+rank]. | |
| template<typename T > | |
| size_t | localMaxima1d (const T *data, const mask_t *mask, const size_t &cols, const size_t &stride=1, const size_t &rank=5, extrim_t *local_maxima=0) |
| returns number of found maxima and array local_maxima of local maximums of requested rank, where rank defins a region [cols-rank, cols+rank]. | |
| template<typename T > | |
| size_t | mapOfLocalMinimums_drp (const T *data, const mask_t *mask, const size_t &rows, const size_t &cols, const size_t &rank, extrim_t *local_minima, Allocator *allocator) |
| returns map of local minimums of requested rank, where rank defins a square region around central pixel [rowc-rank, rowc+rank], [colc-rank, colc+rank]. | |
| template<typename T > | |
| size_t | mapOfLocalMaximums_drp (const T *data, const mask_t *mask, const size_t &rows, const size_t &cols, const size_t &rank, extrim_t *local_maxima, Allocator *allocator) |
| returns map of local maximums of requested rank, where rank defins a square region around central pixel [rowc-rank, rowc+rank], [colc-rank, colc+rank]. | |
| template<typename T > | |
| size_t | mapOfLocalMaximumsRank1Cross (const T *data, const mask_t *mask, const size_t &rows, const size_t &cols, extrim_t *local_maxima) |
| returns map of local maximums of runk=1 cross(+) region (very special case for Chuck's algorithm). | |
| template<typename T > | |
| size_t | mapOfThresholdMaximums (const T *data, const mask_t *mask, const size_t &rows, const size_t &cols, const size_t &rank, const double &thr_low, const T &thr_high, extrim_t *thr_maxima) |
| returns map of local maximums for 2-threshold algorithm. | |
| template<typename T > | |
| size_t | mapOfLocalMinimums (const T *data, const mask_t *mask, const size_t &rows, const size_t &cols, const size_t &rank, extrim_t *local_minima) |
| returns map of local minimums of requested rank, where rank defins a square region around central pixel [rowc-rank, rowc+rank], [colc-rank, colc+rank]. | |
| template<typename T > | |
| size_t | mapOfLocalMaximums (const T *data, const mask_t *mask, const size_t &rows, const size_t &cols, const size_t &rank, extrim_t *local_maxima) |
| returns map of local maximums of requested rank, where rank defins a square region around central pixel [rowc-rank, rowc+rank], [colc-rank, colc+rank]. | |
Local-extremum search functions for 1-d and 2-d arrays (maps of local minima and maxima, lists of extremum indexes) used by the peak finders.
Alias for types::extrim_t (uint16_t).
LocalExtrema - methods for 2-d image processing algorithms.
This software was developed for the LCLS project.
If you use all or part of it, please give an appropriate acknowledgment.
| std::vector< TwoIndexes > localextrema::evaluateDiagIndexes | ( | const size_t & | rank | ) |
Return the (i, j) offsets with -rank <= i, j <= rank and both nonzero, as a std::vector.
| AllocArray1D< TwoIndexes > localextrema::evaluateDiagIndexes_drp | ( | const size_t & | rank, |
| Allocator * | allocator | ||
| ) |
Return the (i, j) offsets with -rank <= i, j <= rank and both nonzero (the square around a pixel without its central row and column), in an AllocArray1D allocated from allocator.
| size_t localextrema::localMaxima1d | ( | const T * | data, |
| const mask_t * | mask, | ||
| const size_t & | cols, | ||
| const size_t & | stride = 1, |
||
| const size_t & | rank = 5, |
||
| extrim_t * | local_maxima = 0 |
||
| ) |
returns number of found maxima and array local_maxima of local maximums of requested rank, where rank defins a region [cols-rank, cols+rank].
Assumes that cols > 2*rank...
1-d array of local maxumum of (uint16) values of data shape, with 0/+1/+2 for bad/non-maxumum/maximum in rank region.
| [in] | data | - pointer to data array |
| [in] | mask | - pointer to mask array; mask marks bad/good (0/1) pixels |
| [in] | cols | - number of columns in 1d array |
| [in] | stride | - index increment between neighbour elements. Makes sence for n-d arrays |
| [in] | rank | - radius of the square region in which central pixel has a maximal value |
| [out] | local_maxima | - pointer to the array local_maxima |
| size_t localextrema::localMinima1d | ( | const T * | data, |
| const mask_t * | mask, | ||
| const size_t & | cols, | ||
| const size_t & | stride = 1, |
||
| const size_t & | rank = 5, |
||
| extrim_t * | local_minima = 0 |
||
| ) |
returns number of found minima and array local_minima of local minimums of requested rank, where rank defins a square region [cols-rank, cols+rank].
Assumes that cols > 2*rank...
1-d array of local minumum of (uint16) values of data shape, with 0/+1/+2 for bad/non-minumum/minimum in rank region.
| [in] | data | - pointer to data array |
| [in] | mask | - pointer to mask array; mask marks bad/good (0/1) pixels |
| [in] | cols | - number of columns in 1d array |
| [in] | stride | - index increment between neighbour elements. Makes sence for n-d arrays |
| [in] | rank | - radius of the square region in which central pixel has a maximal value |
| [out] | local_minima | - pointer to the array local_minima |
| size_t localextrema::mapOfLocalMaximums | ( | const T * | data, |
| const mask_t * | mask, | ||
| const size_t & | rows, | ||
| const size_t & | cols, | ||
| const size_t & | rank, | ||
| extrim_t * | local_maxima | ||
| ) |
returns map of local maximums of requested rank, where rank defins a square region around central pixel [rowc-rank, rowc+rank], [colc-rank, colc+rank].
Map of local maximum is a 2-d array of (uint16) values of data shape, with 0/+1/+2/+4 for non-maximum / maximum in column / maximum in row / minimum in square of radius rank.
| [in] | data | - pointer to data array |
| [in] | mask | - pointer to mask array; mask marks bad/good (0/1) pixels |
| [in] | rows | - number of rows in all 2-d arrays |
| [in] | cols | - number of columns in all 2-d arrays |
| [in] | rank | - radius of the square region in which central pixel has a maximal value |
| [out] | local_maxima | - pointer to map of local maximums |
| size_t localextrema::mapOfLocalMaximums_drp | ( | const T * | data, |
| const mask_t * | mask, | ||
| const size_t & | rows, | ||
| const size_t & | cols, | ||
| const size_t & | rank, | ||
| extrim_t * | local_maxima, | ||
| Allocator * | allocator | ||
| ) |
returns map of local maximums of requested rank, where rank defins a square region around central pixel [rowc-rank, rowc+rank], [colc-rank, colc+rank].
Map of local maximum is a 2-d array of (uint16) values of data shape, with 0/+1/+2/+4 for non-maximum / maximum in column / maximum in row / minimum in square of radius rank.
| [in] | data | - pointer to data array |
| [in] | mask | - pointer to mask array; mask marks bad/good (0/1) pixels |
| [in] | rows | - number of rows in all 2-d arrays |
| [in] | cols | - number of columns in all 2-d arrays |
| [in] | rank | - radius of the square region in which central pixel has a maximal value |
| [out] | local_maxima | - pointer to map of local maximums |
| size_t localextrema::mapOfLocalMaximumsRank1Cross | ( | const T * | data, |
| const mask_t * | mask, | ||
| const size_t & | rows, | ||
| const size_t & | cols, | ||
| extrim_t * | local_maxima | ||
| ) |
returns map of local maximums of runk=1 cross(+) region (very special case for Chuck's algorithm).
Map of local maximum is a 2-d array of (uint16) values of data shape, with 0/+1/+2 for non-maximum / maximum in column / maximum in row, then local maximum in cross = 3.
| [in] | data | - pointer to data array |
| [in] | mask | - pointer to mask array; mask marks bad/good (0/1) pixels |
| [in] | rows | - number of rows in all 2-d arrays |
| [in] | cols | - number of columns in all 2-d arrays |
| [out] | local_maxima | - pointer to map of local maximums |
| size_t localextrema::mapOfLocalMinimums | ( | const T * | data, |
| const mask_t * | mask, | ||
| const size_t & | rows, | ||
| const size_t & | cols, | ||
| const size_t & | rank, | ||
| extrim_t * | local_minima | ||
| ) |
returns map of local minimums of requested rank, where rank defins a square region around central pixel [rowc-rank, rowc+rank], [colc-rank, colc+rank].
Map of local minumum is a 2-d array of (uint16) values of data shape, with 0/+1/+2/+4 for non-minumum / minumum in column / minumum in row / minimum in square of radius rank.
| [in] | data | - pointer to data array |
| [in] | mask | - pointer to mask array; mask marks bad/good (0/1) pixels |
| [in] | rows | - number of rows in all 2-d arrays |
| [in] | cols | - number of columns in all 2-d arrays |
| [in] | rank | - radius of the square region in which central pixel has a maximal value |
| [out] | local_minima | - pointer to map of local minimums |
| size_t localextrema::mapOfLocalMinimums_drp | ( | const T * | data, |
| const mask_t * | mask, | ||
| const size_t & | rows, | ||
| const size_t & | cols, | ||
| const size_t & | rank, | ||
| extrim_t * | local_minima, | ||
| Allocator * | allocator | ||
| ) |
returns map of local minimums of requested rank, where rank defins a square region around central pixel [rowc-rank, rowc+rank], [colc-rank, colc+rank].
Map of local minumum is a 2-d array of (uint16) values of data shape, with 0/+1/+2/+4 for non-minumum / minumum in column / minumum in row / minimum in square of radius rank.
| [in] | data | - pointer to data array |
| [in] | mask | - pointer to mask array; mask marks bad/good (0/1) pixels |
| [in] | rows | - number of rows in all 2-d arrays |
| [in] | cols | - number of columns in all 2-d arrays |
| [in] | rank | - radius of the square region in which central pixel has a maximal value |
| [out] | local_minima | - pointer to map of local minimums |
| size_t localextrema::mapOfThresholdMaximums | ( | const T * | data, |
| const mask_t * | mask, | ||
| const size_t & | rows, | ||
| const size_t & | cols, | ||
| const size_t & | rank, | ||
| const double & | thr_low, | ||
| const T & | thr_high, | ||
| extrim_t * | thr_maxima | ||
| ) |
returns map of local maximums for 2-threshold algorithm.
Map of local maximum is a 2-d array of (uint16) values of data shape, with 0/+1/+2/+4/+8 for masked / <thr_low / >thr_low && <thr_high / >thr_high / local maxima in runk-square +16 < -thr_low
| [in] | data | - pointer to data array |
| [in] | mask | - pointer to mask array; mask marks bad/good (0/1) pixels |
| [in] | rows | - number of rows in all 2-d arrays |
| [in] | cols | - number of columns in all 2-d arrays |
| [in] | rank | - radius of the square region in which central pixel has a maximal value |
| [in] | thr_low | - low threshold on intensity |
| [in] | thr_high | - high threshold on intensity |
| [out] | map | - pointer to map of local maximums |
| size_t localextrema::numberOfExtrema | ( | const extrim_t * | map, |
| const size_t & | rows, | ||
| const size_t & | cols, | ||
| const extrim_t & | vsel = 7 |
||
| ) |
Return how many of the rows*cols entries of map equal vsel.
Print to stdout a (2*rank+1) x (2*rank+1) matrix of the offsets used by evaluateDiagIndexes(): 1 for used, 0 for the central row and column, and + at the center.
Print the size and the (i, j) pairs of evaluateDiagIndexes(rank) to stdout, ten pairs per line.
| std::vector< TwoIndexes > localextrema::vectorOfExtremeIndexes | ( | const extrim_t * | map, |
| const size_t & | rows, | ||
| const size_t & | cols, | ||
| const extrim_t & | vsel = 7, |
||
| const size_t & | maxlen = 0 |
||
| ) |
Return the (row, col) indexes of all entries of map equal to vsel, in row-major order.
maxlen (rows*cols/4 if 0) only sets the reserved capacity; it does not limit the result.