Z projection disabled big images

I noticed the new iviewer release has the z-stack button disabled for large images after recently dealing with some large files (2048x2048; 100 planes). Will there be catastrophe if I change the UNTILED_RETRIEVAL_LIMIT? And if no, is there a configuration option that can be changed to allow larger images?
Thanks!

Hi,

Since your image is not considered a big image by the OMERO.server (default cut-off is around 3000 x 3000) you should be OK to raise the UNTILED_RETRIEVAL_LIMIT above 2048x2048.
This limit is simply designed to improve the loading performance of ‘large’ images by using tiling.
We could make this configurable to avoid the need to edit the code.

Regards,
Will.

2 Likes

Thanks much Will. I think that may be a useful option.

Hey Will,

I would like to edit the UNTILED_RETRIEVAL_LIMIT in the code. However, I noticed that in the omero-iviewer python package, there is no globals.js in the static folder or any instance of ‘4000000’. All I see is deps.js, init.js, main.js, and openwith.js.
Where in the actual release is untiled_retrieval_limit defined? Is it a one-letter variable in the minified main.js?

Thanks,
Philip

Hi Philip,

I created a card at https://trello.com/c/6YCkbqQr/78-config-for-untiledretrievallimit

In the meantime, if you want to try and workaround this, you’ll need to checkout the code from https://github.com/ome/omero-iviewer using the v0.7.0 tag (to match your installed version), edit the code in globals.js and then follow the instructions there to build with npm run prod (having first installed npm as described).
This will generate a new build of the app in plugin/omero_iviewer/. If you add the plugin directory to your $PYTHONPATH then you can run this version instead of your pip-installed omero-iviewer.

Or you can copy the plugin/omero_iviewer/static/omero_iviewer folder to your installed omero_iviewer to replace the existing omero_iviewer/static/omero_iviewer folder. This is what tried locally just now and it worked for me. I can’t say for sure which of the js files contains the edited variable so it’s easiest to use the whole folder.

If you don’t want to do all this for a one-off change, I’ve attached my static/omero_iviewer folder as a zip, which I hope will work for you. (I set the limit to 9000000).
However, in general I wouldn’t recommend this as a way of patching the iviewer since it’s not tested and not scalable.

Regards,
Will.

omero_iviewer.zip (775.7 KB)

3 Likes

Hi @will-moore

Sorry for reviving this topic but I faced the same issue today on our OMERO installation. A user noticed that he wasn’t able to do projection in either figure or iviewer.

Following this thread, I tested with a fake image of 1999199990 which indeed can be projected, and one with 2001200190 which can’t.

As there been any changes to the possible config in OMERO to allow projection ? We’re currently still on OMERO 5.4.10 (soon upgrading) but with a pretty recent iviewer version. Since this projection is disabled in both figure and iviewer, I guess this settings is actually in the main OMERO rather than in a plugin, is that correct ?

Edit :

Projection is enabled in figure but gives this when clicking the button

image

Hi @lguerard,
Currently there is a hard limit of X * Y of 2000 * 2000 for iviewer. This is proposed to be bumped up to 2048 * 2048 in Tiling threshold max projection bytes by will-moore · Pull Request #349 · ome/omero-iviewer · GitHub.
But the same threshold doesn’t exist in OMERO.figure or in the old viewer (if iviewer isn’t installed, or Open with... Image viewer.

Since OMERO 5.6.1 there is a limit of 1024 * 1024 * 256 bytes for projection on the server. This can be set by (e.g. to double the limit):

$ omero config set omero.pixeldata.max_projection_bytes 1073741824

See Configuration properties glossary — OMERO 5.6.1 documentation

However, this wouldn’t explain why projection is failing for you in OMERO.figure.
If you show the browser developer tools (right-click anywhere and “Inspect Element”) and look under the Network tab with Images enabled, you should be able to see the image loading failing, and can click to open that URL in a new tab, which should show you any error.
It may simply be that the projection is taking longer than a minute in OMERO and that the web server is timing out.

Regards,
Will.

Hi @will-moore,

Thanks a lot for your help !

I’ll check that in the configuration and let you know !

Projection is actually enabled in the old viewer and figure but returns nothing. I checked the browser developer tools and got a server error 500 with this traceback:

Traceback (most recent call last):

  File "/home/omeronas/omeroweb/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/home/omeronas/OMERO.server/lib/python/omeroweb/decorators.py", line 486, in wrapped
    retval = f(request, *args, **kwargs)

  File "/home/omeronas/OMERO.server-5.4.10-ice36-b105/lib/python/omeroweb/webgateway/views.py", line 1006, in render_image
    jpeg_data = img.renderJpeg(z, t, compression=compress_quality)

  File "/home/omeronas/OMERO.server/lib/python/omero/gateway/__init__.py", line 7698, in wrapped
    return f(self, *args, **kwargs)

  File "/home/omeronas/OMERO.server/lib/python/omero/gateway/__init__.py", line 9163, in renderJpeg
    self._conn.SERVICE_OPTS)

  File "/home/omeronas/OMERO.server/lib/python/omero/gateway/__init__.py", line 4671, in __call__
    return self.handle_exception(e, *args, **kwargs)

  File "/home/omeronas/OMERO.server/lib/python/omeroweb/webclient/webclient_gateway.py", line 2109, in handle_exception
    e, *args, **kwargs)

  File "/home/omeronas/OMERO.server/lib/python/omero/gateway/__init__.py", line 4668, in __call__
    return self.f(*args, **kwargs)

  File "/home/omeronas/OMERO.server/lib/python/omero_api_RenderingEngine_ice.py", line 963, in renderProjectedCompressed
    return _M_omero.api.RenderingEngine._op_renderProjectedCompressed.invoke(self, ((algorithm, timepoint, stepping, start, end), _ctx))

ApiUsageException: exception ::omero::ApiUsageException
{
    serverStackTrace = ome.conditions.ApiUsageException: Converting Long 2601123840 to Integer is an overflow.
	at ome.io.nio.RomioPixelBuffer.safeLongToInteger(RomioPixelBuffer.java:123)
	at ome.io.bioformats.BfPixelBuffer.getStack(BfPixelBuffer.java:313)
	at ome.services.projection.ProjectionBean.projectStack(ProjectionBean.java:123)
	at ome.services.RenderingBean$9.doWork(RenderingBean.java:2164)
	at sun.reflect.GeneratedMethodAccessor307.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
	at ome.services.util.Executor$Impl$Interceptor.invoke(Executor.java:573)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at ome.security.basic.EventHandler.invoke(EventHandler.java:154)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:111)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:108)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at ome.tools.hibernate.ProxyCleanupFilter$Interceptor.invoke(ProxyCleanupFilter.java:249)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:121)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
	at com.sun.proxy.$Proxy72.doWork(Unknown Source)
	at ome.services.util.Executor$Impl.execute(Executor.java:452)
	at ome.services.util.Executor$Impl.execute(Executor.java:396)
	at ome.services.RenderingBean.projectStack(RenderingBean.java:2159)
	at ome.services.RenderingBean.renderProjectedAsPackedInt(RenderingBean.java:595)
	at ome.services.RenderingBean.renderProjectedCompressed(RenderingBean.java:642)
	at sun.reflect.GeneratedMethodAccessor1381.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
	at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:121)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

Does that help ?

Best,
Laurent

Thanks for the stacktrace
This is helpful
As @will-moore mentioned, some new configurations parameters have been introduced but this error could still be triggered depending on the settings in place.
Thanks

Jmarie