# Despeckling Ultrasound images using Diffusion Filtering

I am working on Despeckling Ultrasound images. I have been trying out some basic filters and their hybrid combination.. Now I would like to try Diffusion Filtering techniques to despeckle the ultrasound images. I don't know anything about the diffusion filtering techniques (Isotropic diffusion or Perona Malik Anisotropic Diffusion Filter). I would like to learn from the basic. Please suggest some books to learn about Diffusion techniques.. Please keep in mind that I am not an advanced learner.

I did google and found this book (Despeckle Filtering Algorithms and Software for Ultrasound Imaging By Christos P. Loizou, Constantinos S. Pattichis, Costas Pattichis) very useful. But I couldn't able to buy it. If anyone have the PDF of this book (even 1 or 2 chapters), please provide me the link. Also provide some useful links to learn these techniques

No matter where would you learn the theoretical background of the diffusion techniques, I would like to apply the Matlab implementation on the 2nd formal definition of anisotropic diffusion, it is not difficult. I used the ultrasound B-scan image you used before.

I=imread('ultrasound.png');
I=rgb2gray(I);
subplot(1,2,1)
imshow(I);
[rows, cols]=size(I);
diff = double(I); % original image
lambda = 0.25;
niter = 10;
Co = 20;
for i = 1:10  % iterations

% Construct diffl which is the same as diff but
% has an extra padding of zeros around it.
diffl = zeros(rows+2, cols+2);
diffl(2:rows+1, 2:cols+1) = diff;

% North, South, East and West differences
deltaN = diffl(1:rows,2:cols+1)   - diff;
deltaS = diffl(3:rows+2,2:cols+1) - diff;
deltaE = diffl(2:rows+1,3:cols+2) - diff;
deltaW = diffl(2:rows+1,1:cols)   - diff;

cN = 1./(1 + (deltaN/Co).^2);
cS = 1./(1 + (deltaS/Co).^2);
cE = 1./(1 + (deltaE/Co).^2);
cW = 1./(1 + (deltaW/Co).^2);

diff = diff + lambda*(cN.*deltaN + cS.*deltaS + cE.*deltaE + cW.*deltaW);

end
subplot(1,2,2),imshow(uint8(diff))


You can see the edge preserving effect of diffusion filter (right) compared with the speckled noisy image (left).

• Thank you very much for your help.. Any other despeckling algorithms which preserves edges? – Premnath D Feb 4 '14 at 18:02
• Thanks Premnath. As far as I know, bilateral filter is the most often referred edge preserving method. Here is the code for your reference: mathworks.com/matlabcentral/fileexchange/… It's a little bit more complicated than diffusion though. Thanks – lennon310 Feb 4 '14 at 18:10
• Hi Lennon, I am curious why you implemented the diff like this, cant you do it through convolution with a kernel? Or is this way you have necessary? Thanks. – TheGrapeBeyond Feb 4 '14 at 19:58
• @TheGrapeBeyond Thank you Grape. Yes you can implement such an 1D derivative by convolution with [-1 1] kernel (along x direction). It seems like the subtraction is a little bit faster than convolution, although they are both O(n). This post shows some comparison on the calculation of gradient, which is similar: stackoverflow.com/questions/18958231/… Thanks – lennon310 Feb 4 '14 at 20:21
• Any books, PDFs or links to learn theory of diffusion filtering ? please suggest some.. – Premnath D Feb 5 '14 at 1:09