[ome-devel] Linking Omero and Catmaid

William Moore (Staff) W.Moore at dundee.ac.uk
Thu May 11 21:42:55 BST 2017


Hi Son,

 I got this working for me, and opened a PR with my code: https://github.com/msphan/omero-catmaid/pull/1

NB: This uses whatever zoom levels are provided for the image (depends on file format) so it may
not always be a zoom factor of 2 between adjacent zoom levels.

Let meek know if this works or if you have any problems.

 Regards,

  Will.


On 11 May 2017, at 13:15, William Moore (Staff) <wmoore at dundee.ac.uk<mailto:wmoore at dundee.ac.uk>> wrote:

Hi,

 It’s great to see a new OMERO.web app and nice that Catmaid can talk to OMERO!

 - Authentication: If you log in to OMERO.web (e.g. /webclient/) in the same browser you’re running Catmaid, then all subsequent
requests should be able to use the sessionId in the cookie to re-connect to OMERO with the login_required decorator you’ve used.

 - Parallel loading of image tiles: Yes, every request is asynchronously handled by individual web server workers. If you’re using the
development server then there’s only a single process, but when deployed using nginx there’ll typically be 5 workers handling requests in parallel.

 - Image tile zoom: You’ll need to use the ‘level’ parameter of img.renderJpegRegion(z, t, scalex, scaley, scalew, scaleh, level=level, compression=c)
However, this works in the opposite direction from ‘zoom’ in your API: level=0 is the most zoomed-out level.

If you do  img.getZoomLevelScaling()
you’ll get a dictionary of supported zoom levels for the image, and the relative zoom fractions.
e.g. {0: 1.0, 1: 0.24999023831526337, 2: 0.06248779789407921, 3: 0.031237391157215185, 4: 0.010451510458018247}
NB: with all the different formats that OMERO / Bio-Formats supports, many do not zoom 2x with each zoom level, as you can see from this svs image example.

In this image, zooming from level 0 (most zoomed out) to level 4 will give a zoom of ~95 x (1/0.01045).
In your case, zm=0 would be level 4 (with x and y unchanged).
Zooming to zm=1 would be level 3 but then you have to scale the x and y accordingly since these no-longer map to the original image size.
I’m afraid I don’t have time to work out the exact logic for this but hopefully you can figure this out.
Let us know if you need more help.
This should mean that you don’t need to resize the image with PIL.

Other points:

Your install instructions: $ OMERO.py/bin/omero config append omero.web.apps '"omero-catmaid"'
This should be “omero_catmaid” (underscore instead of -).

You’re also missing a Http404 import
from django.http import Http404

 Regards,

  Will.


On 10 May 2017, at 12:53, Phan Minh-Son (M.) <minh-son.phan at polytechnique.edu<mailto:minh-son.phan at polytechnique.edu>> wrote:


Dear all,

We've just built a simple Omero web app: https://github.com/msphan/omero-catmaid. It is designed to serve the url convention in Catmaid which is a software for visualization and annotation of large scale image (http://catmaid.readthedocs.io<http://catmaid.readthedocs.io/>).

In brief, the func render_tile() in our app is rewritten from the func render_image_region() in webgateway by modifying the url format, handling the tile zoom level. The code is still very simple, there are several aspects that could be optimized. We would highly appreciate any comments, advices you may provide.

- Authentication: we now use a session key added into url to handle the Omero login request. However, this requires modification of url setup in Catmaid each time when we login into Omero. Are there other alternative ways for the login process?

- Parallel loading of image tile: since Catmaid support this feature, so is it also possible in Omero to respond the parallel requests?

- Image tile zoom: in render_tile() func, we simply calculate scaled size of image tile at a specified zoom level, then render the jpeg using renderJpegRegion() and finally resize it. The code is quite redundant and the render speed depends on the zoom level. So for a very large image, the render tile speed is slow for high values of zoom level. Would you have any comments/advices to speed up the render tile?

Many thanks and best regards,


Son


_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel



The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20170511/52648859/attachment.html>


More information about the ome-devel mailing list