Finding Vessel tortuosity Of Fundus Images
6 views (last 30 days)
Show older comments
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
Image Analyst
on 29 Dec 2014
I'm glad you're interested in learning how. Here are directions: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
Answers (1)
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
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.
See Also
Categories
Find more on Retinal Imaging in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!