-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dask and dask-image to improve ImageContainer #296
Comments
I was able to open the large tiff file with I tried this in a new conda environment
and then in ipython: In [1]: from dask_image.imread import imread
In [2]: img = imread('V1_Adult_Mouse_Brain_Coronal_Section_2_image.tif')
In [3]: img
Out[3]: dask.array<concatenate, shape=(3, 24240, 24240), dtype=uint16, chunksize=(1, 24240, 24240), chunktype=numpy.ndarray>
In [4]: img.shape
Out[4]: (3, 24240, 24240) I can see all three fluorescence channels (I also checked this by loading it into the napari viewer, and it looks fine to me). By default, you get one chunk in the dask array for each fluorescence channel, but those are pretty big. It's probably more sensible to control the dask array chunksize yourself. You can do that with something like: img = imread('V1_Adult_Mouse_Brain_Coronal_Section_2_image.tif', chunks=(1, 1000, 1000)) |
BTW, I recommend using |
thanks again @GenevieveBuckley ! We'll check it out soon and let you know! |
Hi @GenevieveBuckley , from dask_image.imread import imread
temp = imread("/Users/giovanni.palla/.cache/squidpy/visium_hne_image.tiff", chunks=(1, 1000, 1000))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-7-625049f6a946> in <module>
----> 1 temp = imread("/Users/giovanni.palla/.cache/squidpy/visium_hne_image.tiff", chunks=(1, 1000, 1000))
TypeError: imread() got an unexpected keyword argument 'chunks' after having a look at the source, it seems that /Users/giovanni.palla/miniconda3/envs/spatial/lib/python3.8/site-packages/dask_image/imread/__init__.py:62: RuntimeWarning: `nframes` larger than number of frames in file. Will truncate to number of frames in file.
warnings.warn( finally, I might be missing something but why For reference, this is the output of our custom read using rasterio which we then reshape to thank you in advance for the help! |
Sorry for the mix up! Let me set aside some time to write a response in the next couple of days for you |
I'd postpone |
@michalk8 I think we need to prioritize this and move towards full integration with Also, from @GenevieveBuckley comment here: dask/dask-image#181 (comment) it seems that
"large images" is exactly our case (we don't really have exaples with many z-stacked images) and should do the job. The chunking seems to still be an issue (as I can't really pass it in the The pure dask approach from here: dask/dask-image#181 (comment) also seems to work and could be an option. Do you mind having a look? |
Ok, I will start by refactoring the loading to use |
closed via #324 |
@GenevieveBuckley thanks a lot for the discussion today! Pinging @hspitzer, key points that I got (please add more if missing):
The text was updated successfully, but these errors were encountered: