tumourkit.preprocessing.pngcsv2graph.pngcsv2graph

tumourkit.preprocessing.pngcsv2graph.pngcsv2graph(img: ndarray, png: ndarray, csv: DataFrame) DataFrame

Converts an original image and PNGCSV labels into a graph representation.

Given the original image and PNGCSV labels, this function extracts attributes from each label and constructs a graph representation in the form of a DataFrame.

The current attributes extracted for each label include:
  • X, Y coordinates of the centroid

  • Area

  • Perimeter

  • Variance

  • Regularity (not yet implemented)

  • Histogram (5 bins)

Parameters:
  • img (np.ndarray) – The original image.

  • png (np.ndarray) – The PNGCSV labels.

  • csv (pd.DataFrame) – The CSV file containing label information.

Returns:

The graph representation in the form of a DataFrame.

Return type:

pd.DataFrame