Skip to content

Commit

Permalink
Merge pull request #349 from will-moore/tiling_threshold_max_projecti…
Browse files Browse the repository at this point in the history
…on_bytes

Tiling threshold max projection bytes
  • Loading branch information
jburel authored Feb 16, 2021
2 parents 2c9294f + bbad1d2 commit d8f77da
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
18 changes: 12 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,22 @@ https://omero-guides.readthedocs.io/en/latest/iviewer/docs/index.html
Settings
========

OMERO.iviewer limits the size of Z-projections to reduce load on the server.
OMERO limits the size of Z-projections to reduce load on the server.
The limit is defined as the number of bytes of raw pixel data in a Z-stack and
is equivalent to 1024 * 1024 * 256 bytes.
For example, an 8-bit image (1 byte per pixel) of size 1024 * 1024 * 256 is
equal to the default threshold. To double the limit, use::
the OMERO.server default is equivalent to 1024 * 1024 * 256 bytes.
For example, a single-channel 8-bit image (1 byte per pixel) of XYZ size
1024 * 1024 * 256 is equal to the default threshold.

$ omero config set omero.web.iviewer.max_projection_bytes 536870912
To double the limit, use::

$ omero config set omero.pixeldata.max_projection_bytes 536870912

If you wish to set a threshold for iviewer that is *lower* than for the server:

$ omero config set omero.web.iviewer.max_projection_bytes 268435456

NB: Z-projection is not supported for tiled images in OMERO
(Images larger than 2000 * 2000 pixels per plane are tiled in iviewer).
(Images larger than 2048 * 2048 pixels per plane are tiled in iviewer).

Known issues
============
Expand Down
7 changes: 5 additions & 2 deletions plugin/omero_iviewer/iviewer_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@

"omero.web.iviewer.max_projection_bytes":
["MAX_PROJECTION_BYTES",
1024 * 1024 * 256,
-1,
int,
("Maximum bytes of raw pixel data allowed for Z-projection. "
"Above this threshold, Z-projection is disabled")],
"Above this threshold, Z-projection is disabled. "
"If unset, the server setting of "
"omero.pixeldata.max_projection_bytes will be used or "
"the lower value if both are set.")],

"omero.web.iviewer.roi_page_size":
["ROI_PAGE_SIZE",
Expand Down
12 changes: 11 additions & 1 deletion plugin/omero_iviewer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,17 @@ def index(request, iid=None, conn=None, **kwargs):
if settings.FORCE_SCRIPT_NAME is not None:
params['URI_PREFIX'] = settings.FORCE_SCRIPT_NAME
params['ROI_PAGE_SIZE'] = ROI_PAGE_SIZE
params['MAX_PROJECTION_BYTES'] = MAX_PROJECTION_BYTES

c = conn.getConfigService()
max_bytes = c.getConfigValue('omero.pixeldata.max_projection_bytes')
# check if MAX_PROJECTION_BYTES should override server setting
if max_bytes is None or len(max_bytes) == 0 or (
MAX_PROJECTION_BYTES > 0 and
MAX_PROJECTION_BYTES < int(max_bytes)):
max_bytes = MAX_PROJECTION_BYTES
else:
max_bytes = int(max_bytes)
params['MAX_PROJECTION_BYTES'] = max_bytes

return render(
request, 'omero_iviewer/index.html',
Expand Down
2 changes: 1 addition & 1 deletion src/viewers/viewer/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const PREFIXED_URIS = [
* @const
* @type {number}
*/
export const UNTILED_RETRIEVAL_LIMIT = 4000000;
export const UNTILED_RETRIEVAL_LIMIT = 2048 * 2048;

/**
* the default tile dimensions
Expand Down

0 comments on commit d8f77da

Please sign in to comment.