-
Notifications
You must be signed in to change notification settings - Fork 0
/
rd_plotTADetectDiscrimGroupHMFACR.m
128 lines (118 loc) · 3.43 KB
/
rd_plotTADetectDiscrimGroupHMFACR.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
% rd_plotTADetectDiscrimGroupHMFACR.m
%% setup
trialSelections = {'detectHit','detectMiss','detectFA','detectCR'};
% trialSelections = {'correct','incorrect'};
respTarget = 'T2Resp';
%% get data
for i = 1:numel(trialSelections)
selectionStr = sprintf('topChannels5_%sTrials%s', trialSelections{i}, respTarget);
[groupDataTS(i), groupMeanTS(i), groupSteTS(i), A] = rd_plotTADetectDiscrimGroup('ts-single', selectionStr, 'none');
end
for i = 1:numel(trialSelections)
selectionStr = sprintf('topChannels5_%sTrials%s', trialSelections{i}, respTarget);
[groupDataW(i), groupMeanW(i), groupSteW(i), A] = rd_plotTADetectDiscrimGroup('w-single', selectionStr, 'stim');
end
%% organize hmfc data
switch respTarget
case 'T1Resp'
iT = 1;
case 'T2Resp'
iT = 2;
otherwise
error('respTarget not recognized')
end
for i = 1:numel(trialSelections)
hmfcMean.nTrialsPerCond(:,i) = groupMeanTS(i).nTrialsPerCond;
hmfcSte.nTrialsPerCond(:,i) = groupSteTS(i).nTrialsPerCond;
hmfcMean.PAAUT(:,:,i) = groupMeanW(i).PAAUT(:,:,iT);
hmfcSte.PAAUT(:,:,i) = groupSteW(i).PAAUT(:,:,iT);
hmfcMean.PAT(:,:,i) = groupMeanW(i).PAT(:,:,iT);
hmfcSte.PAT(:,:,i) = groupSteW(i).PAT(:,:,iT);
end
%% plot figs
twin = A.wtwin;
colors = get(gca,'ColorOrder');
lw = [4 2 4 2];
%% nTrials
figure
hold on
bar(hmfcMean.nTrialsPerCond)
plot([1 numel(A.trigNames)],[56 56],'--k')
ylim([0 60])
ylabel('number of trials')
set(gca,'XTick', 1:numel(A.trigNames))
set(gca,'XTickLabel',A.trigNames)
rotateXLabels(gca,45)
legend(trialSelections)
colormap(colors(1:4,:))
%% PAAUT
ylims = [.9 1.15];
figure
subplot(1,2,1)
hold on
plot(twin(1):twin(end), squeeze(hmfcMean.PAAUT(:,1,:)),'LineWidth',4)
plot(twin(1):twin(end), squeeze(hmfcMean.PAAUT(:,2,:)),'LineWidth',2)
for i = 1:2
for j = 1:2
shadedErrorBar(twin(1):twin(end), squeeze(hmfcMean.PAAUT(:,i,j)), ...
squeeze(hmfcSte.PAAUT(:,i,j)), {'color',colors(j,:),'LineWidth',lw(i)}, 1)
end
end
xlim(twin)
ylim(ylims);
vline(0,'k');
xlabel('time (ms)')
ylabel('wavelet amp')
title('present')
subplot(1,2,2)
hold on
plot(twin(1):twin(end), squeeze(hmfcMean.PAAUT(:,3,:)),'LineWidth',4)
plot(twin(1):twin(end), squeeze(hmfcMean.PAAUT(:,4,:)),'LineWidth',2)
for i = 3:4
for j = 3:4
shadedErrorBar(twin(1):twin(end), squeeze(hmfcMean.PAAUT(:,i,j)), ...
squeeze(hmfcSte.PAAUT(:,i,j)), {'color',colors(j,:),'LineWidth',lw(i)}, 1)
end
end
xlim(twin)
ylim(ylims);
vline(0,'k');
xlabel('time (ms)')
ylabel('wavelet amp')
title('absent')
legend(trialSelections)
%% PAT
% col = colors([1 4],:);
col = colors;
ylims = [.9 1.15];
figure
subplot(1,2,1)
hold on
plot(twin(1):twin(end), squeeze(hmfcMean.PAT(:,1,:)),'LineWidth',4)
for j = 1:2
shadedErrorBar(twin(1):twin(end), squeeze(hmfcMean.PAT(:,1,j)), ...
squeeze(hmfcSte.PAT(:,1,j)), {'color',col(j,:),'LineWidth',4}, 1)
end
xlim(twin)
ylim(ylims);
vline(0,'k');
xlabel('time (ms)')
ylabel('wavelet amp')
title('present')
subplot(1,2,2)
hold on
% plot(twin(1):twin(end), squeeze(hmfcMean.PAAUT(:,3,:)),'LineWidth',4)
for j = 1:2
plot(twin(1):twin(end), squeeze(hmfcMean.PAT(:,2,j)),'LineWidth',4, 'color', col(j,:))
end
for j = 3:4 %1:2
shadedErrorBar(twin(1):twin(end), squeeze(hmfcMean.PAT(:,2,j)), ...
squeeze(hmfcSte.PAT(:,2,j)), {'color',col(j,:),'LineWidth',4}, 1)
end
xlim(twin)
ylim(ylims);
vline(0,'k');
xlabel('time (ms)')
ylabel('wavelet amp')
title('absent')
legend(trialSelections)