ome / omero-py

Python project containing Ice remoting code for OMERO
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
20 stars 33 forks source link

question about "progress indicator" for getPlane() #227

Open tlambert03 opened 4 years ago

tlambert03 commented 4 years ago

I'm curious whether it's possible to retrieve plane bytes from an OMERO server in a "streaming" request such that one could provide a progress indicator (e.g. for napari-omero). I tried to trace the PixelsWrapper.getPlane() through the RawPixelsStore to find the actual code that makes the server request... but I was unable to (does it maybe go into Ice or Java for that?). Anyway, should that type of streaming request be theoretically possible? Or will getPlane() always block until all of the bytes are returned?

joshmoore commented 4 years ago

Hi @tlambert03. Sorry, Ice doesn't provide a streaming API natively. Each method can called either be synchronously or asynchronously. The only way to achieve what you are looking for is to request smaller sections. e.g. https://github.com/ome/omero-py/blob/master/src/omero/util/tiles.py#L68

cc: @will-moore

p.s. It is possible to build a streaming API for planes with Ice, but at this point, I'd imagine moving to an HTTP API e.g. https://github.com/ome/omero-ms-zarr would make more sense.