deconvoluting z stack multichannel tif image (3D volumetric image)

5 views (last 30 days)
Hello, I have been having trouble deconvoluting my image in matlab:
% Load multi-channel color Z stack image
img = imread('ZStack1.tif');
% Define the parameters for the deconvolution algorithm
numIterations = 20; % Number of iterations
PSF = fspecial('gaussian', 7, 1); % Point spread function
background = 'none'; % Background handling method
noiseModel = 'poisson'; % Noise model
% Preallocate deconvolved image
deconvolvedImg = zeros(size(img), class(img));
% Deconvolve each color channel separately
for i = 1:size(img, 3)
% Extract the ith color channel
channel = img(:,:,i);
% Deconvolve the channel
% = deconvlucy(channel, PSF, numIterations, [], background, noiseModel, 'edge', 'same');
deconvolvedChannel = deconvlucy(channel, PSF, numIterations, [], background, noiseModel, 'edge', 'same');
% Store the deconvolved channel in the output image
deconvolvedImg(:,:,i) = deconvolvedChannel;
end
% Display the original and deconvolved images side by side
figure;
montage({img, deconvolvedImg}, 'Size', [1 2]);
title('Original (left) and deconvolved (right) image');
When it works it does not convolute, I think the issue is mainly that it doesn't read into matlab as a multidimensional multichannel (z stacked image) any suggestions to correct this? Thanks!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!