Skip to content

Commit

Permalink
channeltokeep
Browse files Browse the repository at this point in the history
  • Loading branch information
AyaKabbara committed Oct 12, 2022
1 parent 356b8f4 commit f6ccd5d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Note: The name of csv files should be changed accordingly.

### Reproducing Figure 2D,Figure 3D using FieldTrip

2. Run the analysis with [ftPreprocessing.m](src/fieldtrip/ftPreprocessing.m).
2. Run the analysis with [ftPreprocessing.m](src/fieldtrip/ftpreprocessing.m).
3. Create figures 2D,3D and generate the related values in tables 1,2 using the R script [RewardProcessing_Plots_and_Statistics.R](src/graphiques/RewardProcessing_Plots_and_Statistics.R).Note: the name of csv files should be changed accordingly.

### Reproducing Figure 4
Expand Down
Binary file added src/BST/channelsTokeep.mat
Binary file not shown.
23 changes: 21 additions & 2 deletions src/graphiques/Fig5.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 29 21:58:03 2022
@author: ayakabbara
"""
import scipy.io
import seaborn as sns
import matplotlib.pyplot as plt % matplotlib inline
import matplotlib.pyplot as plt

mat = scipy.io.loadmat('mat_dif.mat')
aa=mat.get("matt_corr_diff")
names_list=['Reference','EEEGLAB','Brainstorm','FieldTrip']
ax = sns.heatmap(aa,linewidths=.5,square=True,xticklabels=names_list,yticklabels=names_list)
fig = ax.get_figure()
fig.savefig("corrstudy_matrix.png",dpi=300)
fig.savefig("corrstudy_diff.png",dpi=300)

mat = scipy.io.loadmat('mat_cor.mat')
aa=mat.get("mat_cor")
names_list=['Reference','EEEGLAB','Brainstorm','FieldTrip']
ax = sns.heatmap(aa,linewidths=.5,square=True,xticklabels=names_list,yticklabels=names_list)
fig = ax.get_figure()
fig.savefig("corrstudy_gainloss.png",dpi=300)
12 changes: 7 additions & 5 deletions src/graphiques/similarity_calc.m
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
function [loss_corr, gain_corr, diff_corr]=similarity_calc(All_ERP11,All_ERP12)

nbchan=29;
nbsubjects=498;
nbsubjects=500;
gain_cor=[];
loss_cor=[];
diff_cor=[];
count=0;

for subject=1:nbsubjects
tt1=squeeze(All_ERP12(1,26,:,subject));
tt2=squeeze(All_ERP11(26,:,1,subject));
if(sum(tt1)*sum(tt2)>0)
count=count+1;
for chan=1:nbchan
cc=corrcoef(squeeze(All_ERP2(1,chan,:,subject)),squeeze(All_ERP1(chan,:,1,subject)));
gain_cor(chan,count+1)=cc(1,2);
gain_cor(chan,count)=cc(1,2);

cc=corrcoef(squeeze(All_ERP2(2,chan,:,subject)),squeeze(All_ERP1(chan,:,2,subject)));
loss_cor(chan,count+1)=cc(1,2);
loss_cor(chan,count)=cc(1,2);

cc=corrcoef(squeeze(All_ERP2(1,chan,:,subject))-squeeze(All_ERP2(2,chan,:,subject)),squeeze(All_ERP1(chan,:,1,subject))-squeeze(All_ERP1(chan,:,2,subject)));
diff_cor(chan,count+1)=cc(1,2);
diff_cor(chan,count)=cc(1,2);

end
end
Expand All @@ -30,4 +32,4 @@

loss_corr = loss_corr(~isnan(loss_corr));
diff_corr = diff_corr(~isnan(diff_corr));
gain_corr = gain_corr(~isnan(gain_corr));
gain_corr = gain_corr(~isnan(gain_corr));

0 comments on commit f6ccd5d

Please sign in to comment.