Commit 25efb947 authored by Julius Welzel's avatar Julius Welzel

excluded eye electrodes

parent 0fd01b23
......@@ -18,26 +18,74 @@ end
list = dir(fullfile([PATHIN_ICA '*clean*.set']));
SUBJ = extractBefore({list.name},'_');
young = [1:16,34];
old = 17:33;
% set colors
color = redblue(100);
FB = {'mue','beta','broad'};
% load rERD file
if exist ('m_rERD_trial') ~= 1; load([PATHOUT_ERD 'ERD_mue.mat']);load([PATHOUT_ERD 'cfg.mat']);end;
load([PATHOUT_ERD 'cfg.mat']);
load([PATHIN_EMG 'emg_all.mat']); %emg files
% set colors
color = redblue(100);
%% loop over FBs
for fb = 1:length(FB)
load([PATHOUT_ERD 'ERD_' FB{fb} '.mat']);
%% define trails of interest
ME_trials = [cfg.blck_idx{[1 4],1}];
MI_trials = [cfg.blck_idx{[2 3],1}];
% z-score over all
z_top_st = nanzscore(m_rERD_trial,[],2);
% Topoplots mean ERD & z-score ERD
%% Topoplots mean ERD & z-score ERD rERD values below mean BL
mERD_ME = nanmean(nanmean(m_rERD_trial(:,:,ME_trials),3),1);
zERD_ME = (mERD_ME-mean(mERD_ME))/std(mERD_ME);
zERD_ME = zscore(mERD_ME);
mERD_MI = nanmean(nanmean(m_rERD_trial(:,:,MI_trials),3),1);
zERD_MI = (mERD_MI-mean(mERD_MI))/std(mERD_MI);
zERD_MI = zscore(mERD_MI);
figure;
topoplot(mERD_ME,cfg.chanlocs,'colormap',color)
hc=colorbar;
caxis([min(mERD_ME)-3 max(mERD_ME)+3])
xlabel(hc,'ERD [%]');
title (['Group average ERD ' FB{fb} ' for all ME trials']);
save_fig(gcf,[PATHOUT_ERD 'plots\'],['mERD_ME_' FB{fb}]);
figure;
topoplot(zERD_ME,cfg.chanlocs,'colormap',color)
hc=colorbar;
xlabel(hc,'z-value');
title (['Group average z-scored ERD ' FB{fb} ' for all ME trials']);
save_fig(gcf,[PATHOUT_ERD 'plots\'],['zERD_ME_' FB{fb}]);
figure;
topoplot(mERD_MI,cfg.chanlocs,'colormap',color)
hc=colorbar;
caxis([min(mERD_MI)-3 max(mERD_MI)+3])
xlabel(hc,'ERD [%]');
title (['Group average ERD ' FB{fb} ' for all MI trials']);
save_fig(gcf,[PATHOUT_ERD 'plots\'],['mERD_MI_' FB{fb}]);
figure;
topoplot(zERD_MI,cfg.chanlocs,'colormap',color)
hc=colorbar;
xlabel(hc,'z-value');
title (['Group average z-scored ERD ' FB{fb} ' for all MI trials']);
save_fig(gcf,[PATHOUT_ERD 'plots\'],['zERD_MI_' FB{fb}]);
%% Topoplots mean ERD & z-score ERD all rERD values
mERD_ME = nanmean(nanmean(m_rERD_trial_all(:,:,ME_trials),3),1);
zERD_ME = zscore(mERD_ME);
mERD_MI = nanmean(nanmean(m_rERD_trial_all(:,:,MI_trials),3),1);
zERD_MI = zscore(mERD_MI);
figure;
......@@ -45,32 +93,52 @@ topoplot(mERD_ME,cfg.chanlocs,'colormap',color)
hc=colorbar;
caxis([min(mERD_ME)-3 max(mERD_ME)+3])
xlabel(hc,'ERD [%]');
title 'Group average ERD 8-30Hz for all ME trials';
save_fig(gcf,[PATHOUT_ERD 'plots\'],'all_mERD_ME');
title (['Group average ERD ' FB{fb} ' for all ME trials']);
save_fig(gcf,[PATHOUT_ERD 'plots\'],['all_mERD_ME_' FB{fb}]);
figure;
topoplot(zERD_ME,cfg.chanlocs,'colormap',color)
hc=colorbar;
xlabel(hc,'z-value');
title 'Group average z-scored ERD 8-30Hz for all ME trials';
save_fig(gcf,[PATHOUT_ERD 'plots\'],'all_zERD_ME_mue');
title (['Group average z-scored ERD ' FB{fb} ' for all ME trials']);
save_fig(gcf,[PATHOUT_ERD 'plots\'],['all_zERD_ME_' FB{fb}]);
figure;
topoplot(mERD_MI,cfg.chanlocs,'colormap',color)
hc=colorbar;
caxis([min(mERD_MI)-3 max(mERD_MI)+3])
xlabel(hc,'ERD [%]');
title 'Group average ERD 8-30Hz for all MI trials';
save_fig(gcf,[PATHOUT_ERD 'plots\'],'all_mERD_MI_mue');
title (['Group average ERD ' FB{fb} ' for all MI trials']);
save_fig(gcf,[PATHOUT_ERD 'plots\'],['all_mERD_MI_' FB{fb}]);
figure;
topoplot(zERD_MI,cfg.chanlocs,'colormap',color)
hc=colorbar;
xlabel(hc,'z-value');
title 'Group average z-scored ERD 8-30Hz for all MI trials';
save_fig(gcf,[PATHOUT_ERD 'plots\'],'all_zERD_MI_mue');
title (['Group average z-scored ERD ' FB{fb} ' for all MI trials']);
save_fig(gcf,[PATHOUT_ERD 'plots\'],['all_zERD_MI_' FB{fb}]);
%% Topo per MI per group
z_y = max(abs([max(nanmean(nanmean(z_top_st(old,:,MI_trials),3))) min(nanmean(nanmean(z_top_st(old,:,MI_trials),3)))]));
z_o = max(abs([max(nanmean(nanmean(z_top_st(young,:,MI_trials),3))) min(nanmean(nanmean(z_top_st(young,:,MI_trials),3)))]));
z_v = round(max([z_o z_y]),1);
f_s = 15;
figure;
topoplot(nanmean(nanmean(z_top_st(old,:,MI_trials),3)),cfg.chanlocs,'colormap',color,'style','map')
hc=colorbar;
caxis ([-z_v z_v])
xlabel(hc,'z-Score [\sigma]');
save_fig(gcf,[PATHOUT_ERD 'plots\'],['zERD_MI_old_' FB{fb}],'fontsize',30,'figsize',[0 0 f_s+5 f_s]);
figure;
topoplot(nanmean(nanmean(z_top_st(young,:,MI_trials),3)),cfg.chanlocs,'colormap',color,'style','map')
hc=colorbar;
caxis ([-z_v z_v])
xlabel(hc,'z-Score [\sigma]');
save_fig(gcf,[PATHOUT_ERD 'plots\'],['zERD_MI_young_' FB{fb}],'fontsize',30,'figsize',[0 0 f_s+5 f_s]);
%% ERD topo pre//post
......@@ -78,8 +146,6 @@ blck = [1 4 2 3];
b_t = {'PRE','MI 1','MI 2','POST'};
young = [1:16,34];
old = 17:33;
g_name = {'young','old'};
g_idx = {young,old};
......@@ -87,24 +153,25 @@ for g = 1:length(g_name)
figure
for b = 1:4
mERD = nanmean(nanmean(m_rERD_trial(g_idx{g},:,cfg.blck_idx{blck(b)}),3),1);
zERD = (mERD-mean(mERD))/std(mERD);
% mERD = nanmean(nanmean(m_rERD_trial(g_idx{g},:,cfg.blck_idx{blck(b)}),3),1);
zERD = nanmean(nanmean(z_top_st(g_idx{g},:,cfg.blck_idx{blck(b)}),3),1);
subplot(2,2,b)
topoplot(zERD,cfg.chanlocs,'style','map','colormap',color)
hc=colorbar;
xlabel(hc,'z-value');
xlabel(hc,'z-Score [\sigma]');
% caxis ([min(min(zERD)) max(max(zERD))])
title(b_t{blck(b)},'fontsize',12);
end
% sgtitle({'AVERAGE for ' g_name{g} ' // 8-30 Hz // "1":"End"'});
save_fig(gcf,[PATHOUT_ERD 'plots\'],['ROI_blck_' g_name{g} '_mue'],'fontsize',20);
save_fig(gcf,[PATHOUT_ERD 'plots\'],['ROI_blck_' g_name{g} '_' FB{fb}],'fontsize',20);
end
%% Decide on ROI
%{
cfg.chan.all = 1:64;
cfg.chan.ROI{1} = cfg.chan.all;
......@@ -132,14 +199,14 @@ end
save_fig(gcf,[PATHOUT_ERD 'plots\'],'ROI_select_mue','fontsize',12,'figsize',[0 0 35 25]);
%}
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ERD topoplot for juw_el_table // Individual plots
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for s = 1:size(m_rERD_trial,1)
for s = 1:size(m_rERD_trial,1)
blck = [1 2 3 4];
b_t = {'PRE','MI 1','MI 2','POST'};
......@@ -148,7 +215,7 @@ for s = 1:size(m_rERD_trial,1)
for b = 1:4
mERD = nanmean(nanmean(m_rERD_trial(s,:,cfg.blck_idx{blck(b)}),3),1);
zERD = (mERD-mean(mERD))/std(mERD);
zERD = zscore(mERD);
subplot(2,4,b)
topoplot(zERD,cfg.chanlocs,'colormap',color)
hc=colorbar;
......@@ -166,9 +233,9 @@ for s = 1:size(m_rERD_trial,1)
art_ep = squeeze(any(isnan(m_rERD_trial(s,:,:))));
subplot(2,4,[5 8])
a = gscatter(1:96,ep_chan_var,art_ep,'br','ox')
a = gscatter(1:96,ep_chan_var,double(art_ep),'br','ox')
set(a(1), 'MarkerFaceColor', 'b')
set(a(2), 'MarkerFaceColor', 'r')
if sum(art_ep)>0;set(a(2), 'MarkerFaceColor', 'r');end
xlim ([1 96])
xlabel 'Epochs'
ylabel 'Mean variance of channels'
......@@ -186,9 +253,10 @@ for s = 1:size(m_rERD_trial,1)
%}
sgtitle(['zscore ERD topoplots for SUBJ: ' ERD(s).ID{:}]);
save_fig(gcf,[PATHOUT_ERD 'plots\'],['Sanity_SUBJ_mue_' ERD(s).ID{:}],'fontsize',10);
save_fig(gcf,[PATHOUT_ERD 'plots\ind_data\'],['SUBJ_' FB{fb} '_' ERD(s).ID{:}],'fontsize',10);
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment