Skip to content

Commit

Permalink
Merge pull request #15 from khanlab/patch
Browse files Browse the repository at this point in the history
Fix introduced bug in from_ome_zarr()
akhanf authored Jan 30, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents ce855ca + 595d091 commit b6fcf17
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions zarrnii/core.py
Original file line number Diff line number Diff line change
@@ -292,6 +292,18 @@ def from_ome_zarr(
if not as_ref and zooms is not None:
raise ValueError("`zooms` can only be used when `as_ref=True`.")

# Determine the level and whether downsampling is required
if not as_ref:
(
level,
do_downsample,
downsampling_kwargs,
) = cls.get_level_and_downsampling_kwargs(
path, level, z_level_offset, storage_options=storage_options
)
else:
do_downsample = False

# Open the Zarr metadata
store = zarr.open(path, mode="r")
multiscales = store.attrs.get("multiscales", [{}])
@@ -305,18 +317,6 @@ def from_ome_zarr(
# Read orientation metadata (default to `orientation` if not present)
orientation = store.attrs.get("orientation", orientation)

# Determine the level and whether downsampling is required
if not as_ref:
(
level,
do_downsample,
downsampling_kwargs,
) = cls.get_level_and_downsampling_kwargs(
path, level, z_level_offset, storage_options=storage_options
)
else:
do_downsample = False

# Load data or metadata as needed
darr_base = da.from_zarr(
path, component=f"/{level}", storage_options=storage_options

0 comments on commit b6fcf17

Please sign in to comment.