mednet.engine.segment.viewer

Functions

view(basedir, stem, threshold, show_errors, ...)

Create an segmentation map visualisation.

mednet.engine.segment.viewer.view(basedir, stem, threshold, show_errors, tp_color, fp_color, fn_color, alpha)[source]

Create an segmentation map visualisation.

Parameters:
  • basedir (Path) – Base directory where the prediction indicated by stem is stored.

  • stem (str) – Name of the HDF5 file containing the predictions, as output by the predict CLI.

  • threshold (float) – The threshold to apply to the probability map loaded from the HDF5 file.

  • show_errors (bool) – If set to True, then colours false-positives (in red), and false negatives (in green).

  • tp_color (tuple[int, int, int]) – Tuple that indicates which color to use for displaying true-positives.

  • fp_color (tuple[int, int, int]) – Tuple that indicates which color to use for displaying false-positives.

  • fn_color (tuple[int, int, int]) – Tuple that indicates which color to use for displaying false-negatives.

  • alpha (float) – How transparent will the overlay be.

Return type:

Image

Returns:

An image with an overlayed segmentation map that can be saved or displayed.