Skip to content

Commit

Permalink
Update 'scale' to be dict {'x': 0.5, 'y': 0.5}
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Jan 26, 2022
1 parent de7703a commit 103778d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/omero_zarr/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,15 @@ def marshal_transformations(
transformations = []
zooms = {"x": 1.0, "y": 1.0, "z": 1.0}
for level in range(levels):
# {"type": "scale", "scale": [2.0, 2.0, 2.0], "axisIndices": [2, 3, 4]}
scales = []
axisIndices = []
# {"type": "scale", "scale": {"x": 0.5, "y": 0.5, "z": 0.3}
scales = {}
for index, axis in enumerate(axes):
if axis["name"] in pixel_sizes:
scales.append(zooms[axis["name"]] * pixel_sizes[axis["name"]]["value"])
axisIndices.append(index)
svalue = zooms[axis["name"]] * pixel_sizes[axis["name"]]["value"]
scales[axis["name"]] = svalue
# ...with a single 'scale' transformation each
if len(scales) > 0:
transformations.append(
[{"type": "scale", "scale": scales, "axisIndices": axisIndices}]
)
transformations.append([{"type": "scale", "scale": scales}])
# NB we rescale X and Y for each level, but not Z
zooms["x"] = zooms["x"] * multiscales_zoom
zooms["y"] = zooms["y"] * multiscales_zoom
Expand Down

0 comments on commit 103778d

Please sign in to comment.