Skip to content

Commit

Permalink
fix bug in percentile
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzocerrone committed Nov 4, 2024
1 parent 3e446b3 commit aa4dd23
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ngio/core/ngff_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,16 @@ def _update_omero_window(
max_dtype = np.iinfo(image.on_disk_array.dtype).max

start = da.percentile(
lowest_res_image.on_disk_dask_array, min_percentile, method="nearest"
lowest_res_image.on_disk_dask_array.ravel(),
min_percentile,
method="nearest",
).compute()
end = da.percentile(
lowest_res_image.on_disk_dask_array, max_percentile, method="nearest"
lowest_res_image.on_disk_dask_array.ravel(),
max_percentile,
method="nearest",
).compute()
print(f"Setting window to {start} - {end}")

if meta.omero is None:
raise ValueError("OMERO metadata is not present in the image.")
Expand Down

0 comments on commit aa4dd23

Please sign in to comment.