tumourkit.preprocessing.centroidspng2csv.extract_centroids
- tumourkit.preprocessing.centroidspng2csv.extract_centroids(img: ndarray) List[Tuple[int, int, int]]
Extracts the centroids of cells from a labeled image. The third coordinates is the index.
- Parameters:
img (np.ndarray) – A 2D NumPy array representing the labeled image. Each unique non-zero value represents a different cell.
- Returns:
A list of tuples containing the x and y coordinates of the centroid, and the cell index.
- Return type:
List[Tuple[int,int,int]]