opendvp.utils.parse_color_for_qupath

opendvp.utils.parse_color_for_qupath#

parse_color_for_qupath(color_dict, adata, adata_obs_key)#

Parse and convert color definitions to a format compatible with QuPath.

Parameters:
  • color_dict (dict) – Dictionary mapping category names to color definitions (RGB tuples, lists, or hex strings).

  • adata (anndata.AnnData) – AnnData object containing observation data.

  • adata_obs_key (str) – Key in adata.obs specifying the categorical variable to assign colors to.

Returns:

Dictionary mapping category names to [R, G, B] lists with values in the range 0-255.

Return type:

dict