Skip to content

Commit

Permalink
Always load RE for resolution levels
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Feb 25, 2024
1 parent 7f93a0c commit 6e067f9
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions omeroweb/webgateway/marshal.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,28 +351,21 @@ def pixel_size_in_microns(method):
rv = None
raise

# If image is big - need to load RE to get resolution levels
# NB: some small images like OME-Zarr can have pyramids
# but these will be ignored

# TEMP - for A/B testing only use size test if ID is odd number!
if image.id % 2 == 0 and not image.requiresPixelsPyramid():
rv["tiles"] = False
else:
if load_re(image, rv):
levels = image._re.getResolutionLevels()
tiles = levels > 1
rv["tiles"] = tiles
if tiles:
width, height = image._re.getTileSize()
zoomLevelScaling = image.getZoomLevelScaling()
rv.update(
{"tile_size": {"width": width, "height": height}, "levels": levels}
)
if zoomLevelScaling is not None:
rv["zoomLevelScaling"] = zoomLevelScaling
if init_zoom < 0:
init_zoom = levels + init_zoom
# need to load RE to get resolution levels
if load_re(image, rv):
levels = image._re.getResolutionLevels()
tiles = levels > 1
rv["tiles"] = tiles
if tiles:
width, height = image._re.getTileSize()
zoomLevelScaling = image.getZoomLevelScaling()
rv.update(
{"tile_size": {"width": width, "height": height}, "levels": levels}
)
if zoomLevelScaling is not None:
rv["zoomLevelScaling"] = zoomLevelScaling
if init_zoom < 0:
init_zoom = levels + init_zoom
rv["init_zoom"] = init_zoom

if key is not None and rv is not None:
Expand Down

0 comments on commit 6e067f9

Please sign in to comment.