CISMM / Clarity

An open-source deconvolution library with CUDA acceleration
http://cismm.cs.unc.edu/downloads/?dl_cat=11
16 stars 3 forks source link

JVC giving NaN result in Matlab interface #3

Open rcasero opened 12 years ago

rcasero commented 12 years ago

Hi Cory,

I hadn't noticed this, but it seems that even though the CUDA implementation now compiles and runs in Ubuntu with the Gerardus matlab interface, I'm getting as a result a volume of NaNs. For example running

im = deconvolve('jvc', single(nrrd.data), single(psf), 8);

uses Clarity_JansenVanCittertDeconvolve, and im is just an array of NaNs. It works fine with

im = deconvolve('ml', single(nrrd.data), single(psf), 8);

that uses Clarity_MaximumLikelihoodDeconvolve. If I'm not wrong, Clarity_MaximumLikelihoodDeconvolve doesn't have a CUDA implementation.

I was just wondering whether you have observed something similar running Clarity by itself. Maybe this is just a problem when mixing it up with Matlab.

Best regards,

Ramon.

cquammen commented 12 years ago

Ramon,

Have you tried this outside the MATLAB interface with the same PSF and image? I know that is more cumbersome, but I'm just curious. How about trying it without CUDA?

If you want to send me the images, I can take a look and see what is going on. I'm not sure where the NaNs would be coming from, because the JVC algorithm doesn't do any division, so no division-by-zero is occuring.

Thanks, Cory

On Sun, Jan 15, 2012 at 2:35 PM, rcasero reply@reply.github.com wrote:

Hi Cory,

I hadn't noticed this, but it seems that even though the CUDA implementation now compiles and runs in Ubuntu with the Gerardus matlab interface, I'm getting as a result a volume of NaNs. For example running

im = deconvolve('jvc', single(nrrd.data), single(psf), 8);

uses Clarity_JansenVanCittertDeconvolve, and im is just an array of NaNs. It works fine with

im = deconvolve('ml', single(nrrd.data), single(psf), 8);

that uses Clarity_MaximumLikelihoodDeconvolve. If I'm not wrong, Clarity_MaximumLikelihoodDeconvolve doesn't have a CUDA implementation.

I was just wondering whether you have observed something similar running Clarity by itself. Maybe this is just a problem when mixing it up with Matlab.

Best regards,

Ramon.


Reply to this email directly or view it on GitHub: https://github.com/cquammen/Clarity/issues/3

Cory Quammen Research Associate Department of Computer Science The University of North Carolina at Chapel Hill

rcasero commented 12 years ago

On 19/01/12 22:10, cquammen wrote:

Ramon,

Have you tried this outside the MATLAB interface with the same PSF and image? I know that is more cumbersome, but I'm just curious. How about trying it without CUDA?

If you want to send me the images, I can take a look and see what is going on. I'm not sure where the NaNs would be coming from, because the JVC algorithm doesn't do any division, so no division-by-zero is occuring.

Hi Cory,

I haven't tried it outside Matlab. I have been running some tests, and it may have nothing to do with CUDA.

I have compiled Clarity without CUDA, and passed the images, 8 iterations of the JVC deconvolution algorithm. Still get NaNs.

I have then tried running only 1 iteration, and what I see is that some of the intensity values in the output image are quite large, even though the PSF and the image have maximum value 255.

I have tried normalizing the PSF and image, and the intensity values get smaller, although some are still ~100.

If I run 2 iterations instead of 1, then some values get much larger.

So what was happening with 8 iterations is that some of the intensity values became Inf, and this eventually led to NaN values.

I'll send you two test images.

Cheers,

Ramon.

Dr. Ramón Casero Cañas

Computational Biology Department of Computer Science University of Oxford Wolfson Building, Parks Rd Oxford OX1 3QD

tlf +44 (0) 1865 610737 web http://www.cs.ox.ac.uk/people/Ramon.CaseroCanas photos http://www.flickr.com/photos/rcasero/