Skip to content

Commit

Permalink
Set layer scale from getPixelSizeX Y X (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
psobolewskiPhD authored Jan 14, 2025
1 parent 1d53966 commit 42f6e3d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/napari_omero/plugins/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,12 @@ def get_omero_metadata(image: ImageWrapper) -> dict:
visibles = [ch.isActive() for ch in channels]
names = [ch.getLabel() for ch in channels]

scale = None
# Setting z-scale causes issues with Z-slider.
# See https://github.com/tlambert03/napari-omero/pull/15
# if image.getSizeZ() > 1:
# size_x = image.getPixelSizeX()
# size_z = image.getPixelSizeZ()
# if size_x is not None and size_z is not None:
# scale = [1, size_z / size_x, 1, 1]
size_x = image.getPixelSizeX() or 1
size_y = image.getPixelSizeY() or 1
size_z = image.getPixelSizeZ() or 1
# data is TCZYX, but C is passed to channel_axis and split
# so we only need scale to have 4 elements
scale = [1, size_z, size_y, size_x]

return {
"channel_axis": 1,
Expand Down

0 comments on commit 42f6e3d

Please sign in to comment.