ome/omero-py

RFE: Add resolution support to `getTile`

Opened this issue · 1 comments

It should be easier to load a lower-resolution tile from the getTile method rather than:

    # Get info on number of levels and sizes
    print([(r.sizeX, r.sizeY) for r in pix.getResolutionDescriptions()])

    pix.setResolutionLevel(2)
    print(pix.getTileSize())
    w, h = pix.getTileSize()
    tile = pix.getTile(z, c, t, x, y, w, h)

Questions:

  • Ignore or raise on bad resolution setting?
  • Pass resolution level or desired tile size?
  • Use local downsampling when no appropriate resolution is available?

see: https://forum.image.sc/t/omero-py-how-to-get-tiles-at-different-zoom-level-pyramidal-image/45643/2?u=joshmoore

cc: @will-moore

@will-moore also points out that at resolution 1 there were exceptions of the form:

 File "/opt/anaconda3/envs/omeroweb22/lib/python3.7/site-packages/omero_api_RawPixelsStore_ice.py", line 998, in getTile
    return _M_omero.api.RawPixelsStore._op_getTile.invoke(self, ((z, c, t, x, y, w, h), _ctx))
omero.InternalException: exception ::omero::InternalException
{
    serverStackTrace = ome.conditions.InternalException:  Wrapped Exception: (java.lang.RuntimeException):
loci.formats.FormatException: Invalid tile size: x=0, y=0, w=256, h=256