fastgac.peak_and_cluster.find_peaks_from_ico_charts

fastgac.peak_and_cluster.find_peaks_from_ico_charts(ico_charts, normalized_bucket_counts_by_vertex, vertices=None, find_peaks_kwargs={'exclude_border': False, 'indices': False, 'min_distance': 1, 'threshold_abs': 25}, cluster_kwargs={'criterion': 'distance', 't': 0.1}, average_filter={'min_total_weight': 0.15})

Detect peaks inside a 2D image from an unwrapped refined icosahedron.

2D peak detection is carried out using skimage.feature.peak_local_max. Note the image inside ico_charts is already normalized between 0-255 (NOT 0-1), find_peaks_kwargs.

After the peaks are detected we group them using Agglomerative Hierarchal Clustering (AHC), cluster_kwargs.

After things are grouped, take weighted average of the group (using normalized_bucket_counts_by_vertex) and filter any that don’t meet a min value, average_filter.

Parameters
  • ico_charts (IcoChart) – The IcoChart of the unwrapped refined icosahedron (GA)

  • normalized_bucket_counts_by_vertex (np.ndarray) – NX1 Array. The normalized histogram count (0-1) of the vertices of the icosahedron (used for to weight groups after AHC)

  • find_peaks_kwargs (dict, optional) – Keyword arguments for peak detection. See skimage.feature.peak_local_max. Defaults to dict(threshold_abs=25, min_distance=1, exclude_border=False, indices=False).

  • cluster_kwargs (dict, optional) – AHC cluster kwargs. See scipy.spatial.fcluster Defaults to dict(t=0.10, criterion=’distance’).

  • average_filter ([type], optional) – Each group must have this much normalized value at min. Defaults to dict(min_total_weight=0.15).

Returns

integer index of peaks in gaussian_normals_sorted, interger groups by AHC, detected peak normals, the weights of the peaks

Return type

[np.ndarray, np.ndarray, np.ndarray, np.ndarray]