Explorar o código

gin commit from arc-osx-003861

New files: 201
Modified files: 113
lindedomingo hai 1 ano
pai
achega
ee3be252cd
Modificáronse 100 ficheiros con 3302 adicións e 0 borrados
  1. 191 0
      Figure_1_paneld.m
  2. 191 0
      Figure_2_and_stats.m
  3. 455 0
      Figure_3_and_stats.m
  4. 379 0
      Figure_4_panel_ab.m
  5. 275 0
      Figure_4_timeline.m
  6. BIN=BIN
      behavioural_modeling/behavdata/dat.mat
  7. BIN=BIN
      behavioural_modeling/behavdata/datperitem.mat
  8. BIN=BIN
      behavioural_modeling/behavdata/datperitemandtrial.mat
  9. 159 0
      behavioural_modeling/findAbehavAllConditions.m
  10. 307 0
      behavioural_modeling/findAbehavPerItem.m
  11. 337 0
      behavioural_modeling/findAbehavPerItemTrials.m
  12. 81 0
      behavioural_modeling/gridsearch_jld_trial.m
  13. 18 0
      behavioural_modeling/orivectors.m
  14. 10 0
      behavioural_modeling/quickplot.m
  15. 15 0
      behavioural_modeling/quickplot_onlybias.m
  16. 19 0
      behavioural_modeling/quickplotcompB.m
  17. 43 0
      behavioural_modeling/quickplotcompBerrors.m
  18. 24 0
      behavioural_modeling/rm_anova2/license.txt
  19. 145 0
      behavioural_modeling/rm_anova2/rm_anova2.m
  20. 5 0
      behavioural_modeling/sigmoid.m
  21. 68 0
      behavioural_modeling/squircleBehave2.m
  22. 68 0
      behavioural_modeling/squircleBehave2compB.m
  23. 68 0
      behavioural_modeling/squircleBehave2trials.m
  24. 71 0
      behavioural_modeling/squircleBehave3.m
  25. 94 0
      check_percentage_of_NaN_eyes_2022.m
  26. 191 0
      circle_figure.m
  27. 1 0
      circledata.mat
  28. 0 0
      data_eyelink/.Rhistory
  29. 5 0
      data_eyelink/README.md
  30. 16 0
      data_eyelink/converting_EDF_into_matlab_files.m
  31. 1 0
      data_eyelink/p04.edf
  32. 1 0
      data_eyelink/p04pr.edf
  33. 1 0
      data_eyelink/p05.edf
  34. 1 0
      data_eyelink/p05pr.edf
  35. 1 0
      data_eyelink/p06.edf
  36. 1 0
      data_eyelink/p06pr.edf
  37. 1 0
      data_eyelink/p07.edf
  38. 1 0
      data_eyelink/p07pr.edf
  39. 1 0
      data_eyelink/p08.edf
  40. 1 0
      data_eyelink/p08pr.edf
  41. 1 0
      data_eyelink/p09.edf
  42. BIN=BIN
      data_eyelink/p09pr.edf
  43. 1 0
      data_eyelink/p10.edf
  44. 1 0
      data_eyelink/p10pr.edf
  45. 1 0
      data_eyelink/p11.edf
  46. 1 0
      data_eyelink/p11pr.edf
  47. 1 0
      data_eyelink/p12.edf
  48. 1 0
      data_eyelink/p12pr.edf
  49. 1 0
      data_eyelink/p13.edf
  50. 1 0
      data_eyelink/p13pr.edf
  51. 1 0
      data_eyelink/p14.edf
  52. 1 0
      data_eyelink/p14pr.edf
  53. 1 0
      data_eyelink/p15.edf
  54. 1 0
      data_eyelink/p15pr.edf
  55. 1 0
      data_eyelink/p16.edf
  56. 1 0
      data_eyelink/p16pr.edf
  57. 1 0
      data_eyelink/p17.edf
  58. 1 0
      data_eyelink/p17pr.edf
  59. 1 0
      data_eyelink/p18.edf
  60. 1 0
      data_eyelink/p18pr.edf
  61. 1 0
      data_eyelink/p19.edf
  62. BIN=BIN
      data_eyelink/p19pr.edf
  63. 1 0
      data_eyelink/p20.edf
  64. 1 0
      data_eyelink/p20pr.edf
  65. 1 0
      data_eyelink/p21.edf
  66. 1 0
      data_eyelink/p21pr.edf
  67. 1 0
      data_eyelink/p22.edf
  68. 1 0
      data_eyelink/p22pr.edf
  69. 1 0
      data_eyelink/p23.edf
  70. 1 0
      data_eyelink/p23pr.edf
  71. 1 0
      data_eyelink/p24.edf
  72. 1 0
      data_eyelink/p24pr.edf
  73. 1 0
      data_eyelink/p25.edf
  74. 1 0
      data_eyelink/p25pr.edf
  75. 1 0
      data_eyelink/p26.edf
  76. 1 0
      data_eyelink/p26pr.edf
  77. 1 0
      data_eyelink/p27.edf
  78. 1 0
      data_eyelink/p27pr.edf
  79. 1 0
      data_eyelink/p28.edf
  80. BIN=BIN
      data_eyelink/p28pr.edf
  81. 1 0
      data_eyelink/p29.edf
  82. 1 0
      data_eyelink/p29pr.edf
  83. 1 0
      data_eyelink/p30.edf
  84. 1 0
      data_eyelink/p30pr.edf
  85. 1 0
      data_eyelink/p31.edf
  86. 1 0
      data_eyelink/p31pr.edf
  87. 1 0
      data_eyelink/p32.edf
  88. 1 0
      data_eyelink/p32pr.edf
  89. 1 0
      data_eyelink/p33.edf
  90. 1 0
      data_eyelink/p33pr.edf
  91. 1 0
      data_eyelink/p34.edf
  92. 1 0
      data_eyelink/p34pr.edf
  93. 1 0
      data_eyelink/p35.edf
  94. 1 0
      data_eyelink/p35pr.edf
  95. 1 0
      data_eyelink/p36.edf
  96. 1 0
      data_eyelink/p36pr.edf
  97. 1 0
      data_eyelink/p37.edf
  98. 1 0
      data_eyelink/p37pr.edf
  99. 1 0
      data_eyelink/p38a.edf
  100. 0 0
      data_eyelink/p38pr.edf

+ 191 - 0
Figure_1_paneld.m

@@ -0,0 +1,191 @@
+
+clear all;
+
+mainfolder='U:/'
+
+load('good_partis.mat') %list of participant with a good performance
+
+partis=good_partis';
+partis_sub=good_partis';
+
+%% 1st Panel
+
+figure;   
+
+oris=[11.25;33.75;56.25;78.75;101.25;123.75;146.25;168.75;191.25;213.75;236.25;258.75;281.25;303.75;326.25;348.75];
+
+colores=(colormap((hsv(16))));
+colores=[colores(13:16,:);colores(1:4,:);colores(5:8,:);colores(9:12,:);]
+
+rrr=ones(1,16)*1;
+for ooo=1:16
+polarplot(deg2rad(oris(ooo)),rrr(ooo),'wo','MarkerSize',18,'LineWidth',2,'MarkerFaceColor',colores(ooo,:));hold on,
+end
+
+rlim([0.5 1.1])
+oris1=[0 90 180 270]'
+ost=[num2str(oris1)]
+ost(:,4)='°'
+
+thetaticks(oris1)
+thetaticklabels(ost)
+
+ax=gca; 
+ax.ThetaGrid='on';
+ax.RGrid='off';
+ax.RTickLabel=[]; 
+
+set(gca,'FontSize',20);
+set(gca,'color','none');
+
+%% 2nd Panel
+
+%% Uncomment to run from scratch
+
+% %% Parameters to be modify per loop
+% 
+% tobefound{1} = 'find(data_epoch_thr.trialinfo.object_1_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue==1)';
+% tobefound{2} = 'find(data_epoch_thr.trialinfo.object_2_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue==2)';
+% tobefound{3} = 'find(data_epoch_thr.trialinfo.object_2_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue==2)';
+% tobefound{4} = 'find(data_epoch_thr.trialinfo.object_1_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue_uncued==1)';
+% 
+% %%
+% foldlo{1}='eyelink_preprocessed/mean_recentered_th100/object_1_onset_11_seconds/';
+% foldlo{2}='eyelink_preprocessed/mean_recentered_th100/object_1_onset_11_seconds/';
+% foldlo{3}='eyelink_preprocessed/mean_recentered_th100/object_1_onset_11_seconds/';
+% foldlo{4}='eyelink_preprocessed/mean_recentered_th100/2nd_cue_onset_17_5__seconds/';
+% 
+% %%
+% item_id_rsa{1}=nan(length(partis),16,3,5501);
+% item_id_rsa{2}=nan(length(partis),16,3,5501);
+% item_id_rsa{3}=nan(length(partis),16,3,5501);
+% item_id_rsa{4}=nan(length(partis),16,3,8751);
+% %%
+% for fff=1:4
+%     
+%     for ppp=1:length(partis)
+%         
+%         %% Loading dataset
+%         toload =[mainfolder foldlo{fff} partis{ppp,:} '.mat'];
+%         load(toload)
+%         
+%         %Loading logfiles
+%         
+%         subtable=[];
+%         
+%         if strcmp(partis_sub{ppp,:},'p11')
+%             load([mainfolder 'logfiles/resultfile_p11_table_repaired.mat'])
+%             subtable=sub
+%         else
+%             
+%             sub = tdfread([mainfolder 'logfiles/resultfile_' partis_sub{ppp,:} '.txt'],'tab'); %Logfile for this participant
+%             subtable=struct2table(sub);
+%         end
+%         
+%         
+%         
+%         %% Selecting trials per rot only (not ID)
+%         
+%         objlistid=unique(data_epoch_thr.trialinfo.object_1_id);
+%         counter=1;
+%         
+%         objlist=unique(data_epoch_thr.trialinfo.object_1_rot);
+%         
+%         for k =1:length(objlist)
+%             
+%             triales = eval(tobefound{fff});
+%             [t_s_ave{counter}] = squeeze(nanmean(data_epoch_thr.eyedat(triales,:,:),1));
+%             counter=counter+1;
+%             
+%         end
+%         
+%         %% Substracting the mean  per condition (not in this case)
+%               
+%         for k = 1:length(t_s_ave);
+%             
+%             if ~isempty(t_s_ave{k})
+%                 
+%                 rr=(t_s_ave{k});
+%                 item_id_rsa{fff}(ppp,k,:,:)=[rr];
+%                 
+%             elseif isnan(t_s_ave{k})
+%                 item_id_rsa{fff}(ppp,k,1:3,1:size(data_epoch_thr.eyedat,3))=NaN;
+%             end
+%         end
+%         
+%         time{fff}=data_epoch_thr.time;
+%         
+%         %%
+%         
+%     end
+%     
+% end
+% %%
+% 
+% save('circledata.mat','objlist','item_id_rsa', 'time')
+
+%% Load results
+
+load('circledata.mat')
+
+%% Plots
+
+IDs = {'1',' ',' ','4','5',' ',' ','8','9',' ',' ','12','13',' ',' ','16'}
+
+colores=(colormap(flip(hsv(16))));
+
+toi{1} = [400 1000];
+toi{2} = [1400 2000];
+toi{3} = [5350 5850];
+toi{4} = [2350 2850];
+
+titu={'stimulus 1';'stimulus 2';'delay 1';'delay 2';}
+
+figure
+
+for fff=1:4
+    
+    subplot(1,4,fff)
+    
+    ave_item_id_rsa=squeeze(nanmedian(item_id_rsa{fff},1));
+    std_item_id_rsa=squeeze(std(item_id_rsa{fff},1,1));
+    avg_std_item_id_rsa=squeeze(nanmean(std_item_id_rsa(:,1:2,:),2));
+     
+    t1=find(time{1}==toi{fff}(1));
+    t2=find(time{1}==toi{fff}(2));
+    
+    for ppp=1:size(item_id_rsa{fff},1)
+        
+        x=squeeze(mean(item_id_rsa{fff}(ppp,:,1,t1:t2),4));
+        y=squeeze(mean(item_id_rsa{fff}(ppp,:,2,t1:t2).*-1,4));
+        
+        sct=scatter(x,y,60,colores,'filled','MarkerFaceAlpha',.25);hold on;
+        
+    end
+    
+    x=mean(ave_item_id_rsa(:,1,t1:t2),3);
+    y=mean(ave_item_id_rsa(:,2,t1:t2).*-1,3);
+    z=(mean(avg_std_item_id_rsa(:,t1:t2),2)/40)*250;
+    
+    sct=scatter(x,y,z,colores,'filled','MarkerEdgeColor',[1 1 1],...
+        'LineWidth',1.5)
+
+    set(gca,'Color','k')
+   
+    ao=0.8/0.0217;
+    xlim([-ao ao])
+    ylim([-ao ao])
+    
+    pixtovd=0.0217; %pixel to visual degrees
+    
+    set(gca,'XTick',-ao:(ao/2):ao)
+    set(gca,'XTickLabel',(-ao:(ao/2):ao)*pixtovd)
+    set(gca,'YTick',-ao:(ao/2):ao)
+    set(gca,'YTickLabel',(-ao:(ao/2):ao)*pixtovd)
+      
+    title(titu{fff})
+    % ylabel('° vis. angle')
+    xlabel('° vis. angle')   
+    set(gca,'FontSize',20);    
+    
+end

+ 191 - 0
Figure_2_and_stats.m

@@ -0,0 +1,191 @@
+clear all
+
+   mainfolder='';
+
+addpath(genpath([mainfolder, 'subfunctions/']))
+addpath(genpath(['subfunctions/rm_anova2']))
+
+%% Uncomment to load the RSA data and perform the cluster perm
+
+
+% folder{1}=[mainfolder,'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_1_cued_Pearson/']
+% folder{2}=[mainfolder,'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_1_uncued_Pearson/']
+% folder{3}=[mainfolder,'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_2_cued_Pearson/']
+% folder{4}=[mainfolder,'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_2_uncued_Pearson/']
+% 
+% load([mainfolder, 'good_partis.mat']) %list of participant with a good performance
+% partis=good_partis';
+% 
+% 
+% for fff=1:size(folder,2)
+%     
+%     counter=1;
+%     RHO_id=[];
+%     
+%     for ppp=1:length(partis)
+%         
+%         toload=[folder{fff}, partis{ppp,:},'.mat']
+%         load(toload)
+%         RHO_id(:,counter)=nanmean(RSA_obj_rot.rho,1);
+%         counter=counter+1;
+%         
+%     end
+%     RHO_all{fff}=RHO_id
+% end
+% 
+% time=RSA_obj_rot.time;
+% 
+% 
+% %% Cluster analysis for each line
+% 
+% pv_cluster=0.0125; % p-vals for clust perm test
+% az=zeros(size(RHO_all{1})); % matrix to be compare (in this case against 0);
+% 
+% timesignclust=allclustperm(RHO_all,time,az,pv_cluster) % output variable (rows -> lines; columns -> start and end (ms))
+% 
+% mean([timesignclust(1,1) timesignclust(2,1) timesignclust(3,1)-1000 timesignclust(4,1)-1000]) %average of "starting" point;
+% 
+% 
+% %% Detecting peaks during encoding
+% 
+% maxstim1cue=maxintime(RHO_all{1},time,0,1000)
+% maxstim1uncue=maxintime(RHO_all{2},time,0,1000)
+% maxstim2cue=maxintime(RHO_all{3},time,1000,2000)-1000
+% maxstim2uncue=maxintime(RHO_all{4},time,1000,2000)-1000
+% 
+% mean([maxstim1cue maxstim1uncue maxstim2cue maxstim2uncue]) %returning average from all 4 lines
+
+%% Optional -> Loading the data ready to be plotted
+
+load('data_for_plots/Figure_2/delay1_data_n41_2022.mat');
+
+%% And plot
+
+colores1=(colormap(flip(autumn(7))));
+colores2=(colormap(flip(summer(7))));
+colores=[colores2(7,:);colores1(7,:);colores2(5,:);colores1(4,:)];
+
+figure('Position',([200 900 760 360])) %alt ([200 900 860 360]))
+leng1='cued 1st'
+leng2='uncued'
+leng3='cued 1st'
+leng4='uncued'
+titu=[];%'RSA - Correlation with continuos model - single trial'
+xl=[-500 5850];
+yl=[-0.05 0.17];
+aga=0;
+pval=0.01
+spa=-0.004
+data=[];
+data{1}=RHO_all{1};
+data{2}=RHO_all{2};
+data{3}=RHO_all{3};
+data{4}=RHO_all{4};
+
+% plot4lines_fdr(time,data,colores,xl,yl,leng1,leng2,leng3,leng4,titu,aga,pval,spa,1)
+plot4lines(time,data,colores,xl,yl,leng1,leng2,leng3,leng4,titu,1,1,1,timesignclust,colores)
+
+% fill([2000 2350 2000 2350],[20 20 0 0],'k','LineStyle','none','FaceAlpha',0.20);
+
+ set(gca,'FontSize',22);
+ 
+ %% 2nd delay
+
+clear all
+
+%% Uncomment to load the RSA data and perform the cluster perm
+
+% 
+% folder{1}=[mainfolder,'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_1_cued_Pearson/']
+% folder{2}=[mainfolder,'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_1_uncued_Pearson/']
+% folder{3}=[mainfolder,'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_2_cued_Pearson/']
+% folder{4}=[mainfolder,'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_2_uncued_Pearson/']
+% 
+% load([mainfolder, 'good_partis.mat']) %list of participant with a good performance
+% partis=good_partis';
+% 
+% for fff=1:size(folder,2)
+%     
+%     counter=1;
+%     RHO_id=[];
+%     
+%     for ppp=1:length(partis)
+%         
+%         toload=[folder{fff}, partis{ppp,:},'.mat']
+%         load(toload)
+%         RHO_id(:,counter)=nanmean(RSA_obj_rot.rho,1);
+%         counter=counter+1;
+%         
+%     end
+%     RHO_all{fff}=RHO_id
+% end
+% 
+% time=RSA_obj_rot.time;
+% 
+% %% Cluster analysis for each line
+% 
+% pv_cluster=0.0125; % p-vals for clust perm test
+% az=zeros(size(RHO_all{1})); % matrix to be compare (in this case against 0);
+% 
+% timesignclust=allclustperm(RHO_all,time,az,pv_cluster) % output variable (rows -> lines; columns -> start and end (ms))
+% 
+% % mean([timesignclust(1,1) timesignclust(2,1) timesignclust(3,1)-1000 timesignclust(4,1)-1000]) %average of "starting" point;
+
+
+%% And plot
+
+%% Optional -> Loading the data ready to be plotted
+
+load('data_for_plots/Figure_2/delay2_data_n41_2022.mat');
+
+%% mode 6
+colores1=(colormap(flip(autumn(7))));
+colores2=(colormap(flip(summer(7))));
+colores=[colores2(7,:);colores1(7,:);colores2(5,:);colores1(4,:)];
+
+figure('Position',([200 900 420 360])) % alt. [200 900 440 360]
+leng1='cued 1st'
+leng2='cued 2nd'
+leng3='cued 1st'
+leng4='cued 2nd'
+titu=[];%'RSA - Correlation with continuos model - single trial'
+xl=[-300 2850];
+yl=[-0.05 0.17];
+aga=0;
+pval=0.01
+spa=-0.004
+data=[];
+data{1}=RHO_all{1};
+data{2}=RHO_all{2};
+data{3}=RHO_all{3};
+data{4}=RHO_all{4};
+
+% plot4lines_fdr_2nd_2(time,data,colores,xl,yl,leng1,leng2,leng3,leng4,titu,aga,pval,spa,1)
+plot4lines_2nd(time,data,colores,xl,yl,leng1,leng2,leng3,leng4,titu,1,1,1,timesignclust,colores)
+
+ set(gca,'FontSize',22);
+ 
+
+%% Subfunctions
+
+%Times for encoding of stimulus 1
+function output = maxintime(data,time,toi1,toi2)
+t1=find(time==toi1);
+t2=find(time==toi2);
+time2=time(t1:t2);
+[B I]=sort(mean(data(t1:t2,:),2),'descend');
+output=time2(I(1));
+end
+
+function timesignclust=allclustperm(RHO_all,time,az,pv_cluster)
+timesignclust=nan(4,2); % output variable (rows -> lines; columns -> start and end (ms))
+for r=1:4;      
+    [clusters, p_values, t_sums, permutation_distribution] =permutest(RHO_all{r},az,1,0.05,5000)
+    if p_values(1)<pv_cluster
+        
+        timesignclust(r,1)=time(clusters{1}(1))
+        timesignclust(r,2)=time(clusters{1}(end))
+        
+    end
+end
+end

+ 455 - 0
Figure_3_and_stats.m

@@ -0,0 +1,455 @@
+clear all
+
+   mainfolder='';
+
+addpath(genpath([mainfolder 'subfunctions/']))
+addpath(genpath('subfunctions/rm_anova2'))
+
+%% Uncomment to load the RSA data and perform the cluster perm
+
+% folder{1}=[mainfolder, 'results/mean_recentered_th100/euclideanmodels/single_trial_with_between_RSA_object_1_cued_cont_Pearson/']
+% folder{2}=[mainfolder, 'results/mean_recentered_th100/euclideanmodels/single_trial_with_between_RSA_object_1_uncued_cont_Pearson/']
+% folder{3}=[mainfolder, 'eyedata/results/mean_recentered_th100/euclideanmodels/single_trial_with_between_RSA_object_2_cued_cont_Pearson/']
+% folder{4}=[mainfolder, 'eyedata/results/mean_recentered_th100/euclideanmodels/single_trial_with_between_RSA_object_2_uncued_cont_Pearson/']
+% 
+% % %2nd cue
+% 
+% folder2{1}=[mainfolder, 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_with_between_RSA_object_1_cued_cont_Pearson/']
+% folder2{2}=[mainfolder, 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_with_between_RSA_object_1_uncued_cont_Pearson/']
+% folder2{3}=[mainfolder, 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_with_between_RSA_object_2_cued_cont_Pearson/']
+% folder2{4}=[mainfolder, 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_with_between_RSA_object_2_uncued_cont_Pearson/']
+% 
+% load([mainfolder, 'good_partis.mat']) %list of participant with a good performance
+% % 
+%  partis=good_partis'
+% 
+% %% Loading with the script
+% [RHO_id_group_1, time_1]=loadwithbet(folder, partis)
+% [RHO_id_group_2, time_2]=loadwithbet(folder2, partis)
+% 
+% %% Ordering variables
+% 
+% a1_1=[];
+% a2_1=[];
+% a3_1=[];
+% 
+% a1_1{1}=RHO_id_group_1{1};
+% a1_1{2}=RHO_id_group_1{2};
+% a1_1{3}=RHO_id_group_1{4};
+% a1_1{4}=RHO_id_group_1{5};
+% 
+% a2_1{1}=RHO_id_group_1{7};
+% a2_1{2}=RHO_id_group_1{8};
+% a2_1{3}=RHO_id_group_1{10};
+% a2_1{4}=RHO_id_group_1{11};
+% 
+% a3_1{1}=RHO_id_group_1{3};
+% a3_1{2}=RHO_id_group_1{6};
+% a3_1{3}=RHO_id_group_1{9};
+% a3_1{4}=RHO_id_group_1{12};
+% 
+% a1_2=[];
+% a2_2=[];
+% a3_2=[];
+% 
+% a1_2{1}=RHO_id_group_2{1};
+% a1_2{2}=RHO_id_group_2{2};
+% a1_2{3}=RHO_id_group_2{4};
+% a1_2{4}=RHO_id_group_2{5};
+% 
+% a2_2{1}=RHO_id_group_2{7};
+% a2_2{2}=RHO_id_group_2{8};
+% a2_2{3}=RHO_id_group_2{10};
+% a2_2{4}=RHO_id_group_2{11};
+% 
+% a3_2{1}=RHO_id_group_2{3};
+% a3_2{2}=RHO_id_group_2{6};
+% a3_2{3}=RHO_id_group_2{9};
+% a3_2{4}=RHO_id_group_2{12};
+% 
+% %% Cluster analysis of the difference within-between (delay 1)
+% 
+% %Setting times (from -100 stim onset until the end of the delay period)
+% t1=find(time_1==-100)
+% t2=find(time_1==5850)
+% t1_2=find(time_1==900)
+% [timesignclust cluspval] = cluster_dif(a1_1,a2_1,time_1,t1,t2,t1_2)
+% 
+% % mean([timesignclust(1,1) timesignclust(2,1)]) %average of "starting" points;
+% 
+% % Creating 2 variables to use it for the plots and respect the colours
+% timesignclust_1 = nan(4,2);
+% timesignclust_2 = nan(4,2);
+% timesignclust_1([1 3],:)=timesignclust([1 3],:);
+% timesignclust_2([1 3],:)=timesignclust([2 4],:);
+% 
+% %% Cluster analysis of the difference within-between (delay 2)
+% 
+% %Setting times (from -100 stim onset until the end of the delay period)
+% t1=find(time_2==-100);
+% t2=find(time_2==2850);
+% t1_2=find(time_2==-100);
+% [timesignclust2 cluspva2] = cluster_dif(a1_2,a2_2,time_2,t1,t2,t1_2)
+% 
+% % mean([timesignclust(1,1) timesignclust(2,1)]) %average of "starting" point;
+% 
+% % Creating 2 variables to use it for the plots and respect the colours
+% timesignclust_1_2 = nan(4,2);
+% timesignclust_2_2 = nan(4,2);
+% timesignclust_1_2([1 3],:)=timesignclust2([1 3],:);
+% timesignclust_2_2([1 3],:)=timesignclust2([2 4],:);
+
+%% Optional -> Loading the data ready to be plotted
+
+load('data_for_plots/Figure_3/data_n41_2022.mat');
+
+%% And plot
+
+%Preparing colors
+colores1=(colormap((winter(4))));
+colores2=(colormap((cool(4))));
+colores=[colores2(4,:);colores2(3,:);colores1(4,:);colores1(3,:)];
+
+colores3=(colormap((winter(8))));
+colores4=(colormap((cool(8))));
+coloresclus=[colores4(7,:);colores4(7,:);colores3(7,:);colores3(7,:)];
+
+figure('Position',([200 800 750 700]))
+subplot(2,1,1)
+
+leng1='cued within'
+leng2='cued between'
+leng3='uncued within'
+leng4='uncued between'
+titu=''
+xl=[-500 5850];
+yl=[-0.05 0.17];
+plot4lines_errorback(time_1,a1_1,colores,xl,yl,leng1,leng2,leng3,leng4,titu,1,0,1,timesignclust_1,coloresclus)
+set(gca,'FontSize',22);
+
+subplot(2,1,2)
+
+titu=''
+plot4lines_errorback(time_1,a2_1,colores,xl,yl,leng1,leng2,leng3,leng4,titu,1,0,1,timesignclust_2,coloresclus)
+set(gca,'FontSize',22);
+ 
+ 
+ %% Plotting the 2nd delay
+
+figure('Position',([200 800 420 700]))
+
+subplot(2,1,1)
+
+leng1='cued 1st within'
+leng2='cued 1st between'
+leng3='cued 2nd within'
+leng4='cued 2nd between'
+titu=''
+xl=[-300 2850];
+yl=[-0.05 0.17];
+plot4lines_2nd_errorback(time_2,a1_2,colores,xl,yl,leng1,leng2,leng3,leng4,titu,1,0,1,timesignclust_1_2,coloresclus)
+set(gca,'FontSize',22);
+
+subplot(2,1,2)
+
+titu=''
+
+plot4lines_2nd_errorback(time_2,a2_2,colores,xl,yl,leng1,leng2,leng3,leng4,titu,1,0,1,timesignclust_2_2,coloresclus)
+set(gca,'FontSize',22);
+
+
+%% STATS ANOVA
+% Encoding
+
+ toi1ori1 = [0 1000];%time of interest for ori 1
+ toi1ori2 = [1000 2000];%time of interest for ori 1
+
+% toi1 = [0 500];%time of interest for ori 1
+
+t1_1=find(time_1==toi1ori1(1));
+t2_1=find(time_1==toi1ori1(2));
+
+t1_1ori2=find(time_1==toi1ori2(1));
+t2_1ori2=find(time_1==toi1ori2(2));
+
+%ori1 cued
+av_a1cued1 =nanmean(a1_1{1}(t1_1:t2_1,:),1); %  with 1
+av_a1cued2 =nanmean(a1_1{2}(t1_1:t2_1,:),1); %  bet 1
+
+%ori2 cued
+av_a2cued1 =nanmean(a2_1{1}(t1_1ori2:t2_1ori2,:),1); %  w 2
+av_a2cued2 =nanmean(a2_1{2}(t1_1ori2:t2_1ori2,:),1); %  betwen 2
+
+% addpath(genpath(['/rm_anova2']))
+
+aa= cat(1,av_a1cued1,av_a1cued2,av_a2cued1,av_a2cued2)'
+p=size(av_a1cued1,2);
+
+S=[1:p,1:p,1:p,1:p];
+F1=[ones(p,1);ones(p,1)*2;ones(p,1);ones(p,1)*2]'
+F2=[ones(p*2,1);ones(p*2,1)*2]'
+FACTNAMES={'between-within', 'item order'}
+
+stats = rm_anova2(aa,S,F1,F2,FACTNAMES)
+
+totalSS=sum([stats{2,2},stats{3,2},stats{4,2},stats{5,2},stats{6,2},stats{7,2}]);
+etaS=[stats{2,2}/totalSS,stats{3,2}/totalSS,stats{4,2}/totalSS]
+
+%% STATS ANOVA
+% 1st delay
+
+  toi1 = [2350 5850];%time of interest for ori 1
+% toi1 = [0 500];%time of interest for ori 1
+%    toi1 = [3350 5850];%time of interest for delay 1 1s_after_cueonset
+
+
+t1_1=find(time_1==toi1(1));
+t2_1=find(time_1==toi1(2));
+
+%ori1 cued
+av_a1cued1 =nanmean(a1_1{1}(t1_1:t2_1,:),1); %  with 1
+av_a1cued2 =nanmean(a1_1{2}(t1_1:t2_1,:),1); %  bet 1
+
+%ori2 cued
+av_a2cued1 =nanmean(a2_1{1}(t1_1:t2_1,:),1); %  w 2
+av_a2cued2 =nanmean(a2_1{2}(t1_1:t2_1,:),1); %  betwen 2
+
+addpath(genpath(['/rm_anova2']))
+
+aa= cat(1,av_a1cued1,av_a1cued2,av_a2cued1,av_a2cued2)'
+p=size(av_a1cued1,2);
+
+S=[1:p,1:p,1:p,1:p];
+F1=[ones(p,1);ones(p,1)*2;ones(p,1);ones(p,1)*2]'
+F2=[ones(p*2,1);ones(p*2,1)*2]'
+FACTNAMES={'between-within', 'item order'}
+
+stats = rm_anova2(aa,S,F1,F2,FACTNAMES)
+
+totalSS=sum([stats{2,2},stats{3,2},stats{4,2},stats{5,2},stats{6,2},stats{7,2}]);
+etaS=[stats{2,2}/totalSS,stats{3,2}/totalSS,stats{4,2}/totalSS]
+
+%% T-test (delay1)
+
+[h,p,ci,stats]= ttest(av_a2cued1,av_a2cued2) % stim 2 cued - withing vs between
+[h,p,ci,stats]= ttest(av_a1cued1,av_a1cued2) % stim 2 cued - withing vs between
+
+
+%% 2nd delay
+
+% toi12 = [350 2850];%time of interest for ori 1
+  toil2 = [1350 2850];%time of interest for delay 1 1s_after_cueonset
+
+
+t1_2=find(time_2==toi12(1));
+t2_2=find(time_2==toi12(2));
+
+%ori1 cued
+av_a1cued1 =nanmean(a1_2{3}(t1_2:t2_2,:),1); %  with 1
+av_a1cued2 =nanmean(a1_2{4}(t1_2:t2_2,:),1); %  bet 1
+
+%ori2 cued
+av_a2cued1 =nanmean(a2_2{3}(t1_2:t2_2,:),1); %  w 2
+av_a2cued2 =nanmean(a2_2{4}(t1_2:t2_2,:),1); %  betwen 2
+
+addpath(genpath(['/rm_anova2']))
+
+aa= cat(1,av_a1cued1,av_a1cued2,av_a2cued1,av_a2cued2)'
+p=size(av_a1cued1,2);
+
+S=[1:p,1:p,1:p,1:p];
+F1=[ones(p,1);ones(p,1)*2;ones(p,1);ones(p,1)*2]'
+F2=[ones(p*2,1);ones(p*2,1)*2]'
+FACTNAMES={'between-within', 'item order'}
+
+stats = rm_anova2(aa,S,F1,F2,FACTNAMES)
+
+%%
+%% T-test (delay2)
+
+[h,p,ci,stats]= ttest(av_a2cued1,av_a2cued2) % stim 2 cued - withing vs between
+[h,p,ci,stats]= ttest(av_a1cued1,av_a1cued2) % stim 1 cued - withing vs between
+
+%% On the DIF
+
+toi11 = [2350 5850];%time of interest for delay 1 1s_after_cueonset
+    
+t1_1=find(time_1==toi11(1));
+t2_1=find(time_1==toi11(2));
+
+toil2 = [350 2850];%time of interest for delay 1 1s_after_cueonset
+  
+t1_2=find(time_2==toil2(1));
+t2_2=find(time_2==toil2(2));
+
+av_a1cued1=nanmean(a1_1{1}(t1_1:t2_1,:),1)-nanmean(a1_1{2}(t1_1:t2_1,:),1); %dif item 1, cue 1 b-w 1st delay
+av_a2cued1=nanmean(a2_1{1}(t1_1:t2_1,:),1)-nanmean(a2_1{2}(t1_1:t2_1,:),1); %dif item 2, cue 1 b-w 1st delay
+
+av_a1cued2=nanmean(a1_2{3}(t1_2:t2_2,:),1)-nanmean(a1_2{4}(t1_2:t2_2,:),1); %dif item 1, cue 1 b-w 1st delay
+av_a2cued2=nanmean(a2_2{3}(t1_2:t2_2,:),1)-nanmean(a2_2{4}(t1_2:t2_2,:),1); %dif item 2, cue 1 b-w 1st delay
+
+aa= cat(1,av_a1cued1,av_a1cued2,av_a2cued1,av_a2cued2)'
+p=size(av_a1cued1,2);
+
+S=[1:p,1:p,1:p,1:p];
+F1=[ones(p,1);ones(p,1)*2;ones(p,1);ones(p,1)*2]'
+F2=[ones(p*2,1);ones(p*2,1)*2]'
+FACTNAMES={'delay 1st or 2nd', 'item order'}
+
+stats = rm_anova2(aa,S,F1,F2,FACTNAMES)
+
+totalSS=sum([stats{2,2},stats{3,2},stats{4,2},stats{5,2},stats{6,2},stats{7,2}]);
+etaS=[stats{2,2}/totalSS,stats{3,2}/totalSS,stats{4,2}/totalSS]
+
+%%
+eye.all{1}(:,1)=av_a1cued1
+eye.all{1}(:,2)=av_a2cued1
+eye.all{1}(:,3)=av_a1cued2
+eye.all{1}(:,4)=av_a2cued2
+
+
+%% eye plot
+
+labels={'stim 1/delay 1','stim 2/delay 1','stim 1/delay 2','stim 2/delay 2'};
+
+figure
+barplotbias(eye.all{1},[-.075,.2],' ','diff within - between',labels)
+
+%% Linear trend regarding distance
+
+%from closest to longest disntace
+
+distances(:,1)=av_a2cued1 %stim 2 cued 1st
+distances(:,2)=av_a1cued1 %stim 1 cued 1st
+distances(:,3)=av_a2cued2 %stim 2 cued 2nd
+distances(:,4)=av_a1cued2 %stim 1 cued 2nd
+
+
+%% Check linear trend
+
+ball=[];
+yfit=[];
+for ppp = 1:size(distances,1)   
+    
+    tof=[];
+    for c=1:size(distances,2);
+    tof=[tof; distances(ppp,c)];    
+    end
+    
+    [b,dev,stats] = glmfit(1:size(distances,2),tof,'normal');
+     yfit(ppp,:) = polyval([b(2,1),b(1,1)],[1,2,3,4]);
+
+    
+    ball(ppp) = b(2);
+end
+
+
+[h,p,ci,stats] = ttest(ball,0)
+[p,h,stats] = signrank(ball,0)
+
+
+    %%
+    all{1}= distances
+    
+    labels={'Stim 2','Stim 1','Stim 2','Stim 1'};
+
+figure
+
+plot(yfit','Color',[0 0 0 0.25],'LineWidth',1);hold on;
+
+plot(mean(yfit,1)','Color',[0 0 0],'LineWidth',4);hold on;
+barplotbias(all{1},[-.07,.19],' ','\Delta (rho) within - between',labels)
+
+
+%% subfuctions
+
+function barplotbias(data,yl,tito,yla,labels)
+
+ax=notBoxPlot(data,'style','sdline')
+
+line([0,5], [0,0], 'Color', 'k','LineStyle',':','LineWidth',2);hold on;
+line([2.5,2.5], [-10,10], 'Color', 'k','LineStyle','--','LineWidth',2);hold on;
+
+
+for i=1:4
+    ax(i).semPtch.FaceColor = [0.75 0.75 0.75];
+    ax(i).semPtch.EdgeColor = [0.75 0.75 0.75];
+%     ax(i).semPtch.LineWidth = 10;
+    ax(i).mu.LineWidth = 5;
+
+    ax(i).data.MarkerSize = 8;
+    ax(i).mu.Color = [0 0 0];
+    ax(i).sd.Color = [0 0 0];
+end
+
+xticks([1:4])
+xticklabels(labels)
+% xtickangle(45)
+ylim(yl)
+ylabel(yla)
+xlim([0.5 4.5])
+
+sublabels{1}='Delay 1'
+sublabels{2}='Delay 2'
+xpos=0.15
+
+text(1.5,xpos,sublabels{1},'HorizontalAlignment','center','FontSize',25,'FontWeight','bold')
+text(3.5,xpos,sublabels{2},'HorizontalAlignment','center','FontSize',25,'FontWeight','bold')
+
+set(gca,'FontSize',25);
+
+title(tito)
+
+end
+
+function [timesignclust cluspv]=allclustperm2(RHO_all,time,az,pv_cluster)
+timesignclust=nan(size(RHO_all,2),2); % output variable (rows -> lines; columns -> start and end (ms))
+for r=1:size(RHO_all,2);      
+    [clusters, p_values, t_sums, permutation_distribution] =permutest(RHO_all{r},az{r},1,0.05,20000)
+    if p_values(1)<pv_cluster
+        
+        timesignclust(r,1)=time{r}(clusters{1}(1))
+        timesignclust(r,2)=time{r}(clusters{1}(end))
+        
+    end
+    
+    cluspv(r)=p_values(1);
+end
+end
+
+function [timesignclust cluspv] = cluster_dif(a1_1,a2_1,time_1,t1,t2,t1_2)
+
+%ori1 cued
+wi1 =a1_1{1}(t1:t2,:); %  with 1
+bet1 =a1_1{2}(t1:t2,:); %  bet 1
+%ori1 uncued
+wi1u =a1_1{3}(t1:t2,:); %  with 1
+bet1u =a1_1{4}(t1:t2,:); %  bet 1
+%ori2 cued
+wi2 =a2_1{1}(t1_2:t2,:); %  w 2
+bet2 =a2_1{2}(t1_2:t2,:); %  betwen 2
+%ori2 uncued
+wi2u =a2_1{3}(t1_2:t2,:); %  w 2
+bet2u =a2_1{4}(t1_2:t2,:); %  betwen 2
+
+RHOD_wi{1}=wi1();
+RHOD_wi{2}=wi2();
+RHOD_wi{3}=wi1u();
+RHOD_wi{4}=wi2u();
+
+RHOD_be{1}=bet1();
+RHOD_be{2}=bet2();
+RHOD_be{3}=bet1u();
+RHOD_be{4}=bet2u();
+
+pv_cluster=0.0125; % p-vals for clust perm test
+% az=zeros(size(RHOD_diff{1})); % matrix to be compare (in this case against 0);
+
+timesall{1}=time_1(t1:t2);
+timesall{2}=time_1(t1_2:t2);
+timesall{3}=time_1(t1:t2);
+timesall{4}=time_1(t1_2:t2);
+
+[timesignclust cluspv]=allclustperm2(RHOD_wi,timesall,RHOD_be,pv_cluster) % output variable (rows -> lines; columns -> start and end (ms))
+
+end

+ 379 - 0
Figure_4_panel_ab.m

@@ -0,0 +1,379 @@
+clear all
+
+mainfolder='';
+
+addpath(genpath([mainfolder 'subfunctions/']))
+addpath(genpath('subfunctions/rm_anova2'))
+
+%% Panel 1
+
+clear all
+
+%data for polarplots
+
+[oriC, oriP, oriN]=orivectors(16,6.43);
+
+theta1=oriC
+theta=[0 0 pi/2 pi/2 pi/2 pi/2 pi pi pi pi pi*1.5 pi*1.5 pi*1.5 pi*1.5 0 0];
+uno=ones(1,16)
+thetaall{1}=[theta theta(1)];
+uno=[uno uno(1)];
+
+theta1=oriC
+theta2=[0 0 0 0 pi/2 pi/2 pi/2 pi/2 pi pi pi pi pi*1.5 pi*1.5 pi*1.5 pi*1.5]-pi/4
+theta3=[theta1;theta2]
+theta=mean(theta3)
+uno=ones(1,16)
+thetaall{2}=[theta theta(1)];
+uno=[uno uno(1)];
+
+theta=oriC
+uno=ones(1,16)
+thetaall{3}=[theta theta(1)];
+uno=[uno uno(1)];
+
+theta1=oriC
+theta2=[0 0 0 0 pi/2 pi/2 pi/2 pi/2 pi pi pi pi pi*1.5 pi*1.5 pi*1.5 pi*1.5]+pi/4
+theta3=[theta1;theta2]
+theta=mean(theta3)
+uno=ones(1,16)
+thetaall{4}=[theta theta(1)];
+
+theta=[0 0 0 0 pi/2 pi/2 pi/2 pi/2 pi pi pi pi pi*1.5 pi*1.5 pi*1.5 pi*1.5]+pi/4
+uno=ones(1,16)
+thetaall{5}=[theta theta(1)];
+uno=[uno uno(1)];
+
+A=0.2
+thetaall{4}=A.*thetaall{5}+(1-A)*thetaall{3};
+
+A=1
+thetaall{5}=A.*thetaall{5}+(1-A)*thetaall{3};
+
+a{1}=creatcatcardeucl;
+a{3}=creatcontmodel(1);
+a{5}=creatcatcardeucl45;
+
+A=0.5;
+
+a{2}=A*a{1}+(1-A)*a{3}
+a{4}=A*a{5}+(1-A)*a{3}
+
+% Plotting
+
+figure;
+
+subplot(2,5,1);
+polarmodelplot(thetaall{1},uno)
+
+subplot(2,5,2);
+polarmodelplot(thetaall{2},uno)
+
+subplot(2,5,3);
+polarmodelplot(thetaall{3},uno)
+
+subplot(2,5,4);
+polarmodelplot(thetaall{4},uno)
+
+subplot(2,5,5);
+polarmodelplot(thetaall{5},uno)
+
+subplot(2,5,6);
+moldelmatplot(a{5},theta1)
+
+subplot(2,5,7);
+moldelmatplot(a{4},theta1)
+
+subplot(2,5,8);
+moldelmatplot(a{3},theta1)
+
+subplot(2,5,9);
+moldelmatplot(a{2},theta1)
+
+subplot(2,5,10);
+moldelmatplot(a{1},theta1)
+
+
+
+%% Panel 2
+
+clear all
+
+%Loading data
+
+beh=load('data_for_plots/Figure_4/all_behaviour_n41_trialbytrial_C05.mat')
+load('data_for_plots/Figure_4/avg_polarbias_n41_C1.mat')
+
+%Loadin eyedata
+
+load('data_for_plots/Figure_4/test1_meanrecent_100pth_n41_lastsec.mat')
+eye.all{1}(:,1)=av_a1cued1(:)-av_a1cued2(:)
+eye.all{1}(:,2)=av_a2cued1(:)-av_a2cued2(:)
+load('data_for_plots/Figure_4/test2_meanrecent_100pth_n41_lastsec.mat')
+
+eye.all{1}(:,3)=av_a1cued1(:)-av_a1cued2(:)
+eye.all{1}(:,4)=av_a2cued1(:)-av_a2cued2(:)
+
+
+fp=(~isnan(eye.all{1}(:,1))+~isnan(eye.all{1}(:,2))...
+    +~isnan(eye.all{1}(:,3))+~isnan(eye.all{1}(:,4)))==4; %checking we have data from all participants
+
+eye.all{1}=eye.all{1}(:,:)
+
+figure('Position' ,[100 600 950 600]);
+
+%behavioural plot
+
+subplot(1,3,1)
+colores=[0 0 0];
+
+% barplotbias(beh.all{1},[-0.51,0.51],'behaviour','A (bias index)',1)
+lineartrendana(beh.all,1,1,[-.4,0.7],'behaviour','B (bias index)',colores,-0.6)
+
+% polarplot of behav bias
+
+oi=avg_bCueor;
+oiac=avg_aCueor;
+
+yourBias=[];
+yourAccu=[];
+
+for ppp=1:size(oi,2)
+    behB=oi(:,ppp)'; %BheaviouralBias
+    
+    s=avg_Paramsr(ppp,1);     % noise (in memory/decision-making)
+    A=avg_Paramsr(ppp,2);      % Key Parameter (squircle) 0: all circle; 1: all square
+    C=avg_Paramsr(ppp,3);
+    makefig=0;
+    [yourAccu(:,ppp) yourBias(:,ppp)]=squircleBehave2compB(s,A,C,behB,makefig);
+    
+end
+counter=1;
+
+subplot(1,3,2)
+
+polarplot([0 pi],[1 1],'k-','LineWidth',1);hold on;
+polarplot([pi/2 pi*1.5],[1 1],'k-','LineWidth',1);hold on;
+
+
+
+Aave=round(mean(avg_Paramsr(:,2),1),3)
+Astd=std(avg_Paramsr(:,2),0,1);
+
+quickplotcompBerrors(bb',(yourBias),(oi),[''],1,Aave);
+counter=counter+1,
+
+
+set(gca,'GridAlpha',0.25);
+set(gca,'FontSize',20);
+
+%eye plot
+
+subplot(1,3,3)
+
+lineartrendana(eye.all,1,0,[-.1,.175],'gaze','\Delta (rho) repulsion - attraction',colores,-0.15)
+
+
+%% Analysis
+
+%T test againg 0
+mmm=mean(beh.all{1}(:,:),2);
+mean(beh.all{1}) %mean of B index in each condition
+
+h = lillietest(mmm);
+[h,p,ci,stats] = ttest(mmm,0)
+[h,p,ci,stats] = ttest(beh.all{1},0)
+
+[p,h,stats] = ranksum(mmm,0)
+
+
+% Anova 
+
+al=[]
+al= cat(1,beh.all{1}(:,1),beh.all{1}(:,2),beh.all{1}(:,3),beh.all{1}(:,4))';
+
+p=size(beh.all{1},1);
+
+S=[1:p,1:p,1:p,1:p];
+F1=[ones(p,1);ones(p,1)*2;ones(p,1);ones(p,1)*2]'
+F2=[ones(p*2,1);ones(p*2,1)*2]'
+FACTNAMES={'item order', 'test order'}
+
+stats = rm_anova2(al,S,F1,F2,FACTNAMES)
+
+totalSS=sum([stats{2,2},stats{3,2},stats{4,2},stats{5,2},stats{6,2},stats{7,2}]);
+etaS=[stats{2,2}/totalSS,stats{3,2}/totalSS,stats{4,2}/totalSS]
+
+%% Linear trend analysis beh
+
+ b_beh=lineartrendana(beh.all,0);
+
+%%
+
+%T test againg 0
+mmm=mean(eye.all{1}(:,:),2);
+
+h = lillietest(mmm);
+[h,p,ci,stats] = ttest(mmm,0)
+[h,p,ci,stats] = ttest(eye.all{1},0)
+
+[p,h,stats] = ranksum(mmm,0)
+1
+% Anova 
+
+al=[]
+al= cat(1,eye.all{1}(fp,1),eye.all{1}(fp,2),eye.all{1}(fp,3),eye.all{1}(fp,4))';
+
+p=size(eye.all{1}(fp,1),1);
+
+S=[1:p,1:p,1:p,1:p];
+F1=[ones(p,1);ones(p,1)*2;ones(p,1);ones(p,1)*2]'
+F2=[ones(p*2,1);ones(p*2,1)*2]'
+FACTNAMES={'item order', 'test order'}
+
+stats = rm_anova2(al,S,F1,F2,FACTNAMES)
+
+totalSS=sum([stats{2,2},stats{3,2},stats{4,2},stats{5,2},stats{6,2},stats{7,2}]);
+etaS=[stats{2,2}/totalSS,stats{3,2}/totalSS,stats{4,2}/totalSS]
+
+
+%% Linear trend analysis eye
+ b_eye=lineartrendana(eye.all,0,0,[-.075,.2]);
+
+%% Correlation between slopes in beh and eyes
+
+[rho pval]=corr(b_beh',b_eye','Type','Pearson')
+
+%%
+
+figure; % barplotbias(beh.all{1},[-0.51,0.51],'behaviour','A (bias index)',1)
+lineartrendana(beh.all,1,1,[-.9,0.9],'behaviour','B (bias index)')
+
+%% Subfunctions
+
+function polarmodelplot(theta,uno)
+
+    polarplot(theta,uno,'k-o','MarkerFaceColor', 'k', 'MarkerSize', 8);
+    r=gca;
+    r.FontSize=20;
+    r.RTickLabel=[];
+    r.RGrid='off';
+    rlim([0 1.25])    
+    c=creat_u_d_model;
+    d=creat_l_r_model;
+    aa=c+d;
+    cont=creatcontmodel(1);
+    A=0.5;
+    a=A*aa+(1-A)*cont
+    
+end
+        
+
+function moldelmatplot(a,theta1)
+
+    imagesc(a);hold on;
+    xlabel('orientation (°)')
+    ylabel('orientation (°)')
+
+    
+  xticks = 1:16;  %adjust as appropriate, positive integers only
+  xlabels = round(rad2deg(theta1(1:4:16)));  %time labels
+    set(gca, 'XTick', 1:4:16, 'XTickLabel', xlabels, ...
+        'YTick', 1:4:16, 'YTickLabel', xlabels, 'YAxisLocation','left','FontSize',20);
+    
+end
+
+
+function barplotbias(data,yl,tito,yla,labels,sublabels,colores,xpos)
+
+ax=notBoxPlot(data,'style','sdline')
+
+line([0,5], [0,0], 'Color', 'k','LineStyle',':','LineWidth',2);hold on;
+line([2.5,2.5], [-10,10], 'Color', 'k','LineStyle','--','LineWidth',2);hold on;
+
+for i=1:4
+        
+    ax(i).semPtch.FaceColor = [0.75 0.75 0.75];
+    ax(i).semPtch.EdgeColor = [0.75 0.75 0.75];
+
+
+    ax(i).semPtch.LineWidth = 3;
+    ax(i).data.MarkerSize = 8;
+
+    ax(i).mu.Color = [0 0 0];
+    ax(i).sd.Color = [0 0 0];
+   
+
+end
+
+xticks([1:4])
+xticklabels(labels)
+
+% xtickangle(45)
+ylim(yl)
+xlim([0.5 4.5])
+ylabel(yla)
+set(gca,'FontSize',20);
+title(tito)
+
+text(1.5,xpos,sublabels{1},'HorizontalAlignment','center','FontSize',20,'FontWeight','bold')
+text(3.5,xpos,sublabels{2},'HorizontalAlignment','center','FontSize',20,'FontWeight','bold')
+
+
+
+end
+
+function ball=lineartrendana(all,plotyes,beh,ylimits,btit,ylab,colores,xpos)
+
+distances(:,1)=all{1}(:,2) %stim 2 cued 1st
+distances(:,2)=all{1}(:,1) %stim 1 cued 1st
+distances(:,3)=all{1}(:,4)%stim 2 cued 2nd
+distances(:,4)=all{1}(:,3) %stim 1 cued 2nd
+
+%% Check linear trend
+
+% ball=[];
+% yfit = [];
+
+for ppp = 1:size(distances,1)   
+    
+    tof=[];
+    for c=1:size(distances,2);
+    tof=[tof; distances(ppp,c)];    
+    end
+    
+    [b,dev,stats] = glmfit(1:size(distances,2),tof,'normal');
+    yfit(ppp,:) = polyval([b(2,1),b(1,1)],[1,2,3,4]);
+    
+    ball(ppp) = b(2);
+end
+
+[h,p,ci,stats] = ttest(ball,0)
+
+if plotyes
+
+if beh
+    labels={'Stim 2 ','Stim 1','Stim 2','Stim 1'};
+    sublabel={'test 1', 'test 2'};
+    
+    
+   
+else
+        labels={'Stim 2 ','Stim 1','Stim 2','Stim 1'};
+
+%     labels={'stim 2 - delay 1','stim 1 - delay 1','stim 2 - delay 2','stim 1 - delay 2'};
+    sublabel={'delay 1', 'delay 2'};
+
+end
+
+plot(yfit','Color',[colores 0.25],'LineWidth',1);hold on;
+
+plot(mean(yfit,1)','Color',[0 0 0],'LineWidth',3);hold on;
+
+
+barplotbias(distances,ylimits,btit,ylab,labels,sublabel,colores,xpos)
+    
+end
+
+end
+

+ 275 - 0
Figure_4_timeline.m

@@ -0,0 +1,275 @@
+ mainfolder='';
+
+addpath(genpath([mainfolder 'subfunctions/']))
+addpath(genpath(['subfunctions/rm_anova2']))
+
+%%
+
+% GENERAL DIFFERENCE BETWEEN MODELS DURING DELAY (CUED UNCUED) (cat cardinal model vs
+% anti cardinal model)
+
+clear all
+
+  mainfolder='';
+  
+  %% Uncomment to load the data
+% 
+% %1 cued
+% folder{1}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_1_cued_cat_udlr_Pearson/']
+% folder{2}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_1_cued_cat_udlr45_Pearson/']
+% 
+% %1 uncued
+% folder{3}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_1_uncued_cat_udlr_Pearson/']
+% folder{4}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_1_uncued_cat_udlr45_Pearson/']
+% 
+% %2 cued
+% folder{5}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_2_cued_cat_udlr_Pearson/']
+% folder{6}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_2_cued_cat_udlr45_Pearson/']
+% 
+% %2 uncued
+% folder{7}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_2_uncued_cat_udlr_Pearson/']
+% folder{8}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_2_uncued_cat_udlr45_Pearson/']
+% 
+% % 1 and 2 cued - circle
+% folder{9}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_1_cued_Pearson/']
+% folder{10}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/single_trial_RSA_first_check_object_2_cued_Pearson/']
+% 
+% 
+% load([mainfolder, 'good_partis.mat']) %list of participant with a good performance
+% partis=good_partis';
+% 
+% 
+% [RHO_id_group,time]=loadingrsa(folder,partis)
+% 
+% 
+% 
+% %% Loading 2 delay
+% 
+% %1 cued
+% folder{1}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_1_cued_cat_udlr_Pearson/']
+% folder{2}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_1_cued_cat_udlr45_Pearson/']
+% 
+% %1 uncued
+% folder{3}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_1_uncued_cat_udlr_Pearson/']
+% folder{4}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_1_uncued_cat_udlr45_Pearson/']
+% 
+% %2 cued
+% folder{5}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_2_cued_cat_udlr_Pearson/']
+% folder{6}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_2_cued_cat_udlr45_Pearson/']
+% 
+% %2 uncued
+% folder{7}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_2_uncued_cat_udlr_Pearson/']
+% folder{8}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_2_uncued_cat_udlr45_Pearson/']
+% 
+% % 1 2 cued circle
+% folder{9}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_1_uncued_Pearson/']
+% folder{10}=[mainfolder 'results/mean_recentered_th100/euclideanmodels/2nd_cue/single_trial_RSA_first_check_object_2_uncued_Pearson/']
+% 
+% load([mainfolder, 'good_partis.mat']) %list of participant with a good performance
+% partis=good_partis';
+% 
+% [RHO_id_group2,time2]=loadingrsa(folder,partis)
+
+%% Optional -> Loading the data ready to be plotted
+
+load('data_for_plots/Figure_3/data_n41_2022.mat');
+
+%% delay 1
+
+%ori1 cued
+a1cued{1}=RHO_id_group{1}; %  model model 1
+a1cued{2}=RHO_id_group{2}; %  model model 2 (anticardinal)
+
+%ori1 uncued
+a1uncued{1}=RHO_id_group{3}; %  model model 1
+a1uncued{2}=RHO_id_group{4}; %  model model 2 (anticardinal)
+
+%ori2 cued
+a2cued{1}=RHO_id_group{5}; %  model model 1
+a2cued{2}=RHO_id_group{6}; %  model model 2 (anticardinal)
+
+%ori2 uncued
+a2uncued{1}=RHO_id_group{7}; %  model model 1
+a2uncued{2}=RHO_id_group{8}; %  model model 2 (anticardinal)
+
+a1circle=RHO_id_group{9}; %  model circle 1
+a2circle=RHO_id_group{10}; %  model cicle 2 
+
+
+%% delay 2
+
+%ori1 cued
+a1cued2{1}=RHO_id_group2{1}; %  model model 1
+a1cued2{2}=RHO_id_group2{2}; %  model model 2 (anticardinal)
+
+%ori1 uncued
+a1uncued2{1}=RHO_id_group2{3}; %  model model 1
+a1uncued2{2}=RHO_id_group2{4}; %  model model 2 (anticardinal)
+
+%ori2 cued
+a2cued2{1}=RHO_id_group2{5}; %  model model 1
+a2cued2{2}=RHO_id_group2{6}; %  model model 2 (anticardinal)
+
+%ori2 uncued
+a2uncued2{1}=RHO_id_group2{7}; %  model model 1
+a2uncued2{2}=RHO_id_group2{8}; %  model model 2 (anticardinal)
+
+a1circle2=RHO_id_group2{9}; %  model circle 1
+a2circle2=RHO_id_group2{10}; %  model cicle 2 
+
+%% Uncomment to run the cluster perm tests
+% %% Cluster analysis of the difference (delay 1)
+% 
+% %Setting times (from -100 stim onset until the end of the delay period)
+% t1=find(time==-100)
+% t2=find(time==5850)
+% t1_2=find(time==900)
+% [timesignclust cluspval] = cluster_dif(a1cued,a2cued,time,t1,t2,t1_2)
+% 
+% % mean([timesignclust(1,1) timesignclust(2,1)]) %average of "starting" point;
+% 
+% %% Cluster analysis of the difference within-between (delay 2)
+% 
+% %Setting times (from -100 stim onset until the end of the delay period)
+% t1=find(time2==-100)
+% t2=find(time2==2850)
+% t1_2=find(time2==-100)
+% [timesignclust2 cluspval2] = cluster_dif(a1uncued2,a2uncued2,time2,t1,t2,t1_2)
+% 
+% % mean([timesignclust(1,1) timesignclust(2,1)]) %average of "starting" point;
+
+
+
+%% Delay 1 fig
+
+%% mode 3
+coloresb=(colormap((parula(5))));
+coloresb(6,:)=[0 0 0]; 
+coloresb(1,:)=[1 0 0]; 
+coloresb(3,:)=[1 0 0]; 
+
+figure('Position',([200 800 750 700]))
+subplot(2,1,1)
+
+colores=coloresb([1 2 3 6 6],:)
+
+leng1='repulsion (B=1)'
+leng2='attraction (B=-1)'
+
+titu=''
+xl=[-500 5850];
+yl=[-0.02 0.15];
+
+pval=0.05
+spa=0.1
+toi=[2300 5000]
+
+plot3lines_models(time,a1cued,colores,xl,yl,leng1,leng2,titu,0,'time (ms)',1,timesignclust(1,:),colores(1,:),nanmean(a1circle,2),colores(4,:),'unbiased (B=0)',1)
+set(gca,'FontSize',20);
+
+subplot(2,1,2)
+
+titu=''
+
+plot3lines_models(time,a2cued,colores,xl,yl,leng1,leng2,titu,0,'time (ms)',1,timesignclust(2,:),colores(1,:),nanmean(a2circle,2),colores(4,:),'unbiased (B=0)',0)
+set(gca,'FontSize',20);
+
+%% Delay 2 fig
+
+figure('Position',([200 800 420 700]))
+subplot(2,1,1)
+
+leng1='repulsion (B=1)'
+leng2='attraction (B=-1)'
+
+titu=''
+xl=[-300 2850];
+yl=[-0.02 0.15];
+
+pval=0.05
+spa=0.1
+toi=[2500 5000]
+
+plot3lines_models2nd2(time2,a1uncued2,colores,xl,yl,leng1,leng2,titu,0,'time (ms) from Cue 2',1,timesignclust2(1,:),colores(1,:),nanmean(a1circle2,2),colores(4,:),'unbiased (B=0)',0)
+
+set(gca,'FontSize',20);
+
+subplot(2,1,2)
+
+titu=''
+
+plot3lines_models2nd2(time2,a2uncued2,colores,xl,yl,leng1,leng2,titu,0,'time (ms) from Cue 2',1,timesignclust2(2,:),colores(1,:),nanmean(a2circle2,2),colores(4,:),'unbiased (B=0)',0)
+
+set(gca,'FontSize',20);
+
+%% subfuction
+
+function [RHO_id_group,time]=loadingrsa(folder,partis)
+
+counter=1;
+
+for ppp=1:length(partis)
+    counterf=1;
+    
+    
+    
+     for fff=1:size(folder,2)
+  toload=[folder{fff}, partis{ppp,:},'.mat']
+  load(toload)
+  
+  RHO_id_group{counterf}(:,counter)=squeeze(nanmean(RSA_obj_rot.rho(:,:,:),1));
+  counterf=counterf+1;
+
+    end
+     
+  counter=counter+1;
+   
+end
+
+time=RSA_obj_rot.time;
+
+end
+
+
+function [timesignclust cluspv] = cluster_dif(a1_1,a2_1,time_1,t1,t2,t1_2)
+
+%ori1 cued
+wi1 =a1_1{1}(t1:t2,:); %  with 1
+bet1 =a1_1{2}(t1:t2,:); %  bet 1
+
+%ori2 cued
+wi2 =a2_1{1}(t1_2:t2,:); %  w 2
+bet2 =a2_1{2}(t1_2:t2,:); %  betwen 2
+
+RHOD_wi{1}=wi1();
+RHOD_wi{2}=wi2();
+
+RHOD_be{1}=bet1();
+RHOD_be{2}=bet2();
+
+pv_cluster=0.05; % p-vals for clust perm test
+% az=zeros(size(RHOD_diff{1})); % matrix to be compare (in this case against 0);
+
+timesall{1}=time_1(t1:t2);
+timesall{2}=time_1(t1_2:t2);
+
+
+[timesignclust cluspv]=allclustperm2(RHOD_wi,timesall,RHOD_be,pv_cluster) % output variable (rows -> lines; columns -> start and end (ms))
+
+end
+
+function [timesignclust cluspv]=allclustperm2(RHO_all,time,az,pv_cluster)
+timesignclust=nan(size(RHO_all,2),2); % output variable (rows -> lines; columns -> start and end (ms))
+for r=1:size(RHO_all,2);      
+    [clusters, p_values, t_sums, permutation_distribution] =permutest(RHO_all{r},az{r},1,0.05,20000)
+    if p_values(1)<pv_cluster
+        
+        timesignclust(r,1)=time{r}(clusters{1}(1))
+        timesignclust(r,2)=time{r}(clusters{1}(end))
+        
+    end
+    
+    cluspv(r)=p_values(1);
+end
+end
+

BIN=BIN
behavioural_modeling/behavdata/dat.mat


BIN=BIN
behavioural_modeling/behavdata/datperitem.mat


BIN=BIN
behavioural_modeling/behavdata/datperitemandtrial.mat


+ 159 - 0
behavioural_modeling/findAbehavAllConditions.m

@@ -0,0 +1,159 @@
+clear all
+
+load('behavdata/dat.mat')
+
+aCue{1}=squeeze(accrot_cu_uncue(:,1,:)); %Accuracy 1st Test
+bCue{1}=squeeze(bias_cue(:,1,:)); %Bias 1st Test
+
+aCue{2}=squeeze(accrot_cu_uncue(:,2,:)); %Accuracy 2st Test
+bCue{2}=squeeze(bias_uncue(:,1,:)); %Bias 2st Test
+
+%Averaging between 1st and 2nd test 
+aCueg = ((aCue{1}+aCue{2})./2)
+bCueg = ((bCue{1}+bCue{2})./2)
+
+%% order the data in standard presentation
+
+ao=deg2rad(accrot_cu_uncue(:,3,1))
+ao2=abs(2*pi-ao) %move anticlockwise
+ao3=(angdiff(-ao2,-(ones(16,1).*pi*1.5)))+pi
+
+[ao2,ao3]
+
+[bb ind]=sort(ao3)
+
+aCueo=aCueg(ind,:)
+bCueo=bCueg(ind,:)
+
+%%
+
+% aCueGo = ((aCue1o+aCue2o)./2)
+% bCueGo = ((bCue1o+bCue2o)./2)
+
+
+%% With general accuracy (1st and 2nd test combined)
+
+% Keep C=1
+% 
+% (i) SSQ based on ave between acuSSQ and biasSSQ
+% (ii) SSQ based only biasSSQ
+% (iii) SSQ based on ave between acuSSQ and biasSSQ (but acuSSQ is calculated on general accu)
+
+%%
+BestParams=nan(size(accrot_cu_uncue,3),4);
+
+parfor ppp =1:size(accrot_cu_uncue,3)
+    
+        
+        aaCue=(aCueo(:,ppp)');
+        bbCue=(bCueo(:,ppp)');
+        
+        CvetIn=0:0.1:1;%vector grid search of C
+        
+        BestParams(ppp,:)=gridsearch_jld(aaCue,bbCue,0,2,CvetIn,0.1); % This fuction is the the same as original, but we can add some input (ssqmat only based on accu,granularity for the grid search)
+          
+end
+
+%%
+
+all=BestParams
+%%
+
+        s=BestParams(1,1);     % noise (in memory/decision-making)
+        A=BestParams(1,2);      % Key Parameter (squircle) 0: all circle; 1: all square
+        C=BestParams(1,3);      % Reduce noise near cardinal by this factor (1: off)
+        makefig=0;
+        
+        behB=bCueo(:,ppp)'; %BehaviouralBias
+        
+        figure;
+        [yourAccu(:,ppp) yourBias(:,ppp)]=squircleBehave2compB(s,A,C,behB,makefig);
+
+%% Changing format
+
+Params{1}= squeeze(BestParams(:,:,1));% info about test 1
+Params{2}= squeeze(BestParams(:,:,2));% info about test 1
+
+%% Anova 
+
+%%
+
+%% and Group plot
+figure;
+
+for test=1:0
+oi=bCueo{test};
+
+yourBias=[];
+yourAccu=[];
+for ppp=1:size(oi,2)
+    behB=oi(:,ppp)'; %BehaviouralBias
+    
+    s=Params{test}(ppp,1);     % noise (in memory/decision-making)
+    A=Params{test}(ppp,2);      % Key Parameter (squircle) 0: all circle; 1: all square
+    C=Params{test}(ppp,3);      % Reduce noise near cardinal by this factor (1: off)
+    makefig=0;
+    [yourAccu(:,ppp) yourBias(:,ppp)]=squircleBehave2compB(s,A,C,behB,makefig);
+    
+end
+
+subplot(1,2,test)
+    quickplotcompB(bb',mean(yourBias,2)',mean(oi,2)',['Group plot Bias - test- ' num2str(test)]);
+end
+
+%%
+for ig=1:2;
+    
+    if ig==1
+        p=1:15;
+    else
+        p=16:29;
+    end
+    
+figure;
+counter=1;
+for ppp =p
+    behB=bCue1o(:,ppp)'; %BehaviouralBias
+    
+    s=BestParams(ppp,1);     % noise (in memory/decision-making)
+    A=BestParams(ppp,2);      % Key Parameter (squircle) 0: all circle; 1: all square
+    C=BestParams(ppp,3);      % Reduce noise near cardinal by this factor (1: off)
+    makefig=0;
+    subplot(4,4,counter)
+    [yourAccu yourBias]=squircleBehave2compB(s,A,C,behB,makefig);
+    rlim([0 1]);
+    counter=counter+1;
+    
+end
+
+end
+%%
+
+colores=(colormap((winter(6))));
+figure
+
+%Cue Acc
+for ppp=1:29
+subplot(6,5,ppp)
+
+accrottask_mod=accrot_cu_uncue;
+accrottask_mod(size(accrottask_mod,1)+1,:,:)=accrot_cu_uncue(1,:,:);
+
+dat=squeeze(accrottask_mod(:,1,ppp));
+ap=(dat);
+theta=deg2rad(accrottask_mod(:,3,1));
+theta2=(max(theta)-theta);
+theta3=abs(2*pi-theta);
+
+chance=ap;
+chance(:)=0.5;
+polarplot(theta3,chance,'k-.','Color',colores(5,:),'LineWidth',1.5);hold on;
+polarplot(theta3,ap,'-','Color',colores(3,:),'LineWidth',1.5);hold on;
+r=polarplot(theta3,ap,'o','Color',colores(3,:),'MarkerFaceColor',colores(5,:),'LineWidth',2);
+
+set(gca,'ThetaZeroLocation','top','FontSize',12);hold on;
+
+title(['sigma = ' num2str(BestParams(ppp,1)) ' A= ' num2str(BestParams(ppp,2))])
+
+end
+

+ 307 - 0
behavioural_modeling/findAbehavPerItem.m

@@ -0,0 +1,307 @@
+
+clear all
+
+load('behavdata/datPerItem.mat')
+addpath(genpath([''])); %Add here the subfolder of subfunction (root folder)
+
+aCue{1,1}=squeeze(accrot_cu_uncue{1}(:,1,:)); %Accuracy 1st obj and 1st Test
+aCue{1,2}=squeeze(accrot_cu_uncue{1}(:,2,:)); %Accuracy 1st obj 2nd Test
+aCue{2,1}=squeeze(accrot_cu_uncue{2}(:,1,:)); %Accuracy 2st obj and 1st Test
+aCue{2,2}=squeeze(accrot_cu_uncue{2}(:,2,:)); %Accuracy 2st obj 2nd Test
+
+
+bCue{1,1}=squeeze(bias_cue{1}(:,1,:)); %Bias 1st item 1st Test
+bCue{1,2}=squeeze(bias_uncue{1}(:,1,:)); %Bias 1st 2nd Test
+bCue{2,1}=squeeze(bias_cue{2}(:,1,:)); %Bias 1st item 1st Test
+bCue{2,2}=squeeze(bias_uncue{2}(:,1,:)); %Bias 1st 2nd Test
+
+% aCueg = ((aCue1+aCue2)./2)
+% bCueg = ((bCue1+bCue2)./2)
+
+groupave=0 % If we want to calculate A using the group average
+
+if groupave 
+    for item=1:2
+        for test=1:2
+            aCue{item,test}=mean(aCue{item,test}(:,:),2)
+            bCue{item,test}=mean(bCue{item,test}(:,:),2)
+        end
+    end   
+end
+
+%% order the data in standard presentation
+
+ao=deg2rad(accrot_cu_uncue{1}(:,3,1));
+ao2=abs(2*pi-ao); %move anticlockwise
+ao3=(angdiff(-ao2,-(ones(16,1).*pi*1.5)))+pi;
+
+[bb ind]=sort(ao3);
+
+for item=1:2
+    for test=1:2
+        aCueo{item,test}=aCue{item,test}(ind,:);
+        bCueo{item,test}=bCue{item,test}(ind,:);
+    end
+end
+
+
+%% Obtaining the best parameters
+
+BestParams=nan(size(aCueo{1,1},2),4,2,2);
+CvetIn=1;%0.0:0.02:2;%vector grid search of C
+
+parfor ppp =1:size(aCueo{1,1},2)
+    
+    for item = 1:2
+        for test=1:2
+            
+            aCue=(aCueo{item,test}(:,ppp)');
+            bCue=(bCueo{item,test}(:,ppp)');
+                        
+            BestParams(ppp,:,item,test)=gridsearch_jld(aCue,bCue,0,0,CvetIn,0.01); % This fuction is the the same as original, but we can add some input (ssqmat only based on accu,granularity for the grid search)
+            
+        end
+    end
+    
+end
+
+%% Changing format
+
+for item = 1:2
+    for test=1:2
+        Params{item,test}= squeeze(BestParams(:,:,item,test));% info about test 1
+        Params{item,test}= squeeze(BestParams(:,:,item,test));% info about test 1
+    end
+end
+
+
+%% Plotting all parameters
+
+outputlabels={'s (noise)',' A (squircle factor)', 'C (cardinal precision)',' min SSQ'};
+
+figure;
+
+for lp = 1:4
+all{1}= (cat(2,Params{1,1}(:,lp),Params{2,1}(:,lp),Params{1,2}(:,lp),Params{2,2}(:,lp)))
+
+subplot(2,2,lp)
+barplotbias(all{1},[min(all{1}(:)-0.0001),max(all{1}(:))+0.0001],' ',outputlabels{lp},1)
+
+end
+
+%% Anova 
+
+addpath '\rm_anova2'
+
+removingout=0
+
+if removingout ==1 %if removing the outlier
+[m I]=max(Params{1,2}(:,4))
+ind = 1:length((Params{1,2}(:,4)))~=I;
+else
+ind = 1:length((Params{1,2}(:,4)))~=0;
+end
+
+a1= (cat(1,Params{1,1}(ind,2),Params{2,1}(ind,2),Params{1,2}(ind,2),Params{2,2}(ind,2))')
+
+
+p=(sum(ind));
+
+S=[1:p,1:p,1:p,1:p];
+F1=[ones(p,1);ones(p,1)*2;ones(p,1);ones(p,1)*2]'
+F2=[ones(p*2,1);ones(p*2,1)*2]'
+FACTNAMES={'item order', 'test order'}
+
+
+stats = rm_anova2(a1,S,F1,F2,FACTNAMES)
+
+
+totalSS=sum([stats{2,2},stats{3,2},stats{4,2},stats{5,2},stats{6,2},stats{7,2}]);
+etaS=[stats{2,2}/totalSS,stats{3,2}/totalSS,stats{4,2}/totalSS]
+
+%%
+
+all{1}= (cat(2,Params{1,1}(:,2),Params{2,1}(:,2),Params{1,2}(:,2),Params{2,2}(:,2)))
+
+for rrr=1:4
+[h,p,ci,stats] = ttest(all{1}(:,rrr),0)
+ttesre(rrr,1)=stats.tstat;
+ttesre(rrr,2)=p;
+end
+%% Plotting A index (bars)
+
+all{1}= (cat(2,Params{1,1}(:,2),Params{2,1}(:,2),Params{1,2}(:,2),Params{2,2}(:,2)))
+
+names{1}='all'
+
+figure;
+
+for t=1
+    
+    avg=nanmean(all{t},1);
+    sem=std(all{t})/sqrt(size(all{t},1));
+    
+%     subplot(1,3,t)
+    % bar(rot_dif_list,avg);hold on,
+    if groupave
+     
+        plot(avg,'o')
+        
+    else
+    er=errorbar([],avg,sem,sem,'o');
+    er.Color = [0 0 0];
+    er.LineStyle = 'none';
+    end
+%     ylim([0 0.34])
+    xlim([0 5])
+%     line([0,5],[0.5 0.5], 'Color', 'k','LineStyle','--');hold on;
+    
+    xticks([1:4])
+    xticklabels({'ori 1 1st test','ori 2 1st test','ori 1 2nd test','ori 2 2nd test'})
+    
+    % xlabel('distance between 1stcued minus 2nd cued ori (degrees)')
+    ylabel('cardinal repulsion index (bias index)')
+      
+    title(['bias index - ' names{t}])
+    
+end
+
+
+%% Plotting A index (bars) -version 2
+
+figure('Position' ,[100 600 950 600]);
+ax=notBoxPlot(all{1},'style','sdline')
+
+for i=1:4
+ax(i).semPtch.FaceColor = [0.75 0.75 0.75];
+ax(i).semPtch.EdgeColor = [0.75 0.75 0.75];
+ax(i).semPtch.LineWidth = 3;
+ax(i).mu.Color = [0 0 0];
+ax(i).sd.Color = [0 0 0];
+end
+
+ xticks([1:4])
+    xticklabels({'object 1 - test 1','object 2 - test 1','object 1 - test 2','object 2- test 2'})
+        ylim([-0.41 .615])
+        
+        ylabel('A (bias index)')
+       set(gca,'FontSize',13);
+
+
+%% and groupal polar plot per item and test
+
+for item = 1:2
+
+for test=1:2
+    oi=bCueo{item,test};
+    oiac=aCueo{item,test};
+    
+    yourBias=[];
+    yourAccu=[];
+    for ppp=1:size(oi,2)
+        behB=oi(:,ppp)'; %BheaviouralBias
+        
+        s=Params{item,test}(ppp,1);     % noise (in memory/decision-making)
+        A=Params{item,test}(ppp,2);      % Key Parameter (squircle) 0: all circle; 1: all square
+        C=Params{item,test}(ppp,3);      % Reduce noise near cardinal by this factor (1: off)
+        makefig=0;
+        [yourAccu(:,ppp) yourBias(:,ppp)]=squircleBehave2compB(s,A,C,behB,makefig);
+        
+    end
+    counter=1;
+figure;
+    subplot(1,2,counter)
+    
+    quickplotcompBerrors(bb',(yourBias),(oi),['bias - object - '  num2str(item) ' test- ' num2str(test)],1);
+    counter=counter+1,
+
+       set(gca,'FontSize',12);
+
+    
+    subplot(1,2,counter)
+    
+    quickplotcompBerrors(bb',(yourAccu),(oiac),['accuracy - item- ' num2str(item) ' test- ' num2str(test)],0);
+    counter=counter+1,
+
+       set(gca,'FontSize',12);
+    
+end
+end
+
+%%
+bCueor=cat(3,bCueo{1,1},bCueo{1,2},bCueo{2,1},bCueo{2,2});
+avg_bCueor=mean(bCueor,3);
+
+aCueor=cat(3,aCueo{1,1},aCueo{1,2},aCueo{2,1},aCueo{2,2});
+avg_aCueor=mean(aCueor,3);
+
+Paramsr=cat(3,Params{1,1},Params{1,2},Params{2,1},Params{2,2});
+avg_Paramsr=mean(Paramsr,3);
+
+%% and general polar plot of bias (averaged across items and tests)
+
+
+    oi=avg_bCueor;
+    oiac=avg_aCueor;
+    
+    yourBias=[];
+    yourAccu=[];
+    for ppp=1:size(oi,2)
+        behB=oi(:,ppp)'; %Bevah Bias
+        
+        s=avg_Paramsr(ppp,1);     % noise (in memory/decision-making)
+        A=avg_Paramsr(ppp,2);      % Key Parameter (squircle) 0: all circle; 1: all square
+        C=avg_Paramsr(ppp,3);      % Reduce noise near cardinal by this factor (1: off)
+        makefig=0;
+        [yourAccu(:,ppp) yourBias(:,ppp)]=squircleBehave2compB(s,A,C,behB,makefig);
+        
+    end
+    counter=1;
+figure;
+    
+    quickplotcompBerrors(bb',(yourBias),(oi),['bias'],1);
+    counter=counter+1,
+
+       set(gca,'FontSize',12);
+
+    
+%     subplot(1,2,counter)
+%     
+%     quickplotcompBerrors(bb',(yourAccu),(oiac),['accuracy - item- ' num2str(item) ' test- ' num2str(test)],0);
+%     counter=counter+1,
+% 
+%        set(gca,'FontSize',12);
+    %%
+
+%% subfucntions
+
+function barplotbias(data,yl,tito,yla,beh)
+
+ax=notBoxPlot(data,'style','sdline')
+
+line([0,5], [0,0], 'Color', 'k','LineStyle',':','LineWidth',2);hold on;
+line([2.5,2.5], [-10,10], 'Color', 'k','LineStyle','--','LineWidth',2);hold on;
+
+for i=1:4
+    ax(i).semPtch.FaceColor = [0.75 0.75 0.75];
+    ax(i).semPtch.EdgeColor = [0.75 0.75 0.75];
+    ax(i).semPtch.LineWidth = 3;
+    ax(i).mu.Color = [0 0 0];
+    ax(i).sd.Color = [0 0 0];
+end
+
+xticks([1:4])
+if beh
+xticklabels({'stim 1/test 1','stim 2/test 1','stim 1/test 2','stim 2/test 2'})
+else
+xticklabels({'stim 1/delay 1','stim 2/delay 1','stim 1/delay 2','stim 2/delay 2'})
+end
+xtickangle(45)
+ylim(yl)
+xlim([0.5 4.5])
+ylabel(yla)
+set(gca,'FontSize',20);
+title(tito)
+
+end
+

+ 337 - 0
behavioural_modeling/findAbehavPerItemTrials.m

@@ -0,0 +1,337 @@
+
+clear all
+
+load('behavdata/datperitemandtrial.mat')
+addpath(genpath([''])); %Add here the subfolder of subfunction (root folder)
+
+% This data contains participant responses (1 =CW and 0 = CCW)
+
+aCue{1,1}=squeeze(cw_resp_cu_uncue{1}(:,1,:,:)); % 1st obj and 1st Test
+aCue{1,2}=squeeze(cw_resp_cu_uncue{1}(:,2,:,:)); % 1st obj 2nd Test
+aCue{2,1}=squeeze(cw_resp_cu_uncue{2}(:,1,:,:)); % 2st obj and 1st Test
+aCue{2,2}=squeeze(cw_resp_cu_uncue{2}(:,2,:,:)); % 2st obj 2nd Test
+
+% This data contains the correct responses per trial (1 =CW and 0 = CCW)
+
+tCue{1,1}=squeeze(cw_test_cu_uncue{1}(:,1,:,:)); % 1st obj and 1st Test
+tCue{1,2}=squeeze(cw_test_cu_uncue{1}(:,2,:,:)); % 1st obj 2nd Test
+tCue{2,1}=squeeze(cw_test_cu_uncue{2}(:,1,:,:)); % 2st obj and 1st Test
+tCue{2,2}=squeeze(cw_test_cu_uncue{2}(:,2,:,:)); % 2st obj 2nd Test
+
+% groupave=0 % If we want to calculate A using the group average
+% 
+% if groupave 
+%     for item=1:2
+%         for test=1:2
+%             aCue{item,test}=mean(aCue{item,test}(:,:),2)
+%         end
+%     end   
+% end
+
+%% order the data in standard presentation
+
+ao=deg2rad(cw_resp_cu_uncue{3}(:));
+ao2=abs(2*pi-ao); %move anticlockwise
+ao3=(angdiff(-ao2,-(ones(16,1).*pi*1.5)))+pi;
+
+[bb ind]=sort(ao3);
+
+for item=1:2
+    for test=1:2
+        aCueo{item,test}=aCue{item,test}(ind,:,:);
+        tCueo{item,test}=tCue{item,test}(ind,:,:);
+
+    end
+end
+
+
+%% Obtaining the best parameters
+
+BestParams=nan(size(aCueo{1,1},2),4,2,2);
+CvetIn=-0.5:0.1:0.5;%vector grid search of C
+
+parfor ppp =1:size(aCueo{1,1},2)
+    
+    for item = 1:2
+        for test=1:2
+            
+            aCueI=squeeze(aCueo{item,test}(:,ppp,:));
+            tCueI=squeeze(tCueo{item,test}(:,ppp,:));
+
+                        
+            BestParams(ppp,:,item,test)=gridsearch_jld_trial(aCueI,tCueI,0,0,CvetIn,0.01); % This fuction is the the same as original, but we can add some input (ssqmat only based on accu,granularity for the grid search)
+            
+        end
+    end
+    ppp
+end
+
+%% Changing format
+
+for item = 1:2
+    for test=1:2
+        Params{item,test}= squeeze(BestParams(:,:,item,test));% info about test 1
+        Params{item,test}= squeeze(BestParams(:,:,item,test));% info about test 1
+    end
+end
+
+%% Plotting all parameters
+
+outputlabels={'s (noise)',' A (squircle factor)', 'C (cardinal precision)',' min SSQ'};
+
+figure;
+
+for lp = 1:4
+all{1}= (cat(2,Params{1,1}(:,lp),Params{2,1}(:,lp),Params{1,2}(:,lp),Params{2,2}(:,lp)))
+
+subplot(2,2,lp)
+barplotbias(all{1},[min(all{1}(:)-0.0001),max(all{1}(:))+0.0001],' ',outputlabels{lp},1)
+
+end
+
+
+for lp = 2
+all{1}= (cat(2,Params{1,1}(:,lp),Params{2,1}(:,lp),Params{1,2}(:,lp),Params{2,2}(:,lp)))
+
+end
+
+
+%% C against zero
+
+allc{1}= (cat(2,Params{1,1}(:,3),Params{2,1}(:,3),Params{1,2}(:,3),Params{2,2}(:,3)))
+
+%T test againg 0
+mmm=mean(allc{1}(:,:),2);
+
+h = lillietest(mmm);
+[h,p,ci,stats] = ttest(mmm,0)
+[h,p,ci,stats] = ttest(allc{1},0)
+
+%% C - Linear trend
+
+cc=allc{1}
+
+for ppp = 1:size(cc,1)   
+    
+    tof=[];
+    for c=1:size(cc,2);
+    tof=[tof; cc(ppp,c)];    
+    end
+    
+    [b,dev,stats] = glmfit(1:size(cc,2),tof,'normal');
+    yfit(ppp,:) = polyval([b(2,1),b(1,1)],[1,2,3,4]);
+    
+    ball(ppp) = b(2);
+end
+
+[h,p,ci,stats] = ttest(ball,0)
+
+%% Anova 
+
+addpath '\rm_anova2'
+
+removingout=0
+
+if removingout ==1 %if removing the outlier
+[m I]=max(Params{1,2}(:,4))
+ind = 1:length((Params{1,2}(:,4)))~=I;
+else
+ind = 1:length((Params{1,2}(:,4)))~=0;
+end
+
+a1= (cat(1,Params{1,1}(ind,2),Params{2,1}(ind,2),Params{1,2}(ind,2),Params{2,2}(ind,2))')
+
+
+p=(sum(ind));
+
+S=[1:p,1:p,1:p,1:p];
+F1=[ones(p,1);ones(p,1)*2;ones(p,1);ones(p,1)*2]'
+F2=[ones(p*2,1);ones(p*2,1)*2]'
+FACTNAMES={'item order', 'test order'}
+
+
+stats = rm_anova2(a1,S,F1,F2,FACTNAMES)
+
+
+totalSS=sum([stats{2,2},stats{3,2},stats{4,2},stats{5,2},stats{6,2},stats{7,2}]);
+etaS=[stats{2,2}/totalSS,stats{3,2}/totalSS,stats{4,2}/totalSS]
+
+%% Testing A index vs. 0
+
+all{1}= (cat(2,Params{1,1}(:,2),Params{2,1}(:,2),Params{1,2}(:,2),Params{2,2}(:,2)))
+
+for rrr=1:4
+[h,p,ci,stats] = ttest(all{1}(:,rrr),0)
+ttesre(rrr,1)=stats.tstat;
+ttesre(rrr,2)=p;
+end
+%% Plotting A index (bars)
+
+all{1}= (cat(2,Params{1,1}(:,2),Params{2,1}(:,2),Params{1,2}(:,2),Params{2,2}(:,2)))
+
+names{1}='all'
+
+figure;
+
+for t=1
+    
+    avg=nanmean(all{t},1);
+    sem=std(all{t})/sqrt(size(all{t},1));
+    
+%     subplot(1,3,t)
+    % bar(rot_dif_list,avg);hold on,
+    if groupave
+     
+        plot(avg,'o')
+        
+    else
+    er=errorbar([],avg,sem,sem,'o');
+    er.Color = [0 0 0];
+    er.LineStyle = 'none';
+    end
+%     ylim([0 0.34])
+    xlim([0 5])
+%     line([0,5],[0.5 0.5], 'Color', 'k','LineStyle','--');hold on;
+    
+    xticks([1:4])
+    xticklabels({'ori 1 1st test','ori 2 1st test','ori 1 2nd test','ori 2 2nd test'})
+    
+    % xlabel('distance between 1stcued minus 2nd cued ori (degrees)')
+    ylabel('cardinal repulsion index (bias index)')
+      
+    title(['bias index - ' names{t}])
+    
+end
+
+
+%% Plotting A index (bars) -version 2
+
+figure('Position' ,[100 600 950 600]);
+ax=notBoxPlot(all{1},'style','sdline')
+
+for i=1:4
+ax(i).semPtch.FaceColor = [0.75 0.75 0.75];
+ax(i).semPtch.EdgeColor = [0.75 0.75 0.75];
+ax(i).semPtch.LineWidth = 3;
+ax(i).mu.Color = [0 0 0];
+ax(i).sd.Color = [0 0 0];
+end
+
+ xticks([1:4])
+    xticklabels({'object 1 - test 1','object 2 - test 1','object 1 - test 2','object 2- test 2'})
+        ylim([-0.41 .615])
+        
+        ylabel('A (bias index)')
+       set(gca,'FontSize',13);
+
+
+%% and groupal polar plot per item and test
+
+for item = 1:2
+
+for test=1:2
+    oi=bCueo{item,test};
+    oiac=aCueo{item,test};
+    
+    yourBias=[];
+    yourAccu=[];
+    for ppp=1:size(oi,2)
+        behB=oi(:,ppp)'; %BheaviouralBias
+        
+        s=Params{item,test}(ppp,1);     % noise (in memory/decision-making)
+        A=Params{item,test}(ppp,2);      % Key Parameter (squircle) 0: all circle; 1: all square
+        C=Params{item,test}(ppp,3);      % Reduce noise near cardinal by this factor (1: off)
+        makefig=0;
+        [yourAccu(:,ppp) yourBias(:,ppp)]=squircleBehave2compB(s,A,C,behB,makefig);
+        
+    end
+    counter=1;
+figure;
+    subplot(1,2,counter)
+    
+    quickplotcompBerrors(bb',(yourBias),(oi),['bias - object - '  num2str(item) ' test- ' num2str(test)],1);
+    counter=counter+1,
+
+       set(gca,'FontSize',12);
+
+    
+    subplot(1,2,counter)
+    
+    quickplotcompBerrors(bb',(yourAccu),(oiac),['accuracy - item- ' num2str(item) ' test- ' num2str(test)],0);
+    counter=counter+1,
+
+       set(gca,'FontSize',12);
+    
+end
+end
+
+%%
+bCueor=cat(3,bCueo{1,1},bCueo{1,2},bCueo{2,1},bCueo{2,2});
+avg_bCueor=mean(bCueor,3);
+
+aCueor=cat(3,aCueo{1,1},aCueo{1,2},aCueo{2,1},aCueo{2,2});
+avg_aCueor=mean(aCueor,3);
+
+Paramsr=cat(3,Params{1,1},Params{1,2},Params{2,1},Params{2,2});
+avg_Paramsr=mean(Paramsr,3);
+
+%% and general polar plot of bias (averaged across items and tests)
+
+    oi=avg_bCueor;
+    oiac=avg_aCueor;
+    
+    yourBias=[];
+    yourAccu=[];
+    for ppp=1:size(oi,2)
+        behB=oi(:,ppp)'; %Bevah Bias
+        
+        s=avg_Paramsr(ppp,1);     % noise (in memory/decision-making)
+        A=avg_Paramsr(ppp,2);      % Key Parameter (squircle) 0: all circle; 1: all square
+        C=avg_Paramsr(ppp,3);      % Reduce noise near cardinal by this factor (1: off)
+        makefig=0;
+        [yourAccu(:,ppp) yourBias(:,ppp)]=squircleBehave2compB(s,A,C,behB,makefig);
+        
+    end
+    counter=1;
+figure;
+    
+    quickplotcompBerrors(bb',(yourBias),(oi),['bias'],1);
+    counter=counter+1,
+
+       set(gca,'FontSize',12);
+
+
+    %%
+
+%% subfucntions
+
+function barplotbias(data,yl,tito,yla,beh)
+
+ax=notBoxPlot(data,'style','sdline')
+
+line([0,5], [0,0], 'Color', 'k','LineStyle',':','LineWidth',2);hold on;
+line([2.5,2.5], [-10,10], 'Color', 'k','LineStyle','--','LineWidth',2);hold on;
+
+for i=1:4
+    ax(i).semPtch.FaceColor = [0.75 0.75 0.75];
+    ax(i).semPtch.EdgeColor = [0.75 0.75 0.75];
+    ax(i).semPtch.LineWidth = 3;
+    ax(i).mu.Color = [0 0 0];
+    ax(i).sd.Color = [0 0 0];
+end
+
+xticks([1:4])
+if beh
+xticklabels({'stim 1/test 1','stim 2/test 1','stim 1/test 2','stim 2/test 2'})
+else
+xticklabels({'stim 1/delay 1','stim 2/delay 1','stim 1/delay 2','stim 2/delay 2'})
+end
+xtickangle(45)
+ylim(yl)
+xlim([0.5 4.5])
+ylabel(yla)
+set(gca,'FontSize',20);
+title(tito)
+
+end
+

+ 81 - 0
behavioural_modeling/gridsearch_jld_trial.m

@@ -0,0 +1,81 @@
+%% "Fitting" to human accuary and bias data (grid search) 
+
+% update: squircleBehave2 should now yield A at the exact same scale as in 
+% RSA/RDM-mixtue (see mixvectors.m in old_dev)
+
+function [BestParams]=gridsearch(aCueI,tCueI,sim,ob,CvetIn,granu);
+
+% Input: 
+% aCueI ccw responses (1) and cw (0) per ori (1st dim) and trial (2nd dim)
+% tCueI correct responses in the rest; ccw (1) and cw (0) per ori (1st dim) and trial (2nd dim)
+% sim=1 will replace your data by toy data (useful for parameter recovery
+% etc.). When fitting subjects, use: gridsearch(yourAccu,yourBias,0)
+% ob =1 ssqmat only based on accu
+% granu is the granularity of the grid search
+% Output: fitted params: [s (noise), A (squircle factor), C (cardinal precision), min SSQ] 
+
+%% simulate toy data (replaces yourData, i.e. skip when fitting subjects)
+% can run this directly with "gridsearch(1,1,1)" from command line
+if sim
+    s=0.2;     % noise (in memory/decision-making)
+    A=1;      % Key Parameter (squircle) 0: all circle; 1: all square 
+    C=0.6;      % Reduce noise near cardinal by this factor (1: off)
+    makefig=0;
+    makefigonlybias=1;
+    [yourAccu yourBias]=squircleBehave2(s,A,C,makefig,makefigonlybias);
+end
+
+%% Estimate parameters (grid search)
+
+% Specify parameter grid (compromise granularity <->  computation time) 
+Avec=-1:granu:1;
+svec=0:granu:1;
+Cvec=CvetIn; % to omit Cardinal precision estimation, set Cvec=1
+
+% allocate results mat
+ssqmat=NaN(length(svec),length(Avec),length(Cvec));
+nits=prod(size(ssqmat)); % this many iterations will be in total
+
+% scan the grid
+fig=0; % no plotting on iterations
+fig2=0; % no plotting on iterations
+
+for i=1:length(svec)
+    for j=1:length(Avec)
+        for k=1:length(Cvec)
+            
+            %%
+            [CP_P, CP_N, AccuMix BiasMix]=squircleBehave3(svec(i),Avec(j),Cvec(k),fig,fig2);
+           
+
+SSpt=[];
+for or=1:length(CP_P)
+    
+ %Selecting trials where the correct response for the test was CW (and
+%compare with CP_P
+
+ii=(tCueI(or,:)==1&~isnan(aCueI(or,:)));
+SSpt=[SSpt (CP_P(or)-aCueI(or,ii)).^2];
+
+ %Selecting trials where the correct response for the test was CCW (and
+%compare with CP_N
+
+iii=(tCueI(or,:)==0&~isnan(aCueI(or,:)));
+SSpt=[SSpt (CP_N(or)-aCueI(or,iii)).^2];
+
+end
+
+ssqmat(i,j,k)=sum(SSpt);            
+            
+            
+        end
+    end
+end
+
+% find minimum
+[v,loc] = min(ssqmat(:));
+[ii,jj,k] = ind2sub(size(ssqmat),loc);
+BestParams=[svec(ii) Avec(jj) Cvec(k) min(ssqmat(:))];
+
+end
+    

+ 18 - 0
behavioural_modeling/orivectors.m

@@ -0,0 +1,18 @@
+function [ori oriP oriN]=orivectors(n,d);
+
+    %to be memorized oris (circle representation, "continous" model)
+    ori=linspace(0,360,n+1);
+    ori=ori(1:end-1);            % ori vector in degrees
+    ori=ori+unique(diff(ori))/2; % rotate awyy from cardinal
+    %(I think was by half of the inter-ori distance?)
+    
+    % test oris (CCW and CW)
+    oriP=ori+d; 
+    oriN=ori-d; 
+
+    % make everything radians
+    ori=deg2rad(ori);        
+    oriP=deg2rad(oriP);        
+    oriN=deg2rad(oriN); 
+        
+end

+ 10 - 0
behavioural_modeling/quickplot.m

@@ -0,0 +1,10 @@
+function quickplot(theta,uno,dos,titulo);
+    theta=[theta theta(1)];
+    uno=[uno uno(1)];
+    dos=[dos dos(1)];
+    
+    polarplot(theta,uno,'-o'); hold on;
+    polarplot(theta,dos,'-o'); 
+    polarplot(theta,repmat(0.5,length(uno),1),'k--');
+    rlim([0 1]); title(titulo); legend('Circle','Square','Chance')
+end

+ 15 - 0
behavioural_modeling/quickplot_onlybias.m

@@ -0,0 +1,15 @@
+function quickplot(theta,uno,dos,titulo);
+    theta=[theta theta(1)];
+    uno=[uno uno(1)];
+    dos=[dos dos(1)];
+    
+    polarplot(theta,repmat(0.5,length(uno),1),'r-','LineWidth',2);hold on;
+    polarplot(theta,uno,'k--o','MarkerSize', 8, 'MarkerFaceColor', 'k','LineWidth',1.25); hold on;
+    polarplot(theta,dos,'k--o','MarkerSize', 8,'MarkerFaceColor', 'k','LineWidth',1.25); 
+
+ r=gca;
+    r.FontSize=13;
+    
+        rlim([0 1]); %title(titulo); legend('Circle','Square','Chance')
+
+end

+ 19 - 0
behavioural_modeling/quickplotcompB.m

@@ -0,0 +1,19 @@
+function quickplot(theta,uno,dos,titulo);
+    theta=[theta theta(1)];
+    uno=[uno uno(1)];
+    dos=[dos dos(1)];
+    
+    polarplot(theta,uno,'-o'); hold on;
+    
+    polarplot(theta,dos,'-o'); hold on;
+    polarplot(theta,repmat(0.5,length(uno),1),'k--');hold on;
+    
+
+
+    rlim([0 1]);
+    
+
+
+    title(titulo); %legend('model','behav','Chance')
+    
+end

+ 43 - 0
behavioural_modeling/quickplotcompBerrors.m

@@ -0,0 +1,43 @@
+function quickplotcompBerrors(theta,uno,dos,titulo,legyes,Aave);
+    
+colores=(colormap((summer(3))));
+colores(1,:)=[0.9 0 0.7];
+
+
+theta=[theta theta(1)];
+uno=[uno; uno(1,:)];
+dos=[dos; dos(1,:)];
+
+dat{1}=uno;
+dat{2}=dos;
+    legcoun=2;
+        for i = 1:2
+
+        ap=nanmean(dat{i},2);
+        chance=ap;
+    chance(:)=0.5;
+        sem=nanstd(dat{i},1,2)/sqrt(size(dat{i},2));
+        uppererror=ap+sem;
+        lowerror=ap-sem;
+
+        pl{1}=polarplot(theta,chance,'k--','LineWidth',2);hold on;
+        polarplot(theta,ap,'-','Color',colores(1+i-1,:),'LineWidth',2.5);hold on;
+
+        pl{legcoun}=polarplot(theta,ap,'o','Color',colores(1+i-1,:),'MarkerFaceColor',colores(1+i-1,:),'MarkerSize',8); hold on;
+        legcoun=legcoun+1;
+        if legcoun~=3
+        pl{legcoun}=polarplot(theta,uppererror,'--','Color',colores(1+i-1,:),'LineWidth',2);hold on;
+
+        polarplot(theta,lowerror,'--','Color',colores(1+i-1,:),'LineWidth',2);hold on;
+        end
+        legcoun=legcoun+1;
+        end
+    
+    if legyes
+    legend([pl{1} pl{2} pl{4} pl{5}],'unbiased (B=0)',['model (B=' num2str(Aave) ')'],'mean behaviour','SEM behaviour','Location','SouthOutside')
+    end
+        
+    rlim([0 0.7]);
+    title(titulo); %legend('model','behav','Chance')
+    
+end

+ 24 - 0
behavioural_modeling/rm_anova2/license.txt

@@ -0,0 +1,24 @@
+Copyright (c) 2005, Aaron Schurger
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
+      the documentation and/or other materials provided with the distribution
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.

+ 145 - 0
behavioural_modeling/rm_anova2/rm_anova2.m

@@ -0,0 +1,145 @@
+function stats = rm_anova2(Y,S,F1,F2,FACTNAMES)
+%
+% function stats = rm_anova2(Y,S,F1,F2,FACTNAMES)
+%
+% Two-factor, within-subject repeated measures ANOVA.
+% For designs with two within-subject factors.
+%
+% Parameters:
+%    Y          dependent variable (numeric) in a column vector
+%    S          grouping variable for SUBJECT
+%    F1         grouping variable for factor #1
+%    F2         grouping variable for factor #2
+%    FACTNAMES  a cell array w/ two char arrays: {'factor1', 'factor2'}
+%
+%    Y should be a 1-d column vector with all of your data (numeric).
+%    The grouping variables should also be 1-d numeric, each with same
+%    length as Y. Each entry in each of the grouping vectors indicates the
+%    level # (or subject #) of the corresponding entry in Y.
+%
+% Returns:
+%    stats is a cell array with the usual ANOVA table:
+%      Source / ss / df / ms / F / p
+%
+% Notes:
+%    Program does not do any input validation, so it is up to you to make
+%    sure that you have passed in the parameters in the correct form:
+%
+%       Y, S, F1, and F2 must be numeric vectors all of the same length.
+%
+%       There must be at least one value in Y for each possible combination
+%       of S, F1, and F2 (i.e. there must be at least one measurement per
+%       subject per condition).
+%
+%       If there is more than one measurement per subject X condition, then
+%       the program will take the mean of those measurements.
+%
+% Aaron Schurger (2005.02.04)
+%   Derived from Keppel & Wickens (2004) "Design and Analysis" ch. 18
+%
+
+%
+% Revision history...
+%
+% 11 December 2009 (Aaron Schurger)
+% 
+% Fixed error under "bracket terms"
+% was: expY = sum(Y.^2);
+% now: expY = sum(sum(sum(MEANS.^2)));
+%
+
+stats = cell(4,5);
+
+F1_lvls = unique(F1);
+F2_lvls = unique(F2);
+Subjs = unique(S);
+
+a = length(F1_lvls); % # of levels in factor 1
+b = length(F2_lvls); % # of levels in factor 2
+n = length(Subjs); % # of subjects
+
+INDS = cell(a,b,n); % this will hold arrays of indices
+CELLS = cell(a,b,n); % this will hold the data for each subject X condition
+MEANS = zeros(a,b,n); % this will hold the means for each subj X condition
+
+% Calculate means for each subject X condition.
+% Keep data in CELLS, because in future we may want to allow options for
+% how to compute the means (e.g. leaving out outliers > 3stdev, etc...).
+for i=1:a % F1
+    for j=1:b % F2
+        for k=1:n % Subjs
+            INDS{i,j,k} = find(F1==F1_lvls(i) & F2==F2_lvls(j) & S==Subjs(k));
+            CELLS{i,j,k} = Y(INDS{i,j,k});
+            MEANS(i,j,k) = mean(CELLS{i,j,k});
+        end
+    end
+end
+
+% make tables (see table 18.1, p. 402)
+AB = reshape(sum(MEANS,3),a,b); % across subjects
+AS = reshape(sum(MEANS,2),a,n); % across factor 2
+BS = reshape(sum(MEANS,1),b,n); % across factor 1
+
+A = sum(AB,2); % sum across columns, so result is ax1 column vector
+B = sum(AB,1); % sum across rows, so result is 1xb row vector
+S = sum(AS,1); % sum across columns, so result is 1xs row vector
+T = sum(sum(A)); % could sum either A or B or S, choice is arbitrary
+
+% degrees of freedom
+dfA = a-1;
+dfB = b-1;
+dfAB = (a-1)*(b-1);
+dfS = n-1;
+dfAS = (a-1)*(n-1);
+dfBS = (b-1)*(n-1);
+dfABS = (a-1)*(b-1)*(n-1);
+
+% bracket terms (expected value)
+expA = sum(A.^2)./(b*n);
+expB = sum(B.^2)./(a*n);
+expAB = sum(sum(AB.^2))./n;
+expS = sum(S.^2)./(a*b);
+expAS = sum(sum(AS.^2))./b;
+expBS = sum(sum(BS.^2))./a;
+expY = sum(sum(sum(MEANS.^2))); %sum(Y.^2);
+expT = T^2 / (a*b*n);
+
+% sums of squares
+ssA = expA - expT;
+ssB = expB - expT;
+ssAB = expAB - expA - expB + expT;
+ssS = expS - expT;
+ssAS = expAS - expA - expS + expT;
+ssBS = expBS - expB - expS + expT;
+ssABS = expY - expAB - expAS - expBS + expA + expB + expS - expT;
+ssTot = expY - expT;
+
+% mean squares
+msA = ssA / dfA;
+msB = ssB / dfB;
+msAB = ssAB / dfAB;
+msS = ssS / dfS;
+msAS = ssAS / dfAS;
+msBS = ssBS / dfBS;
+msABS = ssABS / dfABS;
+
+% f statistic
+fA = msA / msAS;
+fB = msB / msBS;
+fAB = msAB / msABS;
+
+% p values
+pA = 1-fcdf(fA,dfA,dfAS);
+pB = 1-fcdf(fB,dfB,dfBS);
+pAB = 1-fcdf(fAB,dfAB,dfABS);
+
+% return values
+stats = {'Source','SS','df','MS','F','p';...
+         FACTNAMES{1}, ssA, dfA, msA, fA, pA;...
+         FACTNAMES{2}, ssB, dfB, msB, fB, pB;...
+         [FACTNAMES{1} ' x ' FACTNAMES{2}], ssAB, dfAB, msAB, fAB, pAB;...
+         [FACTNAMES{1} ' x Subj'], ssAS, dfAS, msAS, [], [];...
+         [FACTNAMES{2} ' x Subj'], ssBS, dfBS, msBS, [], [];...
+         [FACTNAMES{1} ' x ' FACTNAMES{2} ' x Subj'], ssABS, dfABS, msABS, [], []};
+ 
+ return

+ 5 - 0
behavioural_modeling/sigmoid.m

@@ -0,0 +1,5 @@
+function [prob]=sigmoid(x,sigma,lapse)
+     
+    prob=lapse+((1-2*lapse)./(1+exp(-x./sigma)));
+    
+end

+ 68 - 0
behavioural_modeling/squircleBehave2.m

@@ -0,0 +1,68 @@
+%% Probably better version that directly mixes radians
+
+function [AccuMix, BiasMix]=squircleBehave2(s,A,CardPrez,makefig,makefigonlybias)
+  
+%% Settings/prep
+n=16;           % number of equidistant rotations
+testd=6.43;        % +/- displacement of test stims in deg (ask Juan)?
+% % developer settings:
+% s=0.2;         % noise (in memory/decision-making)
+% A=0.2;          % Key Parameter (squircle) 0: all circle; 1: all square 
+% CardPrez=0.6;   % Reduce noise near cardinal by this factor (1: off)
+% makefig=1;
+
+%% Get ori vectors (where oriC is "Circle")
+[oriC, oriP, oriN]=orivectors(n,testd); 
+
+%% Also prepare categorical vector (where oriS is "Square") 
+oriS1=[repmat(45,1,4) repmat(3*45,1,4) repmat(5*45,1,4) repmat(7*45,1,4)]; % cat
+oriS1=deg2rad(oriS1);
+oriS2=[0 0 repmat(90,1,4) repmat(2*90,1,4) repmat(3*90,1,4) 360 360];      % anti-cat
+oriS2=deg2rad(oriS2);
+ 
+% mix oris directly
+if A>=0
+    oriM=A*oriS1+(1-A)*oriC;
+elseif A<0
+    fA=-A; % need to flip since its negative
+    oriM=fA*oriS2+(1-fA)*oriC;
+end
+
+%% Calculate angular distances
+% between mixed ori and test ori:
+dTp=angdiff(oriM,oriP);
+dTn=angdiff(oriM,oriN);
+
+%% (optional) better precision at cardinal   
+sW=repmat([CardPrez 1 1 CardPrez],1,4);
+sW=sW/mean(sW); % ensure that the mean of the vector is 1
+s=s*sW;
+% (this could be decomposed further into horizontal and vertical,
+% but probably better to keep it simple for now)
+
+%% Predict choices under either model
+CP_P=sigmoid(dTp,s,0); % p of sensing "ccw" when test was "ccw" (correct)
+CP_N=sigmoid(dTn,s,0); % p of sensing "ccw" when test was "cw"  (error)
+
+
+%% Accuracy (by objective measures as used in analysis) should be
+AccuMix=(CP_P+(1-CP_N))/2; % for circle this is symmetric
+
+%% Bias should simply be the average of CPs (CW/CCW)
+BiasMix=(CP_P+CP_N)/2;
+
+%% Plots
+% note: I'll put 0° at the right (standard circle)
+if makefig
+    subplot(2,2,1); quickplot(oriC,AccuMix,AccuMix,'Accuracy');
+    subplot(2,2,2); quickplot(oriC,BiasMix,BiasMix,'Bias');
+    plotori=[oriM oriM(1)]; % to draw complete squircle
+    subplot(2,2,[3 4]); polarplot(plotori,ones(1,n+1),'o-');
+    title(['Squircle A=' num2str(A)]); rlim([0 1.5]); 
+    
+elseif makefigonlybias
+    quickplot_onlybias(oriC,BiasMix,BiasMix,'Bias');
+end
+
+end
+

+ 68 - 0
behavioural_modeling/squircleBehave2compB.m

@@ -0,0 +1,68 @@
+%% Probably better version that directly mixes radians
+
+function [AccuMix, BiasMix]=squircleBehave2(s,A,CardPrez,behB,makefig)
+  
+%% Settings/prep
+n=16;           % number of equidistant rotations
+testd=6.43;        % +/- displacement of test stims in deg (ask Juan)?
+% % developer settings:
+% s=0.2;         % noise (in memory/decision-making)
+% A=0.2;          % Key Parameter (squircle) 0: all circle; 1: all square 
+% behB input with behavioural biases
+% CardPrez=0.6;   % Reduce noise near cardinal by this factor (1: off)
+% makefig=1;
+
+%% Get ori vectors (where oriC is "Circle")
+[oriC, oriP, oriN]=orivectors(n,testd); 
+
+%% Also prepare categorical vector (where oriS is "Square") 
+oriS1=[repmat(45,1,4) repmat(3*45,1,4) repmat(5*45,1,4) repmat(7*45,1,4)]; % cat
+oriS1=deg2rad(oriS1);
+oriS2=[0 0 repmat(90,1,4) repmat(2*90,1,4) repmat(3*90,1,4) 360 360];      % anti-cat
+oriS2=deg2rad(oriS2);
+ 
+% mix oris directly
+if A>=0
+    oriM=A*oriS1+(1-A)*oriC;
+elseif A<0
+    fA=-A; % need to flip since its negative
+    oriM=fA*oriS2+(1-fA)*oriC;
+end
+
+%% Calculate angular distances
+% between mixed ori and test ori:
+dTp=angdiff(oriM,oriP);
+dTn=angdiff(oriM,oriN);
+
+%% (optional) better precision at cardinal   
+sW=repmat([CardPrez 1 1 CardPrez],1,4);
+sW=sW/mean(sW); % ensure that the mean of the vector is 1
+s=s*sW;
+% (this could be decomposed further into horizontal and vertical,
+% but probably better to keep it simple for now)
+
+%% Predict choices under either model
+CP_P=sigmoid(dTp,s,0); % p of sensing "ccw" when test was "ccw" (correct)
+CP_N=sigmoid(dTn,s,0); % p of sensing "ccw" when test was "cw"  (error)
+
+
+%% Accuracy (by objective measures as used in analysis) should be
+AccuMix=(CP_P+(1-CP_N))/2; % for circle this is symmetric
+
+%% Bias should simply be the average of CPs (CW/CCW)
+BiasMix=(CP_P+CP_N)/2;
+
+%% Plots
+% note: I'll put 0° at the right (standard circle)
+if makefig
+%     subplot(2,2,1); quickplot(oriC,AccuMix,AccuMix,'Accuracy');
+%     subplot(2,2,2);
+    quickplotcompB(oriC,BiasMix,behB,'Bias');
+
+%     plotori=[oriM oriM(1)]; % to draw complete squircle
+%     subplot(2,2,[3 4]); polarplot(plotori,ones(1,n+1),'o-');
+    title(['Squircle A=' num2str(A)]); rlim([0 1.5]);   
+end
+
+end
+

+ 68 - 0
behavioural_modeling/squircleBehave2trials.m

@@ -0,0 +1,68 @@
+%% Probably better version that directly mixes radians
+
+function [AccuMix, BiasMix]=squircleBehave2(s,A,CardPrez,makefig,makefigonlybias)
+  
+%% Settings/prep
+n=16;           % number of equidistant rotations
+testd=6.43;        % +/- displacement of test stims in deg (ask Juan)?
+%dat % data 1st dim: oris; 2nd dim: trials (accuracy)
+% % developer settings:
+% s=0.2;         % noise (in memory/decision-making)
+% A=0.2;          % Key Parameter (squircle) 0: all circle; 1: all square 
+% CardPrez=0.6;   % Reduce noise near cardinal by this factor (1: off)
+% makefig=1;
+
+%% Get ori vectors (where oriC is "Circle")
+[oriC, oriP, oriN]=orivectors(n,testd); 
+
+%% Also prepare categorical vector (where oriS is "Square") 
+oriS1=[repmat(45,1,4) repmat(3*45,1,4) repmat(5*45,1,4) repmat(7*45,1,4)]; % cat
+oriS1=deg2rad(oriS1);
+oriS2=[0 0 repmat(90,1,4) repmat(2*90,1,4) repmat(3*90,1,4) 360 360];      % anti-cat
+oriS2=deg2rad(oriS2);
+ 
+% mix oris directly
+if A>=0
+    oriM=A*oriS1+(1-A)*oriC;
+elseif A<0
+    fA=-A; % need to flip since its negative
+    oriM=fA*oriS2+(1-fA)*oriC;
+end
+
+%% Calculate angular distances
+% between mixed ori and test ori:
+dTp=angdiff(oriM,oriP);
+dTn=angdiff(oriM,oriN);
+
+%% (optional) better precision at cardinal   
+sW=repmat([CardPrez 1 1 CardPrez],1,4);
+sW=sW/mean(sW); % ensure that the mean of the vector is 1
+s=s*sW;
+% (this could be decomposed further into horizontal and vertical,
+% but probably better to keep it simple for now)
+
+%% Predict choices under either model
+CP_P=sigmoid(dTp,s,0); % p of sensing "ccw" when test was "ccw" (correct)
+CP_N=sigmoid(dTn,s,0); % p of sensing "ccw" when test was "cw"  (error)
+
+%% Accuracy (by objective measures as used in analysis) should be
+AccuMix=(CP_P+(1-CP_N))/2; % for circle this is symmetric
+
+%% Bias should simply be the average of CPs (CW/CCW)
+BiasMix=(CP_P+CP_N)/2;
+
+%% Plots
+% note: I'll put 0° at the right (standard circle)
+if makefig
+    subplot(2,2,1); quickplot(oriC,AccuMix,AccuMix,'Accuracy');
+    subplot(2,2,2); quickplot(oriC,BiasMix,BiasMix,'Bias');
+    plotori=[oriM oriM(1)]; % to draw complete squircle
+    subplot(2,2,[3 4]); polarplot(plotori,ones(1,n+1),'o-');
+    title(['Squircle A=' num2str(A)]); rlim([0 1.5]); 
+    
+elseif makefigonlybias
+    quickplot_onlybias(oriC,BiasMix,BiasMix,'Bias');
+end
+
+end
+

+ 71 - 0
behavioural_modeling/squircleBehave3.m

@@ -0,0 +1,71 @@
+%% Probably better version that directly mixes radians
+
+function [CP_P, CP_N, AccuMix, BiasMix]=squircleBehave2(s,A,CardPrez,makefig,makefigonlybias)
+  
+%% Settings/prep
+n=16;           % number of equidistant rotations
+testd=6.43;        % +/- displacement of test stims in deg (ask Juan)?
+%dat % data 1st dim: oris; 2nd dim: trials (accuracy)
+% % developer settings:
+% s=0.2;         % noise (in memory/decision-making)
+% A=0.2;          % Key Parameter (squircle) 0: all circle; 1: all square 
+% CardPrez=0.6;   % Reduce noise near cardinal by this factor (1: off)
+% makefig=1;
+
+%% Get ori vectors (where oriC is "Circle")
+[oriC, oriP, oriN]=orivectors(n,testd); 
+
+%% Also prepare categorical vector (where oriS is "Square") 
+oriS1=[repmat(45,1,4) repmat(3*45,1,4) repmat(5*45,1,4) repmat(7*45,1,4)]; % cat
+oriS1=deg2rad(oriS1);
+oriS2=[0 0 repmat(90,1,4) repmat(2*90,1,4) repmat(3*90,1,4) 360 360];      % anti-cat
+oriS2=deg2rad(oriS2);
+ 
+% mix oris directly
+if A>=0
+    oriM=A*oriS1+(1-A)*oriC;
+elseif A<0
+    fA=-A; % need to flip since its negative
+    oriM=fA*oriS2+(1-fA)*oriC;
+end
+
+%% Calculate angular distances
+% between mixed ori and test ori:
+dTp=angdiff(oriM,oriP);
+dTn=angdiff(oriM,oriN);
+
+%% (optional) better precision at cardinal   
+
+
+c=exp(CardPrez);
+sW=repmat([c 1 1 c],1,4);
+sW=sW/mean(sW); % ensure that the mean of the vector is 1
+s=s*sW;
+% (this could be decomposed further into horizontal and vertical,
+% but probably better to keep it simple for now)
+
+%% Predict choices under either model
+CP_P=sigmoid(dTp,s,0); % p of sensing "ccw" when test was "ccw" (correct)
+CP_N=sigmoid(dTn,s,0); % p of sensing "ccw" when test was "cw"  (error)
+
+%% Accuracy (by objective measures as used in analysis) should be
+AccuMix=(CP_P+(1-CP_N))/2; % for circle this is symmetric
+
+%% Bias should simply be the average of CPs (CW/CCW)
+BiasMix=(CP_P+CP_N)/2;
+
+%% Plots
+% note: I'll put 0° at the right (standard circle)
+if makefig
+    subplot(2,2,1); quickplot(oriC,AccuMix,AccuMix,'Accuracy');
+    subplot(2,2,2); quickplot(oriC,BiasMix,BiasMix,'Bias');
+    plotori=[oriM oriM(1)]; % to draw complete squircle
+    subplot(2,2,[3 4]); polarplot(plotori,ones(1,n+1),'o-');
+    title(['Squircle A=' num2str(A)]); rlim([0 1.5]); 
+    
+elseif makefigonlybias
+    quickplot_onlybias(oriC,BiasMix,BiasMix,'Bias');
+end
+
+end
+

+ 94 - 0
check_percentage_of_NaN_eyes_2022.m

@@ -0,0 +1,94 @@
+
+mainfolder='U:/LindeDomingoJuan/Memoreye_DATA/'
+partis=good_partis_sub;
+
+perNan=NaN(length(partis),2,2); %Preparing output variable
+
+%%
+for delay=1:2
+    
+    for ppp=1:length(partis)
+        
+        % Loading dataset
+        
+        if delay== 1
+            toload =[mainfolder '/eyelink_preprocessed/mean_recentered_th100/object_1_onset_11_seconds/' partis{ppp,:} '.mat']; %for 1st delay
+        elseif delay==2
+            toload =[mainfolder '/eyelink_preprocessed/mean_recentered_th100/2nd_cue_onset_17_5__seconds/' partis{ppp,:} '.mat']; %for 2nd delay
+        end
+        load(toload)
+        
+        cx=squeeze(data_epoch_thr.eyedat(:,1,:)); %data of channel x
+        cy=squeeze(data_epoch_thr.eyedat(:,2,:)); %data of channel y
+        
+        cxv=cx(:); %data as a vector
+        cyv=cy(:); %data as a vector
+        
+        
+        % Saving the percentage of NaN per epoch.
+        
+        perNan(ppp,1,delay)=(sum(isnan(cxv))/length(cxv))*100;
+        perNan(ppp,2,delay)=(sum(isnan(cyv))/length(cyv))*100;       
+        
+    end
+
+end
+
+
+%%
+
+baddelay1=excludingoutlier(perNan(:,1,1))
+baddelay2=excludingoutlier(perNan(:,1,2))
+
+index=(baddelay1+baddelay2)==0; %keeping only participants that are OK in both epochs
+
+
+%% Making a final list of good participants and saving the file
+    counter=1;
+for ppp = 1:length(good_partis_sub)
+    
+    if index(ppp)==1
+    good_partis{counter} =good_partis_sub{ppp}
+    counter=counter+1;
+    end
+end
+
+%% Plotting results
+
+if figure_NaNs
+
+figure; 
+
+subplot(1,2,1)
+boxplot(squeeze(perNan(:,:,1)))
+ylabel('% of NaN')
+xlabel('channel (x and y)')
+title('delay 1 epoch')
+
+
+subplot(1,2,2)
+boxplot(squeeze(perNan(:,:,2)))
+ylabel('% of NaN')
+xlabel('channel (x and y)')
+title('delay 2epoch')
+
+end
+
+m1=['the max NaN % in delay 1 is ' num2str(max(perNan(index,:,1))) ' and the min is ' num2str(min(perNan(index,:,1)))];
+m2=['the max NaN % in delay 2 is ' num2str(max(perNan(index,:,2))) ' and the min is ' num2str(min(perNan(index,:,2)))];
+
+disp(m1)
+disp(m2)
+
+%%
+
+function output=excludingoutlier(data)
+
+%excluding participants with values >1.5*IQR in the third quartile
+
+ad=squeeze(data(:,1,1));
+r = iqr(ad);
+Q = quantile(ad,[0.75]);
+output=ad>(1.5*r)+Q;
+
+end

+ 191 - 0
circle_figure.m

@@ -0,0 +1,191 @@
+
+clear all;
+
+mainfolder='U:/'
+
+load('good_partis.mat') %list of participant with a good performance
+
+partis=good_partis';
+partis_sub=good_partis';
+
+%% 1st Panel
+
+figure;   
+
+oris=[11.25;33.75;56.25;78.75;101.25;123.75;146.25;168.75;191.25;213.75;236.25;258.75;281.25;303.75;326.25;348.75];
+
+colores=(colormap((hsv(16))));
+colores=[colores(13:16,:);colores(1:4,:);colores(5:8,:);colores(9:12,:);]
+
+rrr=ones(1,16)*1;
+for ooo=1:16
+polarplot(deg2rad(oris(ooo)),rrr(ooo),'wo','MarkerSize',18,'LineWidth',2,'MarkerFaceColor',colores(ooo,:));hold on,
+end
+
+rlim([0.5 1.1])
+oris1=[0 90 180 270]'
+ost=[num2str(oris1)]
+ost(:,4)='°'
+
+thetaticks(oris1)
+thetaticklabels(ost)
+
+ax=gca; 
+ax.ThetaGrid='on';
+ax.RGrid='off';
+ax.RTickLabel=[]; 
+
+set(gca,'FontSize',20);
+set(gca,'color','none');
+
+%% 2nd Panel
+
+%% Uncomment to run from scratch
+
+% %% Parameters to be modify per loop
+% 
+% tobefound{1} = 'find(data_epoch_thr.trialinfo.object_1_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue==1)';
+% tobefound{2} = 'find(data_epoch_thr.trialinfo.object_2_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue==2)';
+% tobefound{3} = 'find(data_epoch_thr.trialinfo.object_2_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue==2)';
+% tobefound{4} = 'find(data_epoch_thr.trialinfo.object_1_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue_uncued==1)';
+% 
+% %%
+% foldlo{1}='eyelink_preprocessed/mean_recentered_th100/object_1_onset_11_seconds/';
+% foldlo{2}='eyelink_preprocessed/mean_recentered_th100/object_1_onset_11_seconds/';
+% foldlo{3}='eyelink_preprocessed/mean_recentered_th100/object_1_onset_11_seconds/';
+% foldlo{4}='eyelink_preprocessed/mean_recentered_th100/2nd_cue_onset_17_5__seconds/';
+% 
+% %%
+% item_id_rsa{1}=nan(length(partis),16,3,5501);
+% item_id_rsa{2}=nan(length(partis),16,3,5501);
+% item_id_rsa{3}=nan(length(partis),16,3,5501);
+% item_id_rsa{4}=nan(length(partis),16,3,8751);
+% %%
+% for fff=1:4
+%     
+%     for ppp=1:length(partis)
+%         
+%         %% Loading dataset
+%         toload =[mainfolder foldlo{fff} partis{ppp,:} '.mat'];
+%         load(toload)
+%         
+%         %Loading logfiles
+%         
+%         subtable=[];
+%         
+%         if strcmp(partis_sub{ppp,:},'p11')
+%             load([mainfolder 'logfiles/resultfile_p11_table_repaired.mat'])
+%             subtable=sub
+%         else
+%             
+%             sub = tdfread([mainfolder 'logfiles/resultfile_' partis_sub{ppp,:} '.txt'],'tab'); %Logfile for this participant
+%             subtable=struct2table(sub);
+%         end
+%         
+%         
+%         
+%         %% Selecting trials per rot only (not ID)
+%         
+%         objlistid=unique(data_epoch_thr.trialinfo.object_1_id);
+%         counter=1;
+%         
+%         objlist=unique(data_epoch_thr.trialinfo.object_1_rot);
+%         
+%         for k =1:length(objlist)
+%             
+%             triales = eval(tobefound{fff});
+%             [t_s_ave{counter}] = squeeze(nanmean(data_epoch_thr.eyedat(triales,:,:),1));
+%             counter=counter+1;
+%             
+%         end
+%         
+%         %% Substracting the mean  per condition (not in this case)
+%               
+%         for k = 1:length(t_s_ave);
+%             
+%             if ~isempty(t_s_ave{k})
+%                 
+%                 rr=(t_s_ave{k});
+%                 item_id_rsa{fff}(ppp,k,:,:)=[rr];
+%                 
+%             elseif isnan(t_s_ave{k})
+%                 item_id_rsa{fff}(ppp,k,1:3,1:size(data_epoch_thr.eyedat,3))=NaN;
+%             end
+%         end
+%         
+%         time{fff}=data_epoch_thr.time;
+%         
+%         %%
+%         
+%     end
+%     
+% end
+% %%
+% 
+% save('circledata.mat','objlist','item_id_rsa', 'time')
+
+%% Load results
+
+load('circledata.mat')
+
+%% Plots
+
+IDs = {'1',' ',' ','4','5',' ',' ','8','9',' ',' ','12','13',' ',' ','16'}
+
+colores=(colormap(flip(hsv(16))));
+
+toi{1} = [400 1000];
+toi{2} = [1400 2000];
+toi{3} = [5350 5850];
+toi{4} = [2350 2850];
+
+titu={'stimulus 1';'stimulus 2';'delay 1';'delay 2';}
+
+figure
+
+for fff=1:4
+    
+    subplot(1,4,fff)
+    
+    ave_item_id_rsa=squeeze(nanmedian(item_id_rsa{fff},1));
+    std_item_id_rsa=squeeze(std(item_id_rsa{fff},1,1));
+    avg_std_item_id_rsa=squeeze(nanmean(std_item_id_rsa(:,1:2,:),2));
+     
+    t1=find(time{1}==toi{fff}(1));
+    t2=find(time{1}==toi{fff}(2));
+    
+    for ppp=1:size(item_id_rsa{fff},1)
+        
+        x=squeeze(mean(item_id_rsa{fff}(ppp,:,1,t1:t2),4));
+        y=squeeze(mean(item_id_rsa{fff}(ppp,:,2,t1:t2).*-1,4));
+        
+        sct=scatter(x,y,60,colores,'filled','MarkerFaceAlpha',.25);hold on;
+        
+    end
+    
+    x=mean(ave_item_id_rsa(:,1,t1:t2),3);
+    y=mean(ave_item_id_rsa(:,2,t1:t2).*-1,3);
+    z=(mean(avg_std_item_id_rsa(:,t1:t2),2)/40)*250;
+    
+    sct=scatter(x,y,z,colores,'filled','MarkerEdgeColor',[1 1 1],...
+        'LineWidth',1.5)
+
+    set(gca,'Color','k')
+   
+    ao=0.8/0.0217;
+    xlim([-ao ao])
+    ylim([-ao ao])
+    
+    pixtovd=0.0217; %pixel to visual degrees
+    
+    set(gca,'XTick',-ao:(ao/2):ao)
+    set(gca,'XTickLabel',(-ao:(ao/2):ao)*pixtovd)
+    set(gca,'YTick',-ao:(ao/2):ao)
+    set(gca,'YTickLabel',(-ao:(ao/2):ao)*pixtovd)
+      
+    title(titu{fff})
+    % ylabel('° vis. angle')
+    xlabel('° vis. angle')   
+    set(gca,'FontSize',20);    
+    
+end

+ 1 - 0
circledata.mat

@@ -0,0 +1 @@
+/annex/objects/MD5-s321253602--dae9749197a6d3254c3bff799968a38e

+ 0 - 0
data_eyelink/.Rhistory


+ 5 - 0
data_eyelink/README.md

@@ -0,0 +1,5 @@
+Important notes
+
+pil01 and pil02 are internal pilots
+
+Dataset with a `pr` at the end of the namefile indicates `practice session` (not analyzed).

+ 16 - 0
data_eyelink/converting_EDF_into_matlab_files.m

@@ -0,0 +1,16 @@
+clear all
+
+addpath(genpath('scripts_bs\'));
+addpath(genpath('edf2mat_toolbox\'));%Important, the edf2mat_toolbox is needed
+
+subjects={'pil01';'pil02';'pi03';'p04';'p05';'p06';'p07';'p08';'p09';...
+    'p10';'p11';'p12';'p13';'p14';'p15';'p16';'p17';'p18';'p19';...
+    'p20';'p21';'p22';'p23';'p24';'p25';'p26';'p27';'p28';'p29';'p30';...
+    'p31';'p32';'p33';'p34';'p35';'p36';'p37';'p38';'p39';'p40';'p41';...
+    'p42';'p43';'p44';'p45';'p46';'p47';'p48';'p49';'p50';'p51';'p52';...
+    'p53';'p54';'p55';'p56';'p57'};
+
+for ppp = 1:length(subjects)
+toload=[subjects{ppp}]
+importeyes(toload)
+end

+ 1 - 0
data_eyelink/p04.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s156516944--f20168b420a6ae309d5c84d4e184e418

+ 1 - 0
data_eyelink/p04pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s20472102--0fc7cc14772accda1eacab17dcc8c6c1

+ 1 - 0
data_eyelink/p05.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s148714992--9bd948cc9599be537147df28c19222ec

+ 1 - 0
data_eyelink/p05pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s11251500--df1b681a11a30ce7e5a6b7e904b2d84a

+ 1 - 0
data_eyelink/p06.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s148389650--3a53b7ce232bc7d7df399e8fca714734

+ 1 - 0
data_eyelink/p06pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s16074960--2cf3ea84b17c681b9f66e3f1e4379dcc

+ 1 - 0
data_eyelink/p07.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s181723375--12f3ae51bee705fb8db097a2d3bcbca9

+ 1 - 0
data_eyelink/p07pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s14178494--8740d51de786ac1e1e976e6c58b6fb72

+ 1 - 0
data_eyelink/p08.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s136317678--93b8c0a6ead016bae555e73b9ca1cb3c

+ 1 - 0
data_eyelink/p08pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s12482820--39d0aef8a1367700c6bcb4459dd66b94

+ 1 - 0
data_eyelink/p09.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s138687992--8412fd74375dc8ac692a3437f885cef4

BIN=BIN
data_eyelink/p09pr.edf


+ 1 - 0
data_eyelink/p10.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s149308285--cec0ec79628cbf048a53ad8474c6377b

+ 1 - 0
data_eyelink/p10pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s14613108--748ae0d8b2c738141b882346f854815e

+ 1 - 0
data_eyelink/p11.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s180824066--33619fe5bdcd66279315edae7bd16459

+ 1 - 0
data_eyelink/p11pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s22047516--2ff41c2e9ba2de51bac737be973f8387

+ 1 - 0
data_eyelink/p12.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s126049566--1ef684824559851a6808aac0aecbeb65

+ 1 - 0
data_eyelink/p12pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s11484585--64d9c6eef1da484d6e186feabd4bf246

+ 1 - 0
data_eyelink/p13.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s137333428--c38dbcb8ca9220cd1beabf0e9c9aab4b

+ 1 - 0
data_eyelink/p13pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s12104277--adc9a24b5e1b11a1b90e1ac0d8b293a3

+ 1 - 0
data_eyelink/p14.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s154399439--b6e09f5fe3cc857159c201bf00463916

+ 1 - 0
data_eyelink/p14pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s17041145--53748c9d697047c43ce39c983e7e3b33

+ 1 - 0
data_eyelink/p15.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s148851746--1b37007a14382ab2aa6f477f8ab47bbd

+ 1 - 0
data_eyelink/p15pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s16176088--c0d1e90d6b5af1f13e3c8a1d6ee10782

+ 1 - 0
data_eyelink/p16.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s154907933--91aee49b751be87f9395bfb2393db519

+ 1 - 0
data_eyelink/p16pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s11396839--25e34f9cc8241b20a695c4d920cdf967

+ 1 - 0
data_eyelink/p17.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s196750129--5d340b31e5bb62a0154a75fbe0b3cabe

+ 1 - 0
data_eyelink/p17pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s11180546--cab7e5661e183a3a9cbb4db480319305

+ 1 - 0
data_eyelink/p18.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s128506357--65338a630362aba6bf67e8f42daf95c6

+ 1 - 0
data_eyelink/p18pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s10879951--9292cbb36107e7139c0ddb5a956bdce4

+ 1 - 0
data_eyelink/p19.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s185307030--93267591122f3e10cf59cc793505ae13

BIN=BIN
data_eyelink/p19pr.edf


+ 1 - 0
data_eyelink/p20.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s159624279--cc29584bcf7e79f3572ffe5024b6da5e

+ 1 - 0
data_eyelink/p20pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s18474149--ad54128760f1b48d3ed694ae5f0f21da

+ 1 - 0
data_eyelink/p21.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s147344948--e437311a19f3e3f4811e5eabc141c7af

+ 1 - 0
data_eyelink/p21pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s17747295--a65803d309badd724f0416a5a9e058eb

+ 1 - 0
data_eyelink/p22.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s122924118--8a06ac48e95c79e81c8862dd289ab209

+ 1 - 0
data_eyelink/p22pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s14713488--3a9d704c6a2351faae7f78d8458309f3

+ 1 - 0
data_eyelink/p23.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s144379410--f94dc8887c733a247ceb6fbe1940597c

+ 1 - 0
data_eyelink/p23pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s15660978--3ef466ebe65e711cc016d0e8249ad56e

+ 1 - 0
data_eyelink/p24.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s144698178--511f80027ce98515f9fa8f71662f1d1f

+ 1 - 0
data_eyelink/p24pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s12833811--2c13afb263cdd6f47d61b156e13e8d2c

+ 1 - 0
data_eyelink/p25.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s162100216--5a633d12ec4a2390781881a19625d0b5

+ 1 - 0
data_eyelink/p25pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s13576264--de883ff7ccaeea821b04c53e7fc68bff

+ 1 - 0
data_eyelink/p26.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s173461385--d651e7de59c43432da15b086b9d3760d

+ 1 - 0
data_eyelink/p26pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s12646902--e275600f42ce6b62b9f0fb6e7f2516ef

+ 1 - 0
data_eyelink/p27.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s160159446--67ae13e5c4886e956a491078dbaa8f98

+ 1 - 0
data_eyelink/p27pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s12464921--473153c4af1e6c1f6798a42147b6220c

+ 1 - 0
data_eyelink/p28.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s132929286--08921e261b7ecb2232bebe3a56d0d139

BIN=BIN
data_eyelink/p28pr.edf


+ 1 - 0
data_eyelink/p29.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s157992365--2e5ef1fd55a96b8d062876f53b403adb

+ 1 - 0
data_eyelink/p29pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s14410386--759d06d27f3746881e1dc4cf0d0ef8fa

+ 1 - 0
data_eyelink/p30.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s161821327--f73cf72188dddb5586bd97859bc3864e

+ 1 - 0
data_eyelink/p30pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s10989399--035e3a1da3c7454909392582911f6d42

+ 1 - 0
data_eyelink/p31.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s148111666--6585f67e1ad37c036b2f0a89f9b929f8

+ 1 - 0
data_eyelink/p31pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s13041591--74ae680a73f2e4fc213f0d702ed5c877

+ 1 - 0
data_eyelink/p32.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s146819500--f9040055beb2d25e648bf8fae26a237a

+ 1 - 0
data_eyelink/p32pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s13270037--ce2adfd645b94b0102046a47a6a9a3c5

+ 1 - 0
data_eyelink/p33.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s130338728--8156247703b68611168c6768d471bf7c

+ 1 - 0
data_eyelink/p33pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s13311894--7f069df640c959949e65406e6683ce40

+ 1 - 0
data_eyelink/p34.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s122702736--35b816813afdb7b4f88004ba6f589743

+ 1 - 0
data_eyelink/p34pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s10879266--5d82d09a927d27dabeea91ea25d9a625

+ 1 - 0
data_eyelink/p35.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s159659198--d76662bc14193ff29f03539271e105d8

+ 1 - 0
data_eyelink/p35pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s11683169--1e122b85673453ad8b83f39ff7086d5c

+ 1 - 0
data_eyelink/p36.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s140091263--c46cab046164468c0189e2fc7af9b236

+ 1 - 0
data_eyelink/p36pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s15959363--85d999621013dac5b481e86861926bf0

+ 1 - 0
data_eyelink/p37.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s130794584--4c4aa1d13eed364f4e705894cd3c1ce8

+ 1 - 0
data_eyelink/p37pr.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s11275282--1c1d117772795cb86eb583d741a0f5ec

+ 1 - 0
data_eyelink/p38a.edf

@@ -0,0 +1 @@
+/annex/objects/MD5-s148417136--0a69d7a27f883f576c9e028f9bf59e26

+ 0 - 0
data_eyelink/p38pr.edf


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio