-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlot_GCA.m
More file actions
149 lines (124 loc) · 3.41 KB
/
Plot_GCA.m
File metadata and controls
149 lines (124 loc) · 3.41 KB
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
function Plot_GCA(save_fg)
%
% Make plots representing RP patients GCA compare to normal distribution
% taken from (Koh et al,. IOVS 2012).
%
% SO@Stanford Vista team 2015
%% Load patients' GCA
% if you are air
% cd /Users/shumpei/Google Drive/RP
[NUM,TXT,RAW]=xlsread('Profiles_full.xlsx',8);
%% Load normal data
[num,txt,raw]=xlsread('normal data Christopher. Kotowski.xlsx',3);
%% retieave data and give names
PatientID = RAW(2:end,1);
Eye = RAW(2:end,2);
Label = TXT(1,:);
OCT_Label = Label(5:end);
%% Sort OCT data
for ii = 1:length(Eye)/2;
OD(ii,:) = NUM((2*ii-1),3:end);
OS(ii,:) = NUM((2*ii),3:end);
end
%% retrieve normal distribution
Nmean = num(6:end,1)';
Nsd = num(6:end,2)';
% Nlabel = txt(7:end,1);
Nlabel = {'Ave','Min','ST','S','SN','IN','I','IN'};
%% OD GCA plot
% Normal ditribution with Errorbar2
mrvNewGraphWin; hold on;
% normal
errorbar2(1:length(Nmean),Nmean,Nsd*2,1,'color',[0.9 0.9 0.9],...
'linewidth',10);
errorbar2(1:length(Nmean),Nmean,Nsd,1,'color',[0.8 0.80 0.8],...
'linewidth',10);
xlim([0, 9]);
h = gca;
h.XTick = [1:8];
h.YTick = [10,60,110];
h.XTickLabel = Nlabel;
% h.XTickLabelRotation = -90;
% add individual plot
SU = plot(4, OD(:,4),'o','linewidth',2);
Inf = plot(7, OD(:,7),'o','linewidth',2);
SN = plot(5, OD(:,5),'o','linewidth',2);
IN = plot(8, OD(:,6),'o','linewidth',2);
ST = plot(3, OD(:,3),'o','linewidth',2);
IN = plot(6, OD(:,8),'o','linewidth',2);
MIN = plot(2, OD(:,2),'o','linewidth',2);
AVE = plot(1, OD(:,1),'o','linewidth',2);
% add title
title('R GCIPL thinckness','fontsize',14);
set(gca, 'tickdir','out','box','off')
% save the fig
if save_fg,
saveas(gcf,'R_Mac_oct.png')
saveas(gcf,'R_Mac_oct.eps','psc2')
end
%% OS GCA plot
% Normal ditribution with Errorbar2
mrvNewGraphWin; hold on;
% normal
errorbar2(1:length(Nmean),Nmean,Nsd*2,1,'color',[0.9 0.9 0.9],...
'linewidth',10);
errorbar2(1:length(Nmean),Nmean,Nsd,1,'color',[0.8 0.80 0.8],...
'linewidth',10);
% h.XTickLabelRotation = -90;
% add individual plot
SU = plot(4, OS(:,4),'o','linewidth',2);
Inf = plot(7, OS(:,7),'o','linewidth',2);
SN = plot(5, OS(:,5),'o','linewidth',2);
IN = plot(8, OS(:,6),'o','linewidth',2);
ST = plot(3, OS(:,3),'o','linewidth',2);
IT = plot(6, OS(:,8),'o','linewidth',2);
MIN = plot(2, OS(:,2),'o','linewidth',2);
AVE = plot(1, OS(:,1),'o','linewidth',2);
% add title
title('L-GCIPL thinckness','fontsize',14);
set(gca, 'tickdir','out','box','off')
% make the fig up
xlim([0, 9]);
h = gca;
h.XTick = [1:8];
h.YLim = [10, 110];
h.YTick = [10,60,110];
h.XTickLabel = Nlabel;
% save
if save_fg,
saveas(gcf,'L_mac_oct.png')
saveas(gcf,'L_mac_oct.eps','psc2')
end
%% Both GCA plot
% Normal ditribution with Errorbar2
mrvNewGraphWin; hold on;
% normal
a = errorbar2(1:length(Nmean),Nmean,Nsd*2,1,'color',[0.9 0.9 0.9],...
'linewidth',10);
b = errorbar2(1:length(Nmean),Nmean,Nsd,1,'color',[0.8 0.80 0.8],...
'linewidth',10);
% l = legend('1sd','2sd')
% L = get(l);
% make the fig up
xlim([0, 9]);
h = gca;
h.XTick = [1:8];
h.YTick = [10,60,110];
h.XTickLabel = Nlabel;
% h.XTickLabelRotation = -90;
% add individual plot
id = [1:5,8,7,6];
for jj =1 : 8;
plot(jj,mean([OD(:,id(jj)), OS(:,id(jj))],2),'o','linewidth',2);
end
% add title
title('GCIPL thinckness','fontsize',14);
set(gca,'ytick',[10,110], 'tickdir','out','box','off')
% legend('2SD','1SD')
% legend('boxoff')
% save
if save_fg,
saveas(gcf,'B_mac_oct.png')
saveas(gcf,'B_mac_oct.eps','psc2')
end
return