tumourkit.utils.preprocessing.read_centroids

tumourkit.utils.preprocessing.read_centroids(name: str, path: str) ndarray

Reads a CSV file from the specified directory containing centroids and returns their contents as a NumPy array.

Parameters:
  • name (str) – The base name of the CSV file (without extension).

  • path (str) – The directory containing the CSV file.

Returns:

A NumPy array containing the centroids with class -1 removed and coordinates converted to integers.

Return type:

np.ndarray

This function reads a CSV file from the specified directory containing centroids and returns their contents as a NumPy array. The function expects the CSV file to have specific column names: ‘X’, ‘Y’, and ‘class’. Centroids with class -1 are dropped and the coordinates are converted to integers.