fishdist.point_pairing

pair_points_by_distance(points1, points2, threshold=3, rescaling_factor=None)

Pair points from two sets based on minimal Euclidean distance within a threshold.

Each point in points1 is matched to the closest point in points2 if the distance is below threshold. Existing pairings are updated if a closer match is found.

Parameters:
  • points1 (np.ndarray of shape (N, 3)) –

    First set of 3D points (e.g., measured points).

  • points2 (np.ndarray of shape (M, 3)) –

    Second set of 3D points (e.g., reference points).

  • threshold (float or None, default=3, default: 3 ) –

    Maximum allowed distance for pairing.

  • rescaling_factor (array-like of length 3 or None, default=None, default: None ) –

    Scaling factor to convert points into physical units (e.g., voxel size).

Returns:
  • dict

    Mapping of points from points1 to their closest point in points2.