utils
Utility function associated with the analysis submodule.
filter_peaks_by_distance(peak_values, peak_locations, distance_threshold)
Filters peaks in descending order with a distance threshold.
If any peaks are within a distance threshold of an already picked peak, they are suppressed. Precedence is given to peaks with the highest value.
NOTE: This function operates on 2D data only and distance metrics are measured in pixels.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
peak_values
|
Tensor
|
Tensor of peak values. |
required |
peak_locations
|
Tensor
|
Tensor of peak locations, shape (N, 2) where N is the number of peaks. |
required |
distance_threshold
|
float
|
Minimum distance between peaks to be considered separate peaks. |
required |
Source code in src/leopard_em/analysis/utils.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|