-
Notifications
You must be signed in to change notification settings - Fork 0
/
vesselSegmentsProcessing.m
50 lines (43 loc) · 1.26 KB
/
vesselSegmentsProcessing.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function vesselSegmentsProcessing()
im_Files = dir('./data/DRIVE/training/*.bmp');
Range=(1:size(im_Files,1));
parpool;
for ra=Range
image_name = im_Files(ra).name;
strL = sprintf('%d. %s',ra,image_name);
disp(strL);
img = imread(image_name);
img = calcRegionProp(img);
img = doProcess(img);
% cc = bwconncomp(img);
% L = labelmatrix(cc);
% S = regionprops('Table',L,'PixelList');
%
% vessLabGT = [];
% for i=1:height(S)
% objV = S.PixelList{i};
% for j=1:length(GT)
% objP = stats.PixelList{GT(j,1)};
% if(isRelated2(objV,objP))
% vessLabGT=[vessLabGT;i,j,GT(j,2)];
% end
% end
% end
%
% vesselSegments = zeros(size(img));
% for i=1:length(vessLabGT)
% obj = S.PixelList{vessLabGT(i,1)};
% [rows,cols] = size(obj);
%
% for row=1:rows
% vesselSegments(obj(row,2),obj(row,1)) = true;
% end
% end
[pathstr,name,ext] = fileparts(image_name);
strStore = sprintf('./data/DRIVE/test/vesselSegments/%s.bmp',name);
imwrite(img,strStore);
% save(gfile,'-append','vesselSegments','S','v');
end
poolobj = gcp('nocreate');
delete(poolobj);
end