cellmap_flow.ai_annotate.organelles

What the model is told about each structure it can be asked to paint.

A catalog of organelles: the colour to ask the model to paint each one, and a description of how it looks in EM to ground the request in what the structure actually looks like. Adapted from ask-to-mask’s ORGANELLES catalog, keeping only the fields this feature uses. A label name the catalog does not know still works (resolve_organelle_profile), just without a description.

The colours are distinct within the catalog but need not be unique across it (cells and mitochondria are both red): one request asks for one structure.

Attributes

ORGANELLES

Classes

OrganelleProfile

One structure: catalog key, plural name as used in the prompt, the

Functions

find_organelle_profile(label_name) → OrganelleProfile | None

The catalog profile a free-text label name means, or None.

resolve_organelle_profile(label_name) → OrganelleProfile

The catalog profile for label_name, or a generic one built from it.

Module Contents

class cellmap_flow.ai_annotate.organelles.OrganelleProfile

One structure: catalog key, plural name as used in the prompt, the colour asked for (as words for the prompt, and as RGB to find it in the reply), and its EM appearance.

key: str
name: str
color_name: str
rgb: tuple[int, int, int]
description: str = ''
cellmap_flow.ai_annotate.organelles.ORGANELLES: dict[str, OrganelleProfile]
cellmap_flow.ai_annotate.organelles.find_organelle_profile(label_name: str) → OrganelleProfile | None

The catalog profile a free-text label name means, or None.

Matches a key, a name or a known alias, ignoring case, surrounding whitespace, and -/_ versus spaces. None lets the caller fall back to a generic profile.

cellmap_flow.ai_annotate.organelles.resolve_organelle_profile(label_name: str) → OrganelleProfile

The catalog profile for label_name, or a generic one built from it.

A label the catalog does not know still works: the prompt names it as typed and asks for bright red, just without an EM-appearance description.