imagej / imagej-ops

ImageJ Ops: "Write once, run anywhere" image processing
https://imagej.net/libs/imagej-ops
BSD 2-Clause "Simplified" License
89 stars 42 forks source link

Richardson-Lucy deconvolution returns empty image for 16-bit input #585

Open igorpisarev opened 5 years ago

igorpisarev commented 5 years ago

I've been experimenting with the deconvolution ops and observed quite strange behavior of RichardsonLucyF/RichardsonLucyTV: when I call it with a 16-bit 3d image and a PSF, the op returns an empty image (all zeroes). It finally worked as expected when I converted the input image to FloatType. I think it'd be helpful to document it somewhere, or, even better, automatically convert the inputs to the expected type and then convert the result back to the original type.

bnorthan commented 5 years ago

Hi @igorpisarev thanks for the feedback. I agree it would be helpful to convert the inputs to the expected type automatically and will put this on my todo-list.

By the way, what is your use case?? The latest work on ops-deconvolution has been put in an experimental repository called ops-experiments. In it there are several examples showing how to build and call native code from ops. There is a much faster CPU version of Richardson Lucy that uses MKL, and a very fast GPU version using Cuda. There is also an example showing how to split and deconvolve large images on the GPU using imglib2-cache. And finally there is an example showing how to use @eczech 's tensor flow implementation of RL, from imagej-ops. If any of this is useful to you, and you have questions, feel free to reach out to me here, or on the image-sc forum.

bnorthan commented 5 years ago

In addition there are several examples showing how to use ops-deconvolution in the Fiji script editor, under 'Templates->Deconvolution'

igorpisarev commented 5 years ago

Thanks @bnorthan! My use case is to run the deconvolution on the cluster for a large collection of images, as a part of a larger workflow. I didn't know about the ops-experiments repo so I'll look into that, and thanks for the pointer!