forked from LauraDugue/endo_exo_MRI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firstVisualPlotROI_by_ROI.m
136 lines (113 loc) · 3.51 KB
/
firstVisualPlotROI_by_ROI.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
% firstVisualPlotROI_by_ROI.m
%
% usage: firstVisualPlotROI_by_ROI(ehdr, ehdrste, roiName)
% by: eli & laura
% date: 01/17/15
% purpose:
function firstVisualPlotROI_by_ROI(ehdr, ehdrste, roiName, cond, obs)
% INFO
% VALID: 1, 3, 5 and 7
% INVALID: 2, 4, 6 and 8
% Valid-Pre-Left
% Invalid-Pre-Left
% Valid-Post-Left
% Invalid-Post-Left
% Valid-Pre-Right
% Invalid-Pre-Right
% Valid-Post-Right
% Invalid-Post-Right
% CueOnly-Left
% CueOnly-Right
% Blank
% Blink
%% Valid vs. Invalid
% set boudaries
yMax = ceil(10*(max(ehdr(1:8)+max(ehdrste(1:8)))))/10;
yMin = min(0, floor(10*(min(ehdr(1:8))-max(ehdrste(1:8))))/10);
% create a new figure
smartfig('Valid-Invalid'); clf;
% title for the figure based on the ROI
suptitle(sprintf([cond ' (%s)'], fixBadChars(roiName, {'_',' '})));
subplot(1,2,1)
cla
bar([mean(ehdr([1 5])) mean(ehdr([2 6]))], 'facecolor', 'k');
hold on
errorbar([mean(ehdr([1 5])) mean(ehdr([2 6]))], [sqrt(ehdrste(1).^2 + ehdrste(5).^2)...
sqrt(ehdrste(2).^2 + ehdrste(6).^2)], 'ko');
xaxis([0 3]);
yaxis([yMin yMax]);
axis square;box off;
set(gca,'xTickLabel',{'Valid' 'Invalid'},'FontSize',14);
ylabel('fMRI resp (% chg img intensity)');
title('Pre-cueing')
subplot(1,2,2)
cla
bar([mean(ehdr([3 7])) mean(ehdr([4 8]))], 'facecolor', 'k');
hold on
errorbar([mean(ehdr([3 7])) mean(ehdr([4 8]))], [sqrt(ehdrste(3).^2 + ehdrste(7).^2)...
sqrt(ehdrste(4).^2 + ehdrste(8).^2)], 'ko');
xaxis([0 3]);
yaxis([yMin yMax]);
axis square;box off;
set(gca,'xTickLabel',{'Valid' 'Invalid'},'FontSize',14);
ylabel('fMRI resp (% chg img intensity)');
title('Post-cueing')
% print('-djpeg','-r500',[obs '_' cond '_ValidInvalid_' roiName]);
%% Separating left and right visual field
%%% LEFT
% create a new figure
smartfig('Valid-Invalid (left Hemi)'); clf;
% title for the figure based on the ROI
suptitle(sprintf(['(left Hemi) ' cond ' (%s)'], fixBadChars(roiName, {'_',' '})));
subplot(1,2,1)
cla
bar([ehdr(1) ehdr(2)], 'facecolor', 'k');
hold on
errorbar([ehdr(1) ehdr(2)], [ehdrste(1) ehdrste(2)], 'ko');
xaxis([0 3]);
yaxis([yMin yMax]);
axis square;box off;
set(gca,'xTickLabel',{'Valid' 'Invalid'},'FontSize',14);
ylabel('fMRI resp (% chg img intensity)');
title('Pre-cueing')
subplot(1,2,2)
cla
bar([ehdr(3) ehdr(4)], 'facecolor', 'k');
hold on
errorbar([ehdr(3) ehdr(4)], [ehdrste(3) ehdrste(4)], 'ko');
xaxis([0 3]);
yaxis([yMin yMax]);
axis square;box off;
set(gca,'xTickLabel',{'Valid' 'Invalid'},'FontSize',14);
ylabel('fMRI resp (% chg img intensity)');
title('Post-cueing')
print('-djpeg','-r500',['/Local/Users/purpadmin/Desktop/Laura/' obs '_' cond '_ValidInvalid_' roiName '_LeftHemi']);
%%% RIGHT
% create a new figure
smartfig('Valid-Invalid (right Hemi)'); clf;
% title for the figure based on the ROI
suptitle(sprintf(['(right Hemi) ' cond ' (%s)'], fixBadChars(roiName, {'_',' '})));
subplot(1,2,1)
cla
bar([ehdr(5) ehdr(6)], 'facecolor', 'k');
hold on
errorbar([ehdr(5) ehdr(6)], [ehdrste(5) ehdrste(6)], 'ko');
xaxis([0 3]);
yaxis([yMin yMax]);
axis square;box off;
set(gca,'xTickLabel',{'Valid' 'Invalid'},'FontSize',14);
ylabel('fMRI resp (% chg img intensity)');
title('Pre-cueing')
subplot(1,2,2)
cla
bar([ehdr(7) ehdr(8)], 'facecolor', 'k');
hold on
errorbar([ehdr(7) ehdr(8)], [ehdrste(7) ehdrste(8)], 'ko');
xaxis([0 3]);
yaxis([yMin yMax]);
axis square;box off;
set(gca,'xTickLabel',{'Valid' 'Invalid'},'FontSize',14);
ylabel('fMRI resp (% chg img intensity)');
title('Post-cueing')
print('-djpeg','-r500',['/Local/Users/purpadmin/Desktop/Laura/' obs '_' cond '_ValidInvalid_' roiName '_RightHemi']);
end