![]() |
ProSHADE
0.7.6.1 (AUG 2021)
Protein Shape Detection
|
This namespace contains all the functions required for peak searching in 3D maps. More...
Functions | |
std::vector< proshade_double * > | findAllPointsAboveNeighbours (proshade_complex *map, proshade_unsign dim, proshade_signed peakSize, proshade_double *medianIQR) |
This function finds all indices with higher value then all neighbours. More... | |
void | pointsAboveNeighboursRemoveSmallHeight (std::vector< proshade_double * > *pointVec, proshade_double *medianIQR, proshade_double noIQRs) |
This function clears the 'higher than neighbour' vector from background values. More... | |
void | allocatePeakOptimisationMemory (proshade_double *&avgMat, proshade_double *&hlpMap, proshade_double *&eA, proshade_double *&eB, proshade_double *&eG, proshade_double *&uAV) |
This function allocates and checks all the peak optimisation memory. More... | |
void | releasePeakOptimisationMemory (proshade_double *&avgMat, proshade_double *&hlpMap, proshade_double *&eA, proshade_double *&eB, proshade_double *&eG, proshade_double *&uAV) |
This function deletes all the peak optimisation memory. More... | |
void | optimisePeakPositions (std::vector< proshade_double * > *pointVec, proshade_signed peakSize, proshade_signed band) |
This function optimises all the peaks in the input vector using the values of their neighbours. More... | |
std::vector< proshade_double * > | getAllPeaksNaive (proshade_complex *map, proshade_unsign dim, proshade_signed peakSize, proshade_double noIQRs) |
This function finds peaks in the 3D map using the "naive" approach. More... | |
void | getBestPeakEulerAngsNaive (proshade_complex *map, proshade_unsign dim, proshade_double *eulA, proshade_double *eulB, proshade_double *eulG, ProSHADE_settings *settings) |
This function finds the highest peaks optimised Euler angles using the "naive" approach. More... | |
void | allocateSmoothingZScoreMemory (proshade_unsign dim, proshade_double *&scoreOverVals, proshade_signed *&signals, proshade_double *&filteredY, proshade_double *&avgFilter, proshade_double *&stdFilter, proshade_double *&subVec, proshade_double *&medianIQR, proshade_double *&YZMap, proshade_double *&XZMap, proshade_double *&XYMap, proshade_unsign smLag) |
This function allocates the memory required for smoothed Z score computation. More... | |
void | releaseSmoothingZScoreMemory (proshade_double *&scoreOverVals, proshade_signed *&signals, proshade_double *&filteredY, proshade_double *&avgFilter, proshade_double *&stdFilter, proshade_double *&subVec, proshade_double *&medianIQR, proshade_double *&YZMap, proshade_double *&XZMap, proshade_double *&XYMap) |
This function releases the memory required for smoothed Z score computation. More... | |
void | getSmoothedZScore1D (proshade_unsign dim, proshade_unsign smoothingLag, proshade_double ZScoreThreshold, proshade_signed *signals, proshade_double *filteredY, proshade_double *avgFilter, proshade_double *stdFilter, proshade_double *subVec, proshade_double *medianIQR, proshade_double *scoreOverVals) |
This function computes the 1D peaks for a 1D input array and returns array of int's as signal. More... | |
void | getXAxisArraysSmoothedZScorePeaks (proshade_unsign dim, proshade_unsign smoothingLag, proshade_double ZScoreThreshold, proshade_signed *signals, proshade_double *filteredY, proshade_double *avgFilter, proshade_double *stdFilter, proshade_double *subVec, proshade_double *medianIQR, proshade_double *scoreOverVals, proshade_complex *map, proshade_double *YZMap) |
This function runs the 1D smoothed Z score algorithm on all X-axis arrays as its inputs. More... | |
void | getYAxisArraysSmoothedZScorePeaks (proshade_unsign dim, proshade_unsign smoothingLag, proshade_double ZScoreThreshold, proshade_signed *signals, proshade_double *filteredY, proshade_double *avgFilter, proshade_double *stdFilter, proshade_double *subVec, proshade_double *medianIQR, proshade_double *scoreOverVals, proshade_complex *map, proshade_double *XZMap) |
This function runs the 1D smoothed Z score algorithm on all Y-axis arrays as its inputs. More... | |
void | getZAxisArraysSmoothedZScorePeaks (proshade_unsign dim, proshade_unsign smoothingLag, proshade_double ZScoreThreshold, proshade_signed *signals, proshade_double *filteredY, proshade_double *avgFilter, proshade_double *stdFilter, proshade_double *subVec, proshade_double *medianIQR, proshade_double *scoreOverVals, proshade_complex *map, proshade_double *XYMap) |
This function runs the 1D smoothed Z score algorithm on all Z-axis arrays as its inputs. More... | |
void | findAllPointNeighbours (proshade_double *YZMap, proshade_double *XZMap, proshade_double *XYMap, proshade_unsign *visitedMap, proshade_signed dim, proshade_signed x, proshade_signed y, proshade_signed z, std::vector< proshade_unsign > *retVals) |
This is a support function for the Z-score peak detection. It is currently not being used. More... | |
void | findAllDisconnectedIslands (proshade_complex *map, proshade_double *YZMap, proshade_double *XZMap, proshade_double *XYMap, proshade_unsign dim, std::vector< proshade_unsign > *allIslandBests) |
This function combines the three Z score maps, locates individual islands and returns a vector of highest point indices for each such island. More... | |
void | findAllSmoothedZScorePeaksWithNeighbours (proshade_complex *map, proshade_double *YZMap, proshade_double *XZMap, proshade_double *XYMap, proshade_signed dim, proshade_signed peakSize, std::vector< proshade_double * > *allPeaksWithNeighbours) |
This function firstly determines the highest peak of all smoothed Z score islands and then returns this point as well as all its neighbours. More... | |
std::vector< proshade_double * > | getAllPeaksSmoothedZ (proshade_complex *map, proshade_unsign dim, proshade_double smoothingFraction, proshade_double noIQRs, proshade_signed peakSize) |
This function finds peaks in the 3D map using the smoothed Z score approach. More... | |
void | getBestPeakEulerAngsSmoothedZ (proshade_complex *map, proshade_unsign dim, proshade_double smoothingFraction, proshade_double noIQRs, proshade_signed peakSize, proshade_double *eulA, proshade_double *eulB, proshade_double *eulG) |
This function finds the highest peaks optimised Euler angles using the smoothed Z score approach. More... | |
std::vector< proshade_signed > | findPeaks1D (std::vector< proshade_double > data) |
This function simply finds all the peaks in a 1D data array. More... | |
This namespace contains all the functions required for peak searching in 3D maps.
Peak searching may be one of the bottlenecks of the "old" ProSHADE and therefore a dedicated header with functions related to 3D peak searching is created to allow more testing and work to be done on this task.
void ProSHADE_internal_peakSearch::allocatePeakOptimisationMemory | ( | proshade_double *& | avgMat, |
proshade_double *& | hlpMat, | ||
proshade_double *& | eA, | ||
proshade_double *& | eB, | ||
proshade_double *& | eG, | ||
proshade_double *& | uAV | ||
) |
This function allocates and checks all the peak optimisation memory.
[in] | avgMat | The matrix which will take the weighted sum of the neighbour values. |
[in] | hlpMat | The helper matrix to store temporary results. |
[in] | eA | The Euler angle alpha value. |
[in] | eB | The Euler beta alpha value. |
[in] | eG | The Euler gamma alpha value. |
[in] | uAV | The U and V^T matrices resulting from the SVD. |
Definition at line 161 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::allocateSmoothingZScoreMemory | ( | proshade_unsign | dim, |
proshade_double *& | scoreOverVals, | ||
proshade_signed *& | signals, | ||
proshade_double *& | filteredY, | ||
proshade_double *& | avgFilter, | ||
proshade_double *& | stdFilter, | ||
proshade_double *& | subVec, | ||
proshade_double *& | medianIQR, | ||
proshade_double *& | YZMap, | ||
proshade_double *& | XZMap, | ||
proshade_double *& | XYMap, | ||
proshade_unsign | smLag | ||
) |
This function allocates the memory required for smoothed Z score computation.
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | scoreOverVals | Pointer to where the 1D cuts from the 3D map will be saved. |
[in] | signals | Pointer to where the results of the 1D peak searches will be saved. |
[in] | filteredY | Pointer to where the weighted smoothed scores will be saved. |
[in] | avgFilter | Pointer to where the median values will be saved. |
[in] | stdFilter | Pointer to where the IQR values will be saved. |
[in] | subVec | Pointer to where temporary computations will be done. |
[in] | medianIQR | Pointer to simple array of 2 for returning results. |
[in] | YZMap | Pointer to where the X-axis peaks will be saved. |
[in] | XZMap | Pointer to where the Y-axis peaks will be saved. |
[in] | XYMap | Pointer to where the Z-axis peaks will be saved. |
[in] | PeakMap | Pointer to where the axis peak combinations will be saved. |
[in] | smLag | The size of the smoothing window. |
Definition at line 419 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::findAllDisconnectedIslands | ( | proshade_complex * | map, |
proshade_double * | YZMap, | ||
proshade_double * | XZMap, | ||
proshade_double * | XYMap, | ||
proshade_unsign | dim, | ||
std::vector< proshade_unsign > * | allIslandBests | ||
) |
This function combines the three Z score maps, locates individual islands and returns a vector of highest point indices for each such island.
This function considers each point common to all the three input maps and checks if this point has a signal along all three axes (i.e. is a peak in terms of the 3D smoothed Z score). If so, it finds all its neighbours and from this set (island), it finds the one point with the highest height. It then saves the index of this point and proceeds to another common point in the three input maps.
[in] | map | Pointer to 1D array holding the 3D map value in which the peaks are to be found. Map must be cube! |
[in] | YZMap | The map containing peaks detected along the X-axis dimension using the smoothed Z score method. |
[in] | XZMap | The map containing peaks detected along the Y-axis dimension using the smoothed Z score method. |
[in] | XYMap | The map containing peaks detected along the z-axis dimension using the smoothed Z score method. |
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | allIslandBests | A vector which will be filled with the indices of the highest height point indices for each island. |
Definition at line 778 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::findAllPointNeighbours | ( | proshade_double * | YZMap, |
proshade_double * | XZMap, | ||
proshade_double * | XYMap, | ||
proshade_unsign * | visitedMap, | ||
proshade_signed | dim, | ||
proshade_signed | x, | ||
proshade_signed | y, | ||
proshade_signed | z, | ||
std::vector< proshade_unsign > * | retVals | ||
) |
This is a support function for the Z-score peak detection. It is currently not being used.
This function should not really be present here, it is a support function for smoothed Z-score peak detection, which is currently not being used.
[in] | YZMap | The map containing peaks detected along the X-axis dimension using the smoothed Z score method. |
[in] | XZMap | The map containing peaks detected along the Y-axis dimension using the smoothed Z score method. |
[in] | XYMap | The map containing peaks detected along the z-axis dimension using the smoothed Z score method. |
[in] | visitedMap | The map with 0 if point not yet considered and 1 if already done. |
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | x | The X-axis position of the currently considered point. |
[in] | y | The Y-axis position of the currently considered point. |
[in] | z | The Z-axis position of the currently considered point. |
[in] | retVals | A vector to which all neighbour indices will be added. |
Definition at line 719 of file ProSHADE_peakSearch.cpp.
std::vector< proshade_double * > ProSHADE_internal_peakSearch::findAllPointsAboveNeighbours | ( | proshade_complex * | map, |
proshade_unsign | dim, | ||
proshade_signed | peakSize, | ||
proshade_double * | medianIQR | ||
) |
This function finds all indices with higher value then all neighbours.
This function finds all map indices with higher height than all their neighbours (the size of neighbours in terms of surrounding points can be changed) and saves these as well as the neighbours into the output vector of double*. It also keeps track of the non-peak values and saves their median height and its IQR, so that the output vector could be cleared from these small (background) values.
[in] | map | Pointer to 1D array holding the 3D map value in which the peaks are to be found. Map must be cube! |
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | peakSize | The number of neighbouring points in single direction which should be considered as neighbours. |
[in] | medianIQR | Pointer to double[2] array where median and IQR of non-peak values will be saved. |
[out] | X | Vector of pointers to double numbers, first is the 'peak' (x,y,z and height) and then all neighbours follow in sets of 4 numbers. |
Definition at line 38 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::findAllSmoothedZScorePeaksWithNeighbours | ( | proshade_complex * | map, |
proshade_double * | YZMap, | ||
proshade_double * | XZMap, | ||
proshade_double * | XYMap, | ||
proshade_signed | dim, | ||
proshade_signed | peakSize, | ||
std::vector< proshade_double * > * | allPeaksWithNeighbours | ||
) |
This function firstly determines the highest peak of all smoothed Z score islands and then returns this point as well as all its neighbours.
This function firstly uses the findAllDisconnectedIslands function to combine the smoothed Z score maps and detect all discontinuous inslands in the combined map. Then, it uses the highest point in each island, finds all its neighbours as well as its X, Y and Z position and returns a vector containing all these values in a proshade_double pointer, which it allocates.
[in] | map | Pointer to 1D array holding the 3D map value in which the peaks are to be found. Map must be cube! |
[in] | YZMap | The map containing peaks detected along the X-axis dimension using the smoothed Z score method. |
[in] | XZMap | The map containing peaks detected along the Y-axis dimension using the smoothed Z score method. |
[in] | XYMap | The map containing peaks detected along the z-axis dimension using the smoothed Z score method. |
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | peakSize | The number of neighbouring points in single direction which should be considered as neighbours. |
[in] | allPeaksWithNeighbours | A vector which will have the x, y, and z positions and heights of all peaks and all their neighbours. |
Definition at line 854 of file ProSHADE_peakSearch.cpp.
std::vector< proshade_signed > ProSHADE_internal_peakSearch::findPeaks1D | ( | std::vector< proshade_double > | data | ) |
This function simply finds all the peaks in a 1D data array.
...
[in] | data | The input array containning (pressumably smoothened) data. |
[out] | peaks | A vector containing all the peak indices in the input array. |
Definition at line 1014 of file ProSHADE_peakSearch.cpp.
std::vector< proshade_double * > ProSHADE_internal_peakSearch::getAllPeaksNaive | ( | proshade_complex * | map, |
proshade_unsign | dim, | ||
proshade_signed | peakSize, | ||
proshade_double | noIQRs | ||
) |
This function finds peaks in the 3D map using the "naive" approach.
This function uses the "naive" approach (used in early versions of ProSHADE) to find all significant peaks in a map. To do this, it firstly locates all map points which have higher value than all their neighbours in all directions. It also computes the median and IQR of all non-higher points and it then uses the median + x * IQR threshold (x is the noIQRs parameter) to remove all map points with value under this thereshold. Finally, it optimises all the remaining values using the weighted average of all the neighbour points. The final output then is a vector with a single entry for each passing peak; this array has 4 values, the alpha, beta and gamma Euler angle values and the maximum peak heigh.
[in] | map | Pointer to 1D array holding the 3D map value in which the peaks are to be found. Map must be cube! |
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | peakSize | The number of neighbouring points in single direction which should be considered as neighbours. |
[in] | noIQRs | The number of IQRs from the median to determine minimal peak height. |
[out] | X | Vector of located peaks with pointers to arrays of 4 values: alpha, beta, gamma and peak heighht. |
Definition at line 316 of file ProSHADE_peakSearch.cpp.
std::vector< proshade_double * > ProSHADE_internal_peakSearch::getAllPeaksSmoothedZ | ( | proshade_complex * | map, |
proshade_unsign | dim, | ||
proshade_double | smoothingFraction, | ||
proshade_double | noIQRs, | ||
proshade_signed | peakSize | ||
) |
This function finds peaks in the 3D map using the smoothed Z score approach.
This function implements the smoothed Z-score peak detection. It is currently not being used and is most likely severly bugged.
[in] | map | Pointer to 1D array holding the 3D map values in which the peaks are to be found. Map must be cube! |
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | peakSize | The number of neighbouring points in single direction which should be considered as neighbours. |
[in] | noIQRs | The number of IQRs from the median to determine minimal peak height. |
[in] | peakSize | The number of neighbouring points in single direction which should be considered as neighbours. |
[out] | X | Vector of located peaks with pointers to arrays of 5 values: x, y, z, angle and peak heighht. |
Definition at line 923 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::getBestPeakEulerAngsNaive | ( | proshade_complex * | map, |
proshade_unsign | dim, | ||
proshade_double * | eulA, | ||
proshade_double * | eulB, | ||
proshade_double * | eulG, | ||
ProSHADE_settings * | settings | ||
) |
This function finds the highest peaks optimised Euler angles using the "naive" approach.
This function uses the same "naive" approach as discussed in the previous function. It firstly gets the full list of all "naive" peaks, it then optimises all such peaks and finds the largest (i.e. highest height) peak. For this single best peak, it finally returns the Euler angle values.
[in] | map | Pointer to 1D array holding the 3D map value in which the peaks are to be found. Map must be cube! |
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | noIQRs | The number of IQRs from the median to determine minimal peak height. |
[in] | eulA | Pointer to where the Euler alpha angle value will be saved. |
[in] | eulB | Pointer to where the Euler beta angle value will be saved. |
[in] | eulG | Pointer to where the Euler gamma angle value will be saved. |
[in] | settings | The ProSHADE_settings object containing all the values required for making decisions. |
Definition at line 352 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::getBestPeakEulerAngsSmoothedZ | ( | proshade_complex * | map, |
proshade_unsign | dim, | ||
proshade_double | smoothingFraction, | ||
proshade_double | noIQRs, | ||
proshade_signed | peakSize, | ||
proshade_double * | eulA, | ||
proshade_double * | eulB, | ||
proshade_double * | eulG | ||
) |
This function finds the highest peaks optimised Euler angles using the smoothed Z score approach.
This function uses the best peak detected using the smoothed Z-score peak detection to compute its Euler angles. It is currently not being used and is most likely severly bugged.
[in] | map | Pointer to 1D array holding the 3D map value in which the peaks are to be found. Map must be cube! |
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | peakSize | The number of neighbouring points in single direction which should be considered as neighbours. |
[in] | noIQRs | The number of IQRs from the median to determine minimal peak height. |
[in] | eulA | Pointer to where the Euler alpha angle value will be saved. |
[in] | eulB | Pointer to where the Euler beta angle value will be saved. |
[in] | eulG | Pointer to where the Euler gamma angle value will be saved. |
Definition at line 976 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::getSmoothedZScore1D | ( | proshade_unsign | dim, |
proshade_unsign | smoothingLag, | ||
proshade_double | ZScoreThreshold, | ||
proshade_signed * | signals, | ||
proshade_double * | filteredY, | ||
proshade_double * | avgFilter, | ||
proshade_double * | stdFilter, | ||
proshade_double * | subVec, | ||
proshade_double * | medianIQR, | ||
proshade_double * | scoreOverVals | ||
) |
This function computes the 1D peaks for a 1D input array and returns array of int's as signal.
This function implements the smoothed Z score peak searching algorithm. It takes a number of previous values (assuming periodicity) and computes the median and IQR. It then checks if the current value is X IQR's from the median and reports peak if so. In this case, it also saves the value with decreased weight to make sure the sliding window for following indices will not have too high values due to previous peaks. If no peak is found, it saves the value as is. Finally, the function pre- computes the median and IQR for the next index and iterates.
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | smoothingLag | The size of the smoothing window. |
[in] | ZScoreThreshold | The number of IQRs from median forming a peak. |
[in] | signals | Pointer to where the results of the 1D peak searches will be saved. |
[in] | filteredY | Pointer to where the weighted smoothed scores will be saved. |
[in] | avgFilter | Pointer to where the median values will be saved. |
[in] | stdFilter | Pointer to where the IQR values will be saved. |
[in] | subVec | Pointer to where temporary computations will be done. |
[in] | medianIQR | Pointer to simple array of 2 for returning results. |
[in] | scoreOverVals | Pointer to where the 1D cuts from the 3D map live. |
Definition at line 501 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::getXAxisArraysSmoothedZScorePeaks | ( | proshade_unsign | dim, |
proshade_unsign | smoothingLag, | ||
proshade_double | ZScoreThreshold, | ||
proshade_signed * | signals, | ||
proshade_double * | filteredY, | ||
proshade_double * | avgFilter, | ||
proshade_double * | stdFilter, | ||
proshade_double * | subVec, | ||
proshade_double * | medianIQR, | ||
proshade_double * | scoreOverVals, | ||
proshade_complex * | map, | ||
proshade_double * | YZMap | ||
) |
This function runs the 1D smoothed Z score algorithm on all X-axis arrays as its inputs.
This function iterates through all YZ map positions and at each, takes all the X values and subjects them to the 1D smoothed Z score peak search. It also saves the resulting signals into a map, which therefore contains all the X-axis peaks of the map.
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | smoothingLag | The size of the smoothing window. |
[in] | ZScoreThreshold | The number of IQRs from median forming a peak. |
[in] | signals | Pointer to where the results of the 1D peak searches will be saved. |
[in] | filteredY | Pointer to where the weighted smoothed scores will be saved. |
[in] | avgFilter | Pointer to where the median values will be saved. |
[in] | stdFilter | Pointer to where the IQR values will be saved. |
[in] | subVec | Pointer to where temporary computations will be done. |
[in] | medianIQR | Pointer to simple array of 2 for returning results. |
[in] | scoreOverVals | Pointer to where the 1D cuts from the 3D map live. |
[in] | map | The map in which the peaks are to be found. |
[in] | YZMap | The map where the results will be saved. |
Definition at line 576 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::getYAxisArraysSmoothedZScorePeaks | ( | proshade_unsign | dim, |
proshade_unsign | smoothingLag, | ||
proshade_double | ZScoreThreshold, | ||
proshade_signed * | signals, | ||
proshade_double * | filteredY, | ||
proshade_double * | avgFilter, | ||
proshade_double * | stdFilter, | ||
proshade_double * | subVec, | ||
proshade_double * | medianIQR, | ||
proshade_double * | scoreOverVals, | ||
proshade_complex * | map, | ||
proshade_double * | XZMap | ||
) |
This function runs the 1D smoothed Z score algorithm on all Y-axis arrays as its inputs.
This function iterates through all YZ map positions and at each, takes all the Y values and subjects them to the 1D smoothed Z score peak search. It also saves the resulting signals into a map, which therefore contains all the Y-axis peaks of the map.
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | smoothingLag | The size of the smoothing window. |
[in] | ZScoreThreshold | The number of IQRs from median forming a peak. |
[in] | signals | Pointer to where the results of the 1D peak searches will be saved. |
[in] | filteredY | Pointer to where the weighted smoothed scores will be saved. |
[in] | avgFilter | Pointer to where the median values will be saved. |
[in] | stdFilter | Pointer to where the IQR values will be saved. |
[in] | subVec | Pointer to where temporary computations will be done. |
[in] | medianIQR | Pointer to simple array of 2 for returning results. |
[in] | scoreOverVals | Pointer to where the 1D cuts from the 3D map live. |
[in] | map | The map in which the peaks are to be found. |
[in] | XZMap | The map where the results will be saved. |
Definition at line 625 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::getZAxisArraysSmoothedZScorePeaks | ( | proshade_unsign | dim, |
proshade_unsign | smoothingLag, | ||
proshade_double | ZScoreThreshold, | ||
proshade_signed * | signals, | ||
proshade_double * | filteredY, | ||
proshade_double * | avgFilter, | ||
proshade_double * | stdFilter, | ||
proshade_double * | subVec, | ||
proshade_double * | medianIQR, | ||
proshade_double * | scoreOverVals, | ||
proshade_complex * | map, | ||
proshade_double * | XYMap | ||
) |
This function runs the 1D smoothed Z score algorithm on all Z-axis arrays as its inputs.
This function iterates through all XY map positions and at each, takes all the Z values and subjects them to the 1D smoothed Z score peak search. It also saves the resulting signals into a map, which therefore contains all the Z-axis peaks of the map.
[in] | dim | The size of one dimension of the map (assuming cube map). |
[in] | smoothingLag | The size of the smoothing window. |
[in] | ZScoreThreshold | The number of IQRs from median forming a peak. |
[in] | signals | Pointer to where the results of the 1D peak searches will be saved. |
[in] | filteredY | Pointer to where the weighted smoothed scores will be saved. |
[in] | avgFilter | Pointer to where the median values will be saved. |
[in] | stdFilter | Pointer to where the IQR values will be saved. |
[in] | subVec | Pointer to where temporary computations will be done. |
[in] | medianIQR | Pointer to simple array of 2 for returning results. |
[in] | scoreOverVals | Pointer to where the 1D cuts from the 3D map live. |
[in] | map | The map in which the peaks are to be found. |
[in] | XYMap | The map where the results will be saved. |
Definition at line 674 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::optimisePeakPositions | ( | std::vector< proshade_double * > * | pointVec, |
proshade_signed | peakSize, | ||
proshade_signed | band | ||
) |
This function optimises all the peaks in the input vector using the values of their neighbours.
This function takes the vector of arrays containing the peak and all its neighbours and proceeds to obtain the rotation matrices for the peak and all its neighbours. It then computes the weighted average matrix from the combination of all the matrices. By subjecting this weighted average matrix to SVD (using LAPACK) and combining the two rotation matrices (U and V^T), the optimised rotation matrix is obtained. This rotation matrix is then converted to Euler angles representation and these values are finally saved over the old all neighbours containing pointers. Thus, the number of peaks does not change, but each peak now only has 4 values - alpha, beta, gamma and peak height.
[in] | pointVec | Vector of double pointers as returned by pointsAboveNeighboursRemoveSmallHeight(). |
[in] | peakSize | The number of neighbouring points in single direction which should be considered as neighbours. |
[in] | band | The maximum bandwidth of the computation. |
Definition at line 221 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::pointsAboveNeighboursRemoveSmallHeight | ( | std::vector< proshade_double * > * | pointVec, |
proshade_double * | medianIQR, | ||
proshade_double | noIQRs | ||
) |
This function clears the 'higher than neighbour' vector from background values.
This function simply takes all the 'higher than all neighbours' indices vector and a threshold defining values and proceeds to compute the threshold for calling the indice a peak. Then, it applies this threshold to the vector, keeping only the indices which have higher value than the threshold.
[in] | pointVec | Vector of double pointers as returned by findAllPointsAboveNeighbours(). |
[in] | medianIQR | Array of two numbers, the median and IQR for which should be used to remove 'background' points in the vector. |
[in] | noIQRs | The number of IQRs from median to be used to create the cut-off threshold. |
Definition at line 132 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::releasePeakOptimisationMemory | ( | proshade_double *& | avgMat, |
proshade_double *& | hlpMat, | ||
proshade_double *& | eA, | ||
proshade_double *& | eB, | ||
proshade_double *& | eG, | ||
proshade_double *& | uAV | ||
) |
This function deletes all the peak optimisation memory.
[in] | avgMat | The matrix which will take the weighted sum of the neighbour values. |
[in] | hlpMat | The helper matrix to store temporary results. |
[in] | eA | The Euler angle alpha value. |
[in] | eB | The Euler beta alpha value. |
[in] | eG | The Euler gamma alpha value. |
[in] | uAV | The U and V^T matrices resulting from the SVD. |
Definition at line 193 of file ProSHADE_peakSearch.cpp.
void ProSHADE_internal_peakSearch::releaseSmoothingZScoreMemory | ( | proshade_double *& | scoreOverVals, |
proshade_signed *& | signals, | ||
proshade_double *& | filteredY, | ||
proshade_double *& | avgFilter, | ||
proshade_double *& | stdFilter, | ||
proshade_double *& | subVec, | ||
proshade_double *& | medianIQR, | ||
proshade_double *& | YZMap, | ||
proshade_double *& | XZMap, | ||
proshade_double *& | XYMap | ||
) |
This function releases the memory required for smoothed Z score computation.
[in] | scoreOverVals | Pointer to where the 1D cuts from the 3D map will be saved. |
[in] | signals | Pointer to where the results of the 1D peak searches will be saved. |
[in] | filteredY | Pointer to where the weighted smoothed scores will be saved. |
[in] | avgFilter | Pointer to where the median values will be saved. |
[in] | stdFilter | Pointer to where the IQR values will be saved. |
[in] | subVec | Pointer to where temporary computations will be done. |
[in] | medianIQR | Pointer to simple array of 2 for returning results. |
[in] | YZMap | Pointer to where the X-axis peaks will be saved. |
[in] | XZMap | Pointer to where the Y-axis peaks will be saved. |
[in] | XYMap | Pointer to where the Z-axis peaks will be saved. |
Definition at line 463 of file ProSHADE_peakSearch.cpp.