tumourkit.postprocessing.merge_cells.merge_cells

tumourkit.postprocessing.merge_cells.merge_cells(png: ndarray, vec_mapping: Callable[[ndarray], ndarray], inv_diff_mapping: Dict[int, Tuple[int, int]]) ndarray

Merges cells in a binary image based on the shared frontier length.

Parameters:
  • png (np.ndarray) – The binary image containing cells.

  • vec_mapping (Callable[[np.ndarray], np.ndarray]) – The vectorized mapping function to map indices.

  • inv_diff_mapping (Dict[int, Tuple[int, int]]) – The inverse mapping of differences between indices.

Returns:

The merged binary image.

Return type:

np.ndarray