Reputation: 446
I have a TIFF image that I would like to open and process using dask. This is the code that I am currently using
import dask.array as da
from tifffile import imread
import zarr
img_path = '/path/to/tiff.ndpi'
img = imread(img_path, aszarr=True)
img = zarr.open(img)
img = da.from_zarr(img[0])
img_means = da.mean(img, axis=(0, 1)).compute()
I am trying to access the lowest resolution image from the TIFF. When I run this I get an error stating
TypeError: cannot pickle '_thread.RLock' object
and then another error stating
TypeError: ('Could not serialize object of type HighLevelGraph', ...
How can I open a tiff image using imread from tiffile and directly use it as a dask array?
Upvotes: 0
Views: 100