Finding Vessel tortuosity Of Fundus Images

6 views (last 30 days)
new_bie
new_bie on 28 Dec 2014
Commented: new_bie on 30 Dec 2014
I'm trying to find the vessel tortuosity of Fundus Images. I'm seperating the branches first. The problem is the code is not running as smoothly as it should be. Can someone please check the code.
name='Original';
fig=findall(0,'type','figure','name',name);
if isempty(fig)
fig=figure('numbertitle','off','name',name);
else
figure(fig)
end
% reading and displaying the image
I = imread('IM.jpg');
imshow(I);
grayImg=rgb2gray(I);
h(1)=imshow(grayImg);
% % imshow(grayImg);
eyeMask= im2bw(grayImg,graythresh(grayImg));
eyeMask= imfill(eyeMask,'holes');
eyeMask=bwareaopen(eyeMask,100);
% imshow(eyeMask);
%apply mask to eleminate background noise
grayImg(~eyeMask)=0;
set(h(1),'cdata',grayImg);
% Segment the vessels
vesselmask=edge(grayImg,'canny',0.10,1);
% imshow(vesselmask);
vs=imgca;
%%removing outer ring
vesselmask(~imerode(eyeMask,strel('disk',6)))=0;
% imshow(vesselmask);
% dilation
vesselmask=imdilate(vesselmask,strel('disk',5));
imshow(vesselmask);
*% vesselmask = bwmorph(vesselmask,'dilate');
vesselmask=bwmorph(vesselmask,'skel',Inf);
% vesselmask = bwmorph(vesselmask,'bridge');
% vesselmask=bwmorph(vesselmask,'skel',Inf);
vesselmask=bwmorph(vesselmask,'spur',5);
%
% vesselmask=bwmorph(vesselmask,'skel',Inf);
imshow(vesselmask)*
branchPoints=bwmorph(vesselmask,'branch',1);
branchPoints=imdilate(branchPoints,strel('disk',2));
imshow(branchPoints)
bp=imgca;
% %
% vesselmask = bwmorph(vesselmask,'dilate');
vesselmask=vesselmask & ~ branchPoints;
imshow(vesselmask)
  3 Comments
new_bie
new_bie on 29 Dec 2014
Thanks for repairing the question. I'm new here. Tried a little bit to format it here. But did not know how to do it.

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 28 Dec 2014
I didn't run it but just a quick scan looks like it should be okay. It should be splitting the vessel tree up into individual separate branches. What's the problem? I mean other than not being formatted correctly, which can be corrected if you read this.
You can just label the image and get the area with regionprops() to get the length of the branches, and get the PixelList and the endpoints from bwmorph() to find the distance between the endpoints. Then divide to get the tortuosity.
  8 Comments
Image Analyst
Image Analyst on 29 Dec 2014
Sorry - it's not the same. The shape in branches.png does not show up anywhere in these figures. Just attach your original image and all the code necessary to run your program.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!