Skip to content

damping feature #33

@k1moradi

Description

@k1moradi

Hi,

I am testing using this amazing software for the deconvolution of light-sheet microscope images. Recently, a paper is published in this regard. I managed to port the PSF generation part from Matlab to python. However, porting the deconvolution method to python will be very GPU inefficient if it is done on the python side and using CPU. (Since the image stack should be moved to GPU memory and back to CPU memory several times).

The deconvolution function has a damping component to allow the deconvolution of low-resolution images.

function deconvolved = deconGPU(stack, psf, niter, damping)     
    deconvolved = stack;        
    psf_inv = psf(end:-1:1, end:-1:1, end:-1:1); % spatially reversed psf 
    
    R = 1/26 * ones(3, 3, 3, 'single'); 
    R(2,2,2) = single(0);
  
    for i = 1 : niter 
        denom = convGPU(deconvolved, psf);
        denom(denom < eps('single')) = eps('single'); % protect against division by zero
        
        if damping == 0                       
            deconvolved_new = convGPU(stack ./ denom, psf_inv) .* deconvolved;
        else           
            deconvolved_new = (1 - damping) .* convGPU(stack ./ denom, psf_inv) .* deconvolved ...
                + damping .* convn(deconvolved, R, 'same');
        end
end

The damping parameter is a ratio between 0 and 1. I was wondering will you be able to implement this with Cuda directly in pycudaDecon?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions