campa.pl.annotate_img
- annotate_img(img, annotation=None, from_col='clustering', to_col=None, color=False)[source]
Annotate cluster image.
- Parameters
img (
ndarray) – Image to annotate.annotation (
Optional[DataFrame]) –Cluster.cluster_annotationcontaining mapping of classes to cluster names and colours.from_col (
str) – Annotation column containing current values in image.to_col (
Optional[str]) – Annotation column containing desired mapping. If None, usefrom_col.color (
bool) – If True, use annotation columnto_col+"_colors"to get colormap and colour image.
- Return type
Annotated image.