Skip to content

Widgets

Jupyter (ipywidgets) interfaces. They do not work in marimo; the marimo notebooks build the same choices from mo.ui elements on the same core functions.

omero_annotate_ai.widgets.omero_connection_widget.create_omero_connection_widget

create_omero_connection_widget() -> OMEROConnectionWidget

Create an OMERO connection widget.

Returns:

Type Description
OMEROConnectionWidget

OMEROConnectionWidget instance

omero_annotate_ai.widgets.omero_connection_widget.OMEROConnectionWidget

OMEROConnectionWidget()

Interactive widget for creating OMERO connections with secure password storage.

Initialize the OMERO connection widget.

display

display()

Display the widget.

get_connection

get_connection()

Get the current OMERO connection.

Returns:

Type Description

BlitzGateway connection object or None

omero_annotate_ai.widgets.workflow_widget.create_workflow_widget

create_workflow_widget(connection: Any = None, *, home: str | Path | None = None) -> WorkflowWidget

Create the workflow widget (call .display() to show it).

omero_annotate_ai.widgets.workflow_widget.WorkflowWidget

WorkflowWidget(connection: Any = None, *, home: str | Path | None = None)

Create a new training set or open one, then follow the annotation.

display

display() -> None

Show the widget in the notebook.

get_config

get_config() -> AnnotationConfig

The config a "New training set" would be created from (a fresh copy).

request

request() -> Request

The form as a request for :func:open_or_create.

training_set

training_set(**kwargs: Any) -> TrainingSet

The training set of the form, created or opened on first call.

kwargs go to :func:open_or_create.

annotate

annotate(annotator: Annotator | None = None, note: str | None = None) -> int

Run a session with the form's model and batch size.

Annotates the pending units, or - with Review annotated chosen for an opened set - opens the annotated units with their masks to correct them.

events

events(event: Event) -> None

Event sink: annotation progress is shown in the Progress card.

set_connection

set_connection(connection: Any) -> None

Use another OMERO connection (reloads the containers).

omero_annotate_ai.widgets.workflow_widget.open_or_create

open_or_create(request: Request, conn: Any = None, *, home: str | Path | None = None, events: Callable[[Event], None] | None = None, **kwargs: Any) -> TrainingSet

Resolve a widget request to a training set.

kwargs go to :meth:TrainingSet.create / :meth:TrainingSet.open (e.g. an image_source). For an open request, request.add images per split are added to the set's current counts (zero adds nothing).

omero_annotate_ai.widgets.workflow_widget.NewTrainingSet dataclass

NewTrainingSet(config: AnnotationConfig)

Create a training set from config.

omero_annotate_ai.widgets.workflow_widget.OpenTrainingSet dataclass

OpenTrainingSet(ref: int | Path, add: dict[str, int])

Open the set ref (table ID or folder) and add images per split.

omero_annotate_ai.widgets.training_data_widget.create_training_data_widget

create_training_data_widget(connection: Any = None, *, home: str | Path | None = None, show_export: bool = True) -> TrainingDataWidget

Create the training-data widget (call .display() to show it).

show_export=False keeps only the set picker, for notebooks that export differently (e.g. a BioImage Archive submission).

omero_annotate_ai.widgets.training_data_widget.TrainingDataWidget

TrainingDataWidget(connection: Any = None, *, home: str | Path | None = None, show_export: bool = True)

Pick a training set (OMERO or local) and export it into the training layout.

selected property

selected: int | Path | None

The picked set: a table ID (OMERO) or a folder (local); None if none.

display

display() -> None

Show the widget in the notebook.

get_selected_table_id

get_selected_table_id() -> int | None

The picked set's table ID; None for a local set or no selection.

selected_config

selected_config() -> AnnotationConfig | None

The picked set's config (read-only copy); None if none is picked.

export

export() -> dict[str, Any]

Export the picked set with the form's options; returns the export result.

set_connection

set_connection(connection: Any) -> None

Use another OMERO connection (reloads the containers).