From f6ccd5dc5cb3f8963ef6af0b63c916cd193f0518 Mon Sep 17 00:00:00 2001 From: AyaKabbara Date: Wed, 12 Oct 2022 11:01:49 +0300 Subject: [PATCH] channeltokeep --- README.md | 2 +- src/BST/channelsTokeep.mat | Bin 0 -> 218 bytes src/graphiques/Fig5.py | 23 +++++++++++++++++++++-- src/graphiques/similarity_calc.m | 12 +++++++----- 4 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 src/BST/channelsTokeep.mat diff --git a/README.md b/README.md index 6cb1de3..c1b5dcb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/BST/channelsTokeep.mat b/src/BST/channelsTokeep.mat new file mode 100644 index 0000000000000000000000000000000000000000..8d78fd54558197873af8f92e4b5f36f5085569bc GIT binary patch literal 218 zcmeZu4DoSvQZUssQ1EpO(M`+DN!3vZ$Vn_o%P-2c0*X0%nwjV*I2WZRmZYXAaTNzs@7#SEDDG&=7V1UunmmkOu0^*7}kCPJ;JQ$M96rMF) zQaHf%^fa@fvdCw~jm2(BadBCGg&uWfSy_zC%)%kPo3^Z2(!^uFdn!YJ=e&u_mQLHZ YQ9-|b>!LN2W=!eowPj|QQ^GY302%B($N&HU literal 0 HcmV?d00001 diff --git a/src/graphiques/Fig5.py b/src/graphiques/Fig5.py index 890ba38..a9bbcd7 100644 --- a/src/graphiques/Fig5.py +++ b/src/graphiques/Fig5.py @@ -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) diff --git a/src/graphiques/similarity_calc.m b/src/graphiques/similarity_calc.m index 9ddd58e..8723351 100644 --- a/src/graphiques/similarity_calc.m +++ b/src/graphiques/similarity_calc.m @@ -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 @@ -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)); \ No newline at end of file +gain_corr = gain_corr(~isnan(gain_corr));