tumourkit.preprocessing.pngcsv2centroids.extract_centroids
- tumourkit.preprocessing.pngcsv2centroids.extract_centroids(img: ndarray, csv: DataFrame) List[Tuple[int, int, int]]
Extracts the centroids of cells from a labeled image. The third coordinate is the class.
- Parameters:
img (np.ndarray) – A 2D NumPy array representing the labeled image. Each unique non-zero value represents a different cell.
csv (pd.DataFrame) – A pandas DataFrame representing the labels. Just two colums, one for id and another for the class.
- Returns:
A list of tuples containing the x and y coordinates of the centroid, and the cell class.
- Return type:
List[Tuple[int,int,int]]