tumourkit.utils.postprocessing.remove_idx

tumourkit.utils.postprocessing.remove_idx(a: Tuple[int, int, List[Tuple[float, float]]], a_idx: List[int]) Tuple[int, int, List[Tuple[float, float]]]

Removes all the indices in a’s contour that are included in a_idx’s greatest connected component.

Parameters:
  • a (Cell) – The cell containing the contour to modify.

  • a_idx (list[int]) – A list of indices.

Returns:

The modified cell containing the contour with the specified indices removed.

Return type:

Cell

This function takes a cell a and a list of indices a_idx as input and removes from the contour in a all indices that are included in the greatest connected component of a_idx. The function calls the get_greatest_connected_component() function to determine the left and right indices of the greatest connected component. The function then creates a new list of indices that includes all the indices in the contour of a that are not in the greatest connected component of a_idx. The function returns a new cell containing the original cell’s first two elements and the modified list of indices as the third element.