tumourkit.preprocessing.pngcsv2geojson.pngcsv2features
- tumourkit.preprocessing.pngcsv2geojson.pngcsv2features(png: ndarray, csv: DataFrame, label: int, num_classes: int | None = 2) List[Dict[str, Any]]
Computes geojson features of contours of a given class.
- Parameters:
png (np.ndarray) – Segmentation mask with indices as pixel values.
csv (pd.DataFrame) – DataFrame with the classes of the cells in the image.
label (int) – The label of the class of cells to extract features for.
num_classes (Optional[int], optional) – The number of classes in the segmentation mask, defaults to 2.
- Returns:
A list of dictionaries with the geojson features of the contours of the specified class of cells.
- Return type:
List[Dict[str, Any]]