Skip to main content

Reusable PyQt6 dialog for browsing and retrieving images from OMERO via ICE

Project description

omero-browser-qt

Reusable PyQt6 dialog for browsing and retrieving images from OMERO servers. Pixel data is fetched exclusively through the ICE transport layer so you always get the real stored values (not rendered RGB).

Features

  • Login dialog with server-name history (credentials are never stored)
  • QuPath-style browser — resizable dialog with:
    • Group / Owner filter combos
    • Lazy-loading Project → Dataset → Image tree
    • Image thumbnail preview (256 × 256)
    • Attribute table (dimensions, pixel sizes, acquisition date, …)
    • Name filter
  • ICE pixel loading via RawPixelsStore
    • Full 5-D array fetch (getPlane)
    • Tile-based dask lazy loading for large / pyramidal images (getTile)
  • Designed to be embedded in any PyQt6 application

Prerequisites: ZeroC ICE + omero-py

omero-py depends on ZeroC ICE, which cannot be built from source on modern Python. Pre-built wheels are available for Python 3.10 – 3.12 from Glencoe Software:

https://www.glencoesoftware.com/blog/2023/12/08/ice-binaries-for-omero.html

Install them before installing this package:

# 1. Install the pre-built ZeroC ICE wheel (pick your platform)
pip install https://github.com/glencoesoftware/zeroc-ice-py-linux-x86_64/releases/download/20240202/zeroc_ice-3.6.5-cp310-cp310-manylinux_2_28_x86_64.whl   # Linux / Python 3.10
pip install https://github.com/glencoesoftware/zeroc-ice-py-win-x86_64/releases/download/20240202/zeroc_ice-3.6.5-cp310-cp310-win_amd64.whl               # Windows / Python 3.10
pip install https://github.com/glencoesoftware/zeroc-ice-py-macosx-x86_64/releases/download/20240202/zeroc_ice-3.6.5-cp310-cp310-macosx_10_16_x86_64.whl   # macOS Intel / Python 3.10
# See the blog post above for cp311 / cp312 URLs and ARM variants.

# 2. Install omero-py (now that ICE is available)
pip install omero-py

Alternatively, use conda:

conda install -c conda-forge zeroc-ice omero-py

Installation

pip install omero-browser-qt

With the demo viewer

pip install "omero-browser-qt[viewer]"

Quick start

from PyQt6.QtWidgets import QApplication
from omero_browser_qt import OmeroGateway, LoginDialog, OmeroBrowserDialog

app = QApplication([])
gw = OmeroGateway()

# 1. Login (only server names are remembered)
if LoginDialog(gateway=gw).exec():

    # 2. Browse & select images
    dlg = OmeroBrowserDialog(gateway=gw)
    if dlg.exec():
        for img in dlg.get_selected_images():
            print(img.getName(), img.getId())

    gw.disconnect()

Loading pixel data

from omero_browser_qt import load_image_data, load_image_lazy, is_large_image

# For regular images — returns numpy arrays
result = load_image_data(image_wrapper)
volumes = result["images"]   # list of np.ndarray, one per channel, shape (Z, Y, X)
meta    = result["metadata"]

# For large / pyramidal images — returns dask arrays
if is_large_image(image_wrapper):
    result = load_image_lazy(image_wrapper)
    # result["images"] is a list (per channel) of lists (per resolution level) of dask arrays

Demo viewer

A stripped-down multi-channel image viewer is included as an example. It supports opening images from local files (via bioio) and from OMERO:

python examples/viewer_demo.py

Controls:

  • Open File… — load a local OME-TIFF, ND2, CZI, etc.
  • Open from OMERO… — launches the login + browser dialogs
  • Projection — Slice / MIP (max intensity) / SUM
  • Z slider — navigate slices (enabled in Slice mode)
  • Lo% / Hi% — percentile-based contrast adjustment
  • Channel buttons — toggle individual channels on/off
  • Mouse wheel — zoom; middle-drag — pan

Publishing to PyPI

# 1. Install build tools
pip install build twine

# 2. Build the package
python -m build          # creates dist/omero_browser_qt-0.1.0.tar.gz + .whl

# 3. Validate
twine check dist/*

# 4. Create a PyPI account and API token
#    → https://pypi.org/manage/account/token/

# 5. Upload
twine upload dist/*
#    Username: __token__
#    Password: <your-api-token>

For subsequent releases: bump the version in pyproject.toml, rebuild, and re-upload.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omero_browser_qt-0.1.1.tar.gz (201.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omero_browser_qt-0.1.1-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file omero_browser_qt-0.1.1.tar.gz.

File metadata

  • Download URL: omero_browser_qt-0.1.1.tar.gz
  • Upload date:
  • Size: 201.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for omero_browser_qt-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d97183355efe46814896452affe8d940479272e5f74c5d2501235faaaed37df8
MD5 ed33cd5fabfe892fbabcff722858305e
BLAKE2b-256 d3d5cf11848fa0621940e8ad434d174115666f0ecfae1ca6e10a5de8c408b982

See more details on using hashes here.

File details

Details for the file omero_browser_qt-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for omero_browser_qt-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d5e84973e2caea7fd34d71b2536136609088e16d75b9cc3d67e2b2cbc211e84
MD5 b24668f8e951959dd9e200657c2b8e3b
BLAKE2b-256 341e6ecf255a0cf14698f2a305e098c7ae451afe780db2580d4d0e588251beb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page