-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtempScript.m
More file actions
141 lines (140 loc) · 8.18 KB
/
Copy pathtempScript.m
File metadata and controls
141 lines (140 loc) · 8.18 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
script_calcScalograms_20150507
script_phaseAmp_coupling_Gabors
% % try
% % script_review_phaseAmp_Gabors
% % catch
% % disp('error in review gabors')
% % end
% %
% % script_phaseAmp_coupling_Gabor_surrogates_b
%
% %%
% numPages = 0;
% numRegionPlots = 0;
% h_fig = cell(length(var_to_plot), length(plotTypes)); h_axes = cell(length(var_to_plot), length(plotTypes));
%
% for iRegion = 1 : numRegions
% numRegionPlots = numRegionPlots + 1;
%
% rowNum = rem(numRegionPlots, regions_per_page);
% if rowNum == 1
% for iVar = 1 : length(var_to_plot)
% for iPlotType = 1 : length(plotTypes)
% h_fig{iVar, iPlotType} = zeros(1, length(plotFreqs{iPlotType}));
% h_axes{iVar, iPlotType} = zeros(length(plotFreqs{iPlotType}), figProps.m, figProps.n);
% for iFreq = 1 : length(plotFreqs{iPlotType})
% [h_fig{iVar, iPlotType}(iFreq), h_axes{iVar, iPlotType}(iFreq, :, :)] = createFigPanels5(figProps);
% end
% end
% end
% page_regionList = ROI_list{iRegion};
% numSessions_perRegionList = num2str(numSessions_perRegion(iRegion));
% % page_locList = ch.location.subclass;
% numPages = numPages + 1;
% else
% page_regionList = [page_regionList ', ' ch.name];
% numSessions_perRegionList = [numSessions_perRegionList ', ' num2str(numSessions_perRegion(iRegion))];
% % page_locList = [page_locList ', ' ch.location.subclass];
% end
% %%
% if rowNum == 0; rowNum = regions_per_page; end
%
% for iVar = 1 : length(var_to_plot)
% for iPlotType = 1 : length(plotTypes)
% for iFreq = 1 : length(plotFreqs{iPlotType})
% for iEventType = 1 : numEventTypes
% switch plotTypes{iPlotType}
% case 'const_phase_f',
% if strcmpi(var_to_plot{iVar}, 'mrl')
% toPlot = squeeze(mean_mrl_byRegion(iRegion, iEventType, phase_freq_idx(iFreq), :, :));
% colorLim = mrl_clim;
% textStr{1} = sprintf('mrl, phase-amplitude coupling, constant phase freq = %f Hz', plotFreqs{iPlotType}(iFreq));
% else
% toPlot = squeeze(mean_mrl_z_byRegion(iRegion, iEventType, phase_freq_idx(iFreq), :, :));
% colorLim = z_clim;
% textStr{1} = sprintf('mrl z-score, phase-amplitude coupling, constant phase freq = %f Hz', plotFreqs{iPlotType}(iFreq));
% end
% x = t;
% y = 1:length(amp_f);
% y_ticks = amp_freqTick_idx;
% x_ticks = t_ticks;
% yticklabel = amp_freqTick_label;
% xticklabel = x_ticks;
% case 'const_amp_f',
% if strcmpi(var_to_plot{iVar}, 'mrl')
% toPlot = squeeze(mean_mrl_byRegion(iRegion, iEventType, :, amp_freq_idx(iFreq), :));
% colorLim = mrl_clim;
% textStr{1} = sprintf('mrl, phase-amplitude coupling, constant amplitude freq = %f Hz', plotFreqs{iPlotType}(iFreq));
% else
% toPlot = squeeze(mean_mrl_z_byRegion(iRegion, iEventType, :, amp_freq_idx(iFreq), :));
% colorLim = z_clim;
% textStr{1} = sprintf('mrl z-score, phase-amplitude coupling, constant amplitude freq = %f Hz', plotFreqs{iPlotType}(iFreq));
% end
% x = t;
% y = 1:length(phase_f);
% y_ticks = phase_freqTick_idx;
% x_ticks = t_ticks;
% yticklabel = phase_freqTick_label;
% xticklabel = x_ticks;
% case 'averaged_t',
% if strcmpi(var_to_plot{iVar}, 'mrl')
% toPlot = squeeze(mean(mean_mrl_byRegion(iRegion, iEventType, :, :, :), 5))';
% colorLim = mrl_clim;
% textStr{1} = 'mrl, phase-amplitude coupling, average across time';
% else
% toPlot = squeeze(mean(mean_mrl_z_byRegion(iRegion, iEventType, :, :, :), 5))';
% colorLim = z_clim;
% textStr{1} = 'mrl z-score, phase-amplitude coupling, average across time';
% end
% x = 1:length(phase_f);
% y = 1:length(amp_f);
% x_ticks = phase_freqTick_idx;
% y_ticks = amp_freqTick_idx;
% yticklabel = amp_freqTick_label;
% xticklabel = phase_freqTick_label;
% end
%
% axes(h_axes{iVar, iPlotType}(iFreq, rowNum, iEventType));
% imagesc(x,y,toPlot); % need to check that toPlot is in the correct orientation
% set(gca,'ydir','normal',...
% 'clim',colorLim,...
% 'xtick',x_ticks,...
% 'ytick',y_ticks);
% colormap jet;
%
% if rowNum == 1
% title(region_phaseAmp_metadata.eventList{iEventType});
% end
% if rowNum < regions_per_page
% set(gca,'xticklabel',[]);
% else
% set(gca,'xticklabel',xticklabel);
% end
% if iEventType > 1
% set(gca,'yticklabel',[]);
% else
% set(gca,'yticklabel',yticklabel);
% end
%
% end % for iEventType...
% if (rowNum == regions_per_page || numRegionPlots == numRegions)
% h_figAxes = createFigAxes(h_fig{iVar, iPlotType}(iFreq));
% axes(h_figAxes);
%
% textStr{2} = ['Trial type: ' region_phaseAmp_metadata.trialType];
% textStr{3} = page_regionList;
% textStr{4} = ['Number of sessions in average: ' numSessions_perRegionList];
% text('units','centimeters','position',[3, 8*2.54], 'string',textStr);
% if numPages == 1
% export_fig(fig_saveName{iVar, iPlotType}{iFreq},'-pdf','-q101','-painters');
% else
% export_fig(fig_saveName{iVar, iPlotType}{iFreq},'-pdf','-q101','-painters','-append');
% end
% close(h_fig{iVar, iPlotType}(iFreq));
% end
% end % for iFreq...
% end % for iPlotType...
%
% end % for iVar...
%
% end % for iRegion...