tumourkit.utils.postprocessing.create_comparator

tumourkit.utils.postprocessing.create_comparator(threshold: float, num_frontier: int) Callable[[List[Tuple[float, float]], List[Tuple[float, float]]], bool]

Returns a comparator function between two contours.

Parameters:
  • threshold (float) – The maximum distance allowed between the num_frontier closest pairs of points to consider two contours equal.

  • num_frontier (int) – The number of closest pairs of points to consider when comparing contours.

Returns:

A function that takes two contours as input and returns True if the two contours are equal, False otherwise.

Return type:

Callable

This function returns a comparator function between two contours. The comparator function takes two contours as input and returns True if the two contours are equal and False otherwise. Two contours are considered equal if their num_frontier closest pairs of points are at a distance lower than the specified threshold. The function returns the comparator function as a callable object.