-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport_network_features.m
69 lines (50 loc) · 2.18 KB
/
report_network_features.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
%---------------------------------------------------------
% Plot average network measures topographies
%---------------------------------------------------------
% Average topographies of the network measures
% across time
topo_settings = {'electrodes', 'labels', ...
'whitebk', 'on', 'gridscale', 300};
for b = 1 : n_bands
signal = squeeze(eeg_features_norm(:, :, b));
signal = squeeze(mean(signal, 1));
max_signal_abs = max(max(signal), ...
abs(min(signal)));
my_title = strcat('Topographic map of', ...
' average (through time)', {' '}, upper(net_metric), ...
' for the', {' '}, id_bands(b), ' band');
figure('Name', my_title);
topoplot(signal, chanlocs, topo_settings{:});
title(my_title);
colorbar; caxis([-max_signal_abs max_signal_abs]);
img_out = strcat(upper(full_metric), ...
'_', id_bands(b), '_TOPO_Avg.png');
saveas(gcf,fullfile(path_img_out(s), img_out));
end
%---------------------------------------------------------
% Plot all feature (network measure) time-series
%---------------------------------------------------------
for b = 1 : n_bands
signal = eeg_features_norm(:, plotting_channel, b);
signal_delayed = eeg_features_delayed_norm...
(:, plotting_channel, plotting_delay, b);
my_title = strcat(id_bands(b), {' '}, upper(con_metric), ...
{' '}, upper(net_metric), ' of channel', {' '}, ...
id_chans(plotting_channel), ', delay', {' '}, ...
num2str(delays(plotting_delay)), 's');
figure('Name',my_title)
plot(time, signal); hold on;
plot(time, signal_delayed);
title(my_title);
xlabel('Time(s)');
ylabel(upper(strcat(con_metric, ...
'{_', net_metric, '}')));
legend(strcat(id_bands(b),' feature'), ...
strcat(id_bands(b),' feature,', ...
plotting_shift,', delay',{' '} , ...
num2str(delays(plotting_delay)), 's'));
img_out = strcat(upper(full_metric), '_', id_bands(b), ...
num2str(delays(plotting_delay)), 'sec', ...
id_chans(plotting_channel),'.png');
saveas(gcf,fullfile(path_img_out(s), img_out));
end % looping through bands