-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRP_plot_24C.m
More file actions
127 lines (102 loc) · 3.3 KB
/
RP_plot_24C.m
File metadata and controls
127 lines (102 loc) · 3.3 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
function RP_plot_24C(property,tract)
%% load afq structure
load '/sni-storage/wandell/biac2/wandell/data/DWI-Tamagawa-Japan2/RP/afq_8RP_25Normal_02102015.mat'
%% Argumenty check
%% retrieve vals
ii = 1:size(afq.patient_data(1).FA,1); % numbers of patient group
tract = upper(tract);
switch tract
case {'LOT'}
jj = 21;
case {'ROT'}
jj =22;
case {'LOR'}
jj = 23;
case {'ROR'}
jj =24;
end
sprintf('** Render %s values of %s **',property ,afq.fgnames{jj})
% for jj=1:length(afq.patient_data)
% Collect the property of interest and the relevant norms
switch(property)
case {'FA' 'fa' 'fractional anisotropy'}
vals = afq.patient_data(jj).FA(ii,:);
val_mean = afq.norms.meanFA(:,jj);
val_sd = afq.norms.sdFA(:,jj);
ctl = afq.vals.fa{jj}(9:end,:);
XLIM = [10,90];
YLIM = [0 0.7];
XTICK = XLIM;
YTICK = YLIM;
XTICKLabel = {'OC','LGN'};
case {'MD' 'md' 'mean diffusivity'}
vals = afq.patient_data(jj).MD(ii,:);
val_mean = afq.norms.meanMD(:,jj);
val_sd = afq.norms.sdMD(:,jj);
ctl = afq.vals.md{jj}(9:end,:);
XLIM = [10,90];
YLIM = [0.6 1.8];
XTICK = XLIM;
YTICK = YLIM;
XTICKLabel = {'OC','LGN'};
case {'RD' 'rd' 'radial diffusivity'}
vals = afq.patient_data(jj).RD(ii,:);
val_mean = afq.norms.meanRD(:,jj);
val_sd = afq.norms.sdRD(:,jj);
ctl = afq.vals.rd{jj}(9:end,:)';
XLIM = [10,90];
YLIM = [0.4 1.6];
XTICK = XLIM;
YTICK = YLIM;
XTICKLabel = {'OC','LGN'};
case {'AD' 'ad' 'axial diffusivity'}
vals = afq.patient_data(jj).AD(ii,:);
val_mean = afq.norms.meanAD(:,jj);
val_sd = afq.norms.sdAD(:,jj);
ctl = afq.vals.ad{jj}(9:end,:);
XLIM = [10,90];
YLIM = [1 2.4];
XTICK = XLIM;
YTICK = YLIM;
XTICKLabel = {'OC','LGN'};
end
%% Stats
for kk = 1:length(vals);
[p(kk),h(kk)] = ranksum(ctl(:,kk),vals(:,kk),'alpha',0.01);
[P(kk),H(kk)] = ranksum(ctl(:,kk),vals(:,kk),'alpha',0.05);
end
%% Optic Tract
mrvNewGraphWin; hold on;
X = 1:100;
c = lines(100);
% % put bars based on wilcoxson (p<0.01, 0.05)
bar(H*2,1.0,'edgecolor','none','facecolor',[0.8 0.7 0.1])
bar(h*2,1.0,'edgecolor','none','facecolor',[0.5 0.7 0.3])
% Control
st = val_sd;
m = val_mean;
% render control subjects range
A3 = area(m+2*st);
A1 = area(m+st);
A2 = area(m-st);
A4 = area(m-2*st);
% set color and style
set(A1,'FaceColor',[0.6 0.6 0.6],'linestyle','none')
set(A2,'FaceColor',[0.8 0.8 0.8],'linestyle','none')
set(A3,'FaceColor',[0.8 0.8 0.8],'linestyle','none')
set(A4,'FaceColor',[1 1 1],'linestyle','none')
plot(m,'color',[0 0 0], 'linewidth',3 )
% add individual
for k = 1:size(afq.patient_data(1).FA,1)
plot(X,vals(k,:),'Color',c(5,:),'linewidth',1);
end
% plot mean value
m = nanmean(vals,1);
plot(X,m,'Color',c(5,:) ,'linewidth',3)
% add label
xlabel('Location','fontName','Times','fontSize',14);
ylabel(upper(property),'fontName','Times','fontSize',14);
set(gca,'xlim',XLIM,'xtick',XTICK,'xtickLabel',XTICKLabel,...
'ylim',YLIM,'ytick',YTICK,'ytickLabel',YTICK)
title( afq.fgnames{jj}(1:3),'fontSize',20)
% axis([10, 90 ,0.0, 0.600001])