-
Notifications
You must be signed in to change notification settings - Fork 8
/
io.m
258 lines (238 loc) · 6.12 KB
/
io.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
clear all;
close all;
fileFolder= fullfile('E:/', 'Pattern Recognition','images');
files= dir(fullfile(fileFolder,'*.tif'));
fileNames= {files.name};
for i = 1: length(fileNames)
fname{i} = fullfile(fileFolder,fileNames{i});
I{i} = imread(fname{i});
end
for i = 1:2
[N_Objects,N_Ho,Avgeob,E,Arnf1,eccnmed,eccnm,eccnvar, eccnkurtosis] = Segmentation(I{i}, i);
N_O(i) = N_Objects;
N_Holes(i)=N_Ho;
AvgEOB(i)=Avgeob;
Euler(i)= E;
Arnf(i) = Arnf1;
eccnmedian(i) = eccnmed;
eccnmean(i) = eccnm;
eccnv(i) = eccnvar;
eccnkurt(i) = eccnkurtosis;
% eccnsk(i) = eccnskewness;
end
%% plotting
%Updating the Variance of Eccentricity
for i = 1:12
if(isnan(eccnv(i)))
ECCNVIDC(i)=0;
else
ECCNVIDC(i)=eccnv(i);
end
end
for i = 13:24
if(isnan(eccnv(i)))
ECCNVN(i-12)=0;
else
ECCNVN(i-12)=eccnv(i);
end
end
%%
%Updating Kurtosis
for i = 1:12
if(isnan(eccnkurt(i)))
EOIDC_kurt(i)=0;
else
EOIDC_kurt(i)=eccnkurt(i);
end
end
for i = 13:24
if(isnan(eccnkurt(i)))
EON_kurt(i-12)=0;
else
EON_kurt(i-12)=eccnkurt(i);
end
end
%%
%Updating Skewness
for i = 1:12
if(isnan(eccnsk(i)))
EOIDC_skew(i)=0;
else
EOIDC_skew(i)=eccnsk(i);
end
end
for i = 13:24
if(isnan(eccnsk(i)))
EON_skew(i-12)=0;
else
EON_skew(i-12)=eccnsk(i);
end
end
%%
figure(1), scatter3(ECCNVN,EON_kurt,EON_skew, 'r');
hold on;
scatter3(ECCNVIDC,EOIDC_kurt,EOIDC_skew,'b');
title('Eccentricities variance vs Kurtosis vs skewness ');
legend('Holes of Normal Tissue - Eccentricity','Holes of Cancer tissue - Eccentricity');
xlabel('Variance of Eccentricity'); ylabel('Kurtosis of Eccentricity'); zlabel('Skewness of Eccentricity');
%%
figure(2);
plot(ECCNVN, EON_kurt,'ro');
hold on;
plot(ECCNVIDC, EOIDC_kurt,'b*');
hold on;
title('Eccentricity Kurtosis vs Eccentricity Variance');
legend('Normal Tissue','Cancer Tissue')
xlabel('Variance of Eccentricity'); ylabel('Kurtosis of Eccentricity');
figure(3);
plot(ECCNVN, EON_skew,'ro');
hold on;
plot(ECCNVIDC, EOIDC_skew,'b*');
hold on;
title('Eccentricity Skewness vs Eccentricity Variance');
legend('Normal Tissue','Cancer Tissue')
xlabel('Variance of Eccentricity'); ylabel('Skewness of Eccentricity');
figure(4);
plot( EON_skew,EON_kurt,'ro');
hold on;
plot(EOIDC_skew, EOIDC_kurt,'b*');
hold on;
title('Eccentricity Kurtosis vs Eccentricity Skewness');
legend('Normal Tissue','Cancer Tissue')
xlabel('Variance of Eccentricity'); ylabel('Kurtosis of Eccentricity');
%%
%Variance of Ratio of the Area of the nucleus to the total area of the
%chain
for i = 1:12
if(isnan(Arnf(i)))
ArvIDC(i)=0;
else
ArvIDC(i)=Arnf(i);
end
end
for i = 13:24
if(isnan(Arnf(i)))
ArvN(i-12)=0;
else
ArvN(i-12)=Arnf(i);
end
end
figure(5);
plot(ECCNVN, ArvN,'ro');
hold on;
plot(ECCNVIDC, ArvIDC,'b*');
hold on;
title('Variance of ratio of Nuclei area to total area vs Eccentricity Variance');
legend('Normal Tissue','Cancer Tissue')
xlabel('Variance of Eccentricity'); ylabel('Variance of the ratio of the Nuclei area to the total area of the chain');
%%
% %%Avgdiameter
% for i = 13:24
% if(isnan(AvgEdia(i)))
% AvgdiaN(i-12)=0;
% else
% AvgdiaN(i-12)=AvgEdia(i);
% end
% end
%
% for i = 1:12
% if(isnan(AvgEdia(i)))
% AvgdiaIDC(i)=0;
% else
% AvgdiaIDC(i)=AvgEdia(i);
% end
% end
%
% for i = 25:36
% if(isnan(AvgEdia(i)))
% AvgdiaDCIS(i-24)=0;
% else
% AvgdiaDCIS(i-24)= AvgEdia(i);
% end
% end
%
% %%
% figure(3), plot(AvgdiaN, 'rd','MarkerFaceColor', 'r');
% hold on;
% plot(AvgdiaIDC,'d','MarkerFaceColor','b');
% %plot(AvgdiaDCIS,'d','MarkerFaceColor', 'y');
% title('Avg diameter holes formed by connected chains in the images ');
% legend('Avg diameter of Normal Tissue ','Avg diameter of Cancer tissue ', 'Eccentricity of DCIS');
% xlabel('Instances/ Images'); ylabel('Average Diameters of the holes in the image');
% %Eccnmedian, Eccnmean, Areanfeature
% for i = 1:12
% if(isnan(eccnmedian(i)))
% EOIDCn(i)=0;
% else
% EOIDCn(i)=eccnmedian(i);
% end
% end
%
% for i = 13:24
% if(isnan(eccnmedian(i)))
% EONn(i-12)=0;
% else
% EONn(i-12)=eccnmedian(i);
% end
% end
%
% for i = 25:36
% if(isnan(eccnmedian(i)))
% EODCISn(i-24)=0;
% else
% EODCISn(i-24)=eccnmedian(i);
% end
% end
%
% figure(4), plot(EOIDCn, 'rd','MarkerFaceColor', 'r');
% hold on;
% plot(EONn,'d','MarkerFaceColor','b');
% %plot(EODCISn,'d','MarkerFaceColor', 'y');
% title('Avg Eccentricity of the nucleus vs the image instances ');
% legend('Avg Eccentricity of nuclei of Normal Tissue ','Avg Eccentricity of nuclei of Cancer tissue ', 'Avg Eccentricity of nuclei of the DCIS');
% xlabel('Instances/ Images'); ylabel('Average Diameters of the holes in the image');
%
%
%%
% %plotting mean values of eccentricities of nucleus
% for i = 1:12
% if(isnan(eccnmean(i)))
% EOIDCmn(i)=0;
% else
% EOIDCmn(i)=eccnmean(i);
% end
% end
%
% for i = 13:24
% if(isnan(eccnmean(i)))
% EONmn(i-12)=0;
% else
% EONmn(i-12)=eccnmean(i);
% end
% end
%
% for i = 25:36
% if(isnan(eccnmean(i)))
% EODCISmn(i-24)=0;
% else
% EODCISmn(i-24)=eccnmean(i);
% end
% end
%
% figure(5), plot(EOIDCmn, 'rd','MarkerFaceColor', 'r');
% hold on;
% plot(EONmn,'d','MarkerFaceColor','b');
% %plot(EODCISn,'d','MarkerFaceColor', 'y');
% title('Avg Eccentricity of the nucleus vs the image instances ');
% legend('Avg Eccentricity of nuclei of Normal Tissue ','Avg Eccentricity of nuclei of Cancer tissue ', 'Avg Eccentricity of nuclei of the DCIS');
% xlabel('Instances/ Images'); ylabel('Average eccentricities of the nuceleus of the image');
%
%
% %% plotting eccentricities of holes vs mean eccentricities of nucleus
% figure(6), plot(EOIDCmn,EOIDC, 'r*');
% hold on;
% plot(EONmn, EON, 'b*');
% title('Eccentricities of Nuclei vs eccentricities of holes');
% legend('Cancer','Normal');
% xlabel('Eccentricity of Nuclei (Nuclear size)');
% ylabel('Eccentricity of holes (Tubular Feature)');