tumourkit.preprocessing.pngcsv2geojson.create_mask

tumourkit.preprocessing.pngcsv2geojson.create_mask(png: ndarray, csv: DataFrame, label: int) ndarray

Returns an image with only the pixels of the class given in the label.

Parameters:
  • png (np.ndarray) – Segmentation mask with indices as pixel values.

  • csv (pd.DataFrame) – DataFrame containing the class labels for each cell in the image.

  • label (int) – Class label to extract from the image.

Returns:

Binary mask where pixels of the specified class have value 1 and all others have value 0.

Return type:

np.ndarray