scallops.codebook.decode_metric

scallops.codebook.decode_metric(array, codebook, metric='euclidean', norm_order=2, scale_factors=None, min_intensity=0, max_distance=inf)

Call features using the supplied codebook.

Parameters:
  • array (DataArray) – 5-d array with dimensions t, c, z, y, x

  • codebook (DataArray) – The codebook used to call features. Dimensions are f, t, c (feature, time, channel)

  • norm_order (int) – Norm to apply (numpy:reference/generated/numpy.linalg.norm)

  • metric (Literal['braycurtis', 'canberra', 'chebyshev', 'cityblock', 'euclidean', 'haversine', 'infinity', 'kulsinski', 'l1', 'l2', 'manhattan', 'matching', 'minkowski', 'p', 'seuclidean', 'sqeuclidean']) – Distance metric

  • min_intensity (float) – Minimum intensity to include

  • max_distance (float) – Maximum distance between a feature and its closest code for which the coded target will be assigned.

  • scale_factors (ndarray) – Optional 1-d array (time, channel) to divide array by

Returns:

Data frame containing called features

Return type:

DataFrame