hammerlab / flowdec

TensorFlow Deconvolution for Microscopy Data
Apache License 2.0
89 stars 26 forks source link

skimage error when opening 3D tiffs #42

Closed alcrevenna closed 2 years ago

alcrevenna commented 2 years ago

Hello, first of all thanks for the ice tool. I am trying to work with flowdec but got a relatively simple error: from skimage.io import imread image = imread('test_small.tif') TiffPage 0: TypeError: read_bytes() missing 3 required positional arguments: 'dtype', 'count', and 'offsetsize' I do realize that the error is not from flowdec but from the underlying tifffile library, the problem is that to solve the error I need to update tifffile as posted here but flowdec does not support the latest skimage. I guess is a version issue, any ideas? I'm using this: python ir 3.6.13 skimage 0.17.2 tifffile 2020.9.3 I have to say that it took a while to get flowdec working since there were many issues with TF anf the drivers and versions etc etc. any ideas are welcome, Alvaro

alcrevenna commented 2 years ago

Hi, I'm adding to this issue. Is there a chance flowdec can be used with a newer Python version? I tried to use the aicsimageio library to read/load data but had an error (which I tried to solve but got more errors). I tested creating an environment with python 3.8 and had a smooth install of aicsimageio.

eric-czech commented 2 years ago

Unfortunately, probably not. The library needs a refresh to work with newer versions of certain dependencies so I would suggest looking at https://docs.rapids.ai/api/cucim/stable/api.html#cucim.skimage.restoration.richardson_lucy (or something else) as an alternative. I've never used it myself, but it would certainly be useful if RAPIDS maintained a solution for this problem.

Perhaps @VolkerH or @chrisroat have some suggestions on what the best python deconvolution implementations are these days?

VolkerH commented 2 years ago

There are some alternatives for GPU accelerated deconvolution in python these days.

If you prefer plain numpy or cupy, have a look at David Hoffman's code. I used some of his code and created an example that I also ran in cupy: https://github.com/david-hoffman/pydecon/pull/6

When I was using flowdec in one of my projects it was to replace something that was not open source at the time, but is now: https://github.com/tlambert03/pycudadecon

Then, @haesleinhuepf has implemented some OpenCL accelerated image processing functions with bindings for Java, Matlab and Python, including RL deconvolution I believe. If you ask on the http://image.sc forum and tag him, he will surely answer (he might see the tag here as well). @bnorthan is also active in this space.

VolkerH commented 2 years ago

@alcrevenna I see your location is Monterotondo, I think we may be working for the same organisation at different sites :)

alcrevenna commented 2 years ago

Thanks @eric-czech and @VolkerH for the answers and hints. I'll try with the suggestions.