Skip to content

Standalone python script#669

Draft
will-moore wants to merge 12 commits intoome:masterfrom
will-moore:standalone_python_script
Draft

Standalone python script#669
will-moore wants to merge 12 commits intoome:masterfrom
will-moore:standalone_python_script

Conversation

@will-moore
Copy link
Member

As part of the work to support figure usage and PDF/TIFF generation with OME-Zarr data (without using OMERO),
this PR focusses on the Figure_To_Pdf.py (see #619 for front-end changes).

We want to be able to use the same PDF/TIFF generation code both in OMERO and as a stand-alone script (in a python environment that doesn't have omero-py installed, but has zarr, dask etc instead).

Basic idea is that you go to a stand-alone OMERO.figure app (from #619) e.g. https://will-moore.github.io/omero-figure/?file=https://gist.githubusercontent.com/will-moore/fe0e260544b46af6e1e523b288fc85bc/raw/30547e61d4d8753ef0016f0a70435f1aafb43c2f/OMERO.figure_NGFF_demo.json and File > Save to download the figure.json file.
NB: LUTs not yet supported for Zarrs

Then, you run:

# doesn't need omero-py
# All images in figure are zarr images

$ python omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py /Users/wmoore/Desktop/FIGURE/figure_json/OME-Zarr_demo.json

Another option supported by this PR is to download figure json from /figure app that is running from omero-web and contains OMERO images (use File > Export as JSON then save to a local file). Then, to generate the PDF, you can run the script with a connection to omero, with --omero option:

# needs omero-py - will use omero_cli to connect
# figure has images from OMERO

$ python omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py /Users/wmoore/Desktop/FIGURE/figure_json/my_figure.json --omero

TODO:

  • Support LUTs for zarrs (or ignore)?
  • pip install omero-figure options for installing omero-web app (do we need to specify omero-web as dependency?) OR as a script (dependencies include reportlab, markdown, zarr, dask, requests, aiohttp, pillow`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant