Skip to content

Commit 41013d3

Browse files
authored
Merge pull request #653 from sbesson/imgData_resolution_descriptions
Update imgData endpoint to return more metadata about the resolutions
2 parents c0d7960 + 37813ff commit 41013d3

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

omeroweb/webgateway/marshal.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,17 @@ def imageMarshal(image, key=None, request=None):
185185
rv["tiles"] = tiles
186186
if tiles:
187187
width, height = image._re.getTileSize()
188-
zoomLevelScaling = image.getZoomLevelScaling()
189-
190188
rv.update({"tile_size": {"width": width, "height": height}, "levels": levels})
191-
if zoomLevelScaling is not None:
192-
rv["zoomLevelScaling"] = zoomLevelScaling
189+
190+
resolution_descriptions = image._re.getResolutionDescriptions()
191+
rv["resolutions"] = {
192+
index: {"sizeX": r.sizeX, "sizeY": r.sizeY}
193+
for index, r in enumerate(resolution_descriptions)
194+
}
195+
rv["zoomLevelScaling"] = {
196+
index: r.sizeX / resolution_descriptions[0].sizeX
197+
for index, r in enumerate(resolution_descriptions)
198+
}
193199

194200
nominalMagnification = (
195201
image.getObjectiveSettings() is not None

0 commit comments

Comments
 (0)