forked from RajanikantPanda/resting_EEG_Mohawk_Connectivity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplothead.m
60 lines (46 loc) · 1.55 KB
/
plothead.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
function plothead(basename,bandidx,varargin)
param = finputcheck(varargin, {
'arcs', 'string', {'strength','module'}, 'strength'; ...
'movie', 'string', {'on','off'}, 'on'; ...
});
loadpaths
load([filepath filesep basename '_mohawk.mat']);
plotqt = 0.7;
bands = {
'delta'
'theta'
'alpha'
'beta'
'gamma'
};
cohmat = squeeze(matrix(bandidx,:,:));
erange = [0 1];
vrange = [0 1]; % changes the plot scaling (colours)
minfo = plotgraph3d(cohmat,'plotqt',plotqt,'escale',erange,'vscale',vrange,'cshift',0.4,...
'numcolors',5,'arcs',param.arcs,'lhfactor',1,'athick',0.25);
fprintf('%s: %s band - number of modules: %d\n',basename,bands{bandidx},length(unique(minfo)));
set(gcf,'Name',sprintf('%s: %s band',basename,bands{bandidx}));
fprintf('Saving image.\n');
camva(8);
camtarget([-9.7975 -28.8277 41.8981]);
campos([-1.7547 1.7161 1.4666]*1000);
camzoom(1.25);
set(gcf,'InvertHardCopy','off');
print(gcf,sprintf('%s/figures/%s_%s_mohawk.tif',filepath,basename,bands{bandidx}),'-dtiff','-r300');
if strcmp(param.movie,'on')
writerObj = VideoWriter(sprintf('%s/figures/%s_%s_mohawk.avi',filepath,basename,bands{bandidx}));
writerObj.FrameRate = 25; % How many frames per second.
open(writerObj);
angledelta = 2;
hold on
fprintf('Saving movie...');
for a = angledelta:angledelta:360
camorbit(gca,angledelta,0);
frame = getframe(gcf);
writeVideo(writerObj, frame);
end
hold off
close(writerObj); % Saves the movie.
fprintf(' Done.\n');
end
end