Skip to content

OmeroGateway

OmeroGateway

OmeroGateway(parent: QObject | None = None)

Bases: QObject

Singleton gateway for OMERO server connections.

Signals

connected(str) Emitted with the server host when a connection is established. disconnected() Emitted when the connection is closed. error(str) Emitted with a human-readable message on connection failure.

connect

connect(host: str, port: int, username: str, password: str, *, remember_session: bool = False) -> bool

Open a connection to the OMERO server.

Returns True on success. On failure emits :pyqtSignal:error and returns False.

try_restore_session

try_restore_session() -> bool

Try to reconnect using a cached OMERO session UUID.

Returns True if the cached session was reused successfully. Invalid or expired cached sessions are cleared automatically.

shutdown_for_exit

shutdown_for_exit() -> None

Release the local client at app shutdown without closing a valid cached session.

get_connection

get_connection()

Return the underlying BlitzGateway or None.

runtime_login_fields

runtime_login_fields() -> dict[str, str | int]

Return in-memory login values cached for the current app run only.

get_groups

get_groups()

Return list of (id, name) tuples for groups the user belongs to.

get_experimenters_in_group

get_experimenters_in_group(group_id: int)

Return list of (id, full_name) tuples for a group.

saved_servers staticmethod

saved_servers() -> list[str]

Return previously-used server hostnames.

pixels_wrapper

pixels_wrapper(image) -> NonCachedPixelsWrapper

Return a NonCachedPixelsWrapper for image.


Helper: raw_pixels_store

raw_pixels_store

raw_pixels_store(image) -> Generator

Context manager that yields an ICE RawPixelsStore for image, ensuring proper cleanup.


Helper: NonCachedPixelsWrapper

NonCachedPixelsWrapper

NonCachedPixelsWrapper(image)

Thin wrapper that creates a fresh RawPixelsStore on every call.

Avoids reuse issues that can occur when a single store is shared across multiple fetch operations.