napari-lazy-openslide icon indicating copy to clipboard operation
napari-lazy-openslide copied to clipboard

Different output in Windows vs WSL2

Open choosehappy opened this issue 1 year ago • 4 comments

Was hoping someone could quickly chime in with any thoughts on where to look.

very simple code, basically load a WSI with the OpenSlideStore and pull one of the pyramids out

import zarr
import dask.array as da
import napari

from napari_lazy_openslide import OpenSlideStore

wsi_fname='../10066_001.svs'

store = OpenSlideStore(wsi_fname)
grp = zarr.open(store, mode="r")
datasets = grp.attrs["multiscales"][0]["datasets"]
pyramid = [grp.get(d["path"]) for d in datasets]
print(pyramid)

pyramid = [da.from_zarr(store, component=d["path"]) for d in datasets]
print(pyramid)

aa=pyramid[2][:,:,::]

bb=aa.compute()
print(bb)

when i run it on Windows, it works as expected:

[<zarr.core.Array '/0' (30987, 48649, 4) uint8 read-only>, <zarr.core.Array '/1' (7746, 12162, 4) uint8 read-only>, <zarr.core.Array '/2' (1936, 3040, 4) uint8 read-only>]
[dask.array<from-zarr, shape=(30987, 48649, 4), dtype=uint8, chunksize=(512, 512, 4), chunktype=numpy.ndarray>, dask.array<from-zarr, shape=(7746, 12162, 4), dtype=uint8, chunksize=(512, 512, 4), chunktype=numpy.ndarray>, dask.array<from-zarr, shape=(1936, 3040, 4), dtype=uint8, chunksize=(512, 512, 4), chunktype=numpy.ndarray>]
[[[243 243 243 255]
  [243 243 243 255]
  [243 243 243 255]
  ...
  [242 243 243 255]
  [242 243 243 255]
  [242 243 243 255]]

 [[243 243 243 255]
  [243 243 243 255]
  [243 243 243 255]
  ...
  [243 243 243 255]
  [243 243 243 255]
  [243 243 243 255]]

 [[243 243 243 255]
  [243 243 243 255]
  [243 243 243 255]
  ...
  [243 243 243 255]
  [243 243 243 255]
  [243 243 243 255]]

 ...

 [[243 243 243 255]
  [243 243 244 255]
  [244 243 244 255]
  ...
  [243 243 243 255]
  [243 243 243 255]
  [243 243 243 255]]

 [[244 243 244 255]
  [244 243 244 255]
  [244 243 244 255]
  ...
  [243 243 243 255]
  [243 243 243 255]
  [243 243 244 255]]

 [[244 243 244 255]
  [244 243 244 255]
  [244 243 244 255]
  ...
  [243 243 243 255]
  [243 243 243 255]
  [242 242 243 255]]]

but when i run it on WSL2, the actual data returned is incorrect:

[<zarr.core.Array '/0' (30987, 48649, 4) uint8 read-only>, <zarr.core.Array '/1' (7746, 12162, 4) uint8 read-only>, <zarr.core.Array '/2' (1936, 3040, 4) uint8 read-only>]
[dask.array<from-zarr, shape=(30987, 48649, 4), dtype=uint8, chunksize=(512, 512, 4), chunktype=numpy.ndarray>, dask.array<from-zarr, shape=(7746, 12162, 4), dtype=uint8, chunksize=(512, 512, 4), chunktype=numpy.ndarray>, dask.array<from-zarr, shape=(1936, 3040, 4), dtype=uint8, chunksize=(512, 512, 4), chunktype=numpy.ndarray>]
[[[0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]
  ...
  [0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]]

 [[0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]
  ...
  [0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]]

 [[0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]
  ...
  [0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]]

 ...

 [[0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]
  ...
  [0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]]

 [[0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]
  ...
  [0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]]

 [[0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]
  ...
  [0 0 0 0]
  [0 0 0 0]
  [0 0 0 0]]]

Any idea where i should start looking? Thanks!

choosehappy avatar Oct 31 '24 17:10 choosehappy