getPoolStackEyePos.m 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. function poolstackepos=getPoolStackEyePos(subjsData)
  2. opts = struct('WindowStyle','modal','Interpreter','none','Default','No');
  3. answer = questdlg('This requires memory at runtime. Are you sure to continue?','Memory Warning','Yes','No',opts);
  4. if strcmpi(answer,'No'); error('Aborted getting pool stack eye position (consider cleaning workspace).'); end
  5. disp('Loading eye position data...');
  6. subject1=subjsData(1).sbdata;
  7. subject2=subjsData(2).sbdata;
  8. s1s1gbi=getBehavioralInfos(subject1,1); s1s2gbi=getBehavioralInfos(subject1,2);
  9. s1s3gbi=getBehavioralInfos(subject1,3); s1s4gbi=getBehavioralInfos(subject1,4);
  10. s2s1gbi=getBehavioralInfos(subject2,1); s2s2gbi=getBehavioralInfos(subject2,2);
  11. s2s3gbi=getBehavioralInfos(subject2,3); s2s4gbi=getBehavioralInfos(subject2,4);
  12. twLabels={'preoffer1','offer1','delay1','offer2','delay2','startfix','choicego','choicesacc','choicemade'};
  13. %poolstackepos(8,8)=struct('eyePosX',[],'eyePosY',[],'fracR',[]);
  14. poolstackepos(8,8)=struct('eyePosX',[],'eyePosY',[]);
  15. for tw=1:8
  16. currtws1s1get=getEyeTracks(subject1,1,twLabels{tw},twLabels{tw+1});
  17. currtws1s2get=getEyeTracks(subject1,2,twLabels{tw},twLabels{tw+1});
  18. currtws1s3get=getEyeTracks(subject1,3,twLabels{tw},twLabels{tw+1});
  19. currtws1s4get=getEyeTracks(subject1,4,twLabels{tw},twLabels{tw+1});
  20. currtws2s1get=getEyeTracks(subject2,1,twLabels{tw},twLabels{tw+1});
  21. currtws2s2get=getEyeTracks(subject2,2,twLabels{tw},twLabels{tw+1});
  22. currtws2s3get=getEyeTracks(subject2,3,twLabels{tw},twLabels{tw+1});
  23. currtws2s4get=getEyeTracks(subject2,4,twLabels{tw},twLabels{tw+1});
  24. s1s1poolstackepos(tw).eyePosX=currtws1s1get.posX;
  25. s1s2poolstackepos(tw).eyePosX=currtws1s2get.posX;
  26. s1s3poolstackepos(tw).eyePosX=currtws1s3get.posX;
  27. s1s4poolstackepos(tw).eyePosX=currtws1s4get.posX;
  28. s2s1poolstackepos(tw).eyePosX=currtws2s1get.posX;
  29. s2s2poolstackepos(tw).eyePosX=currtws2s2get.posX;
  30. s2s3poolstackepos(tw).eyePosX=currtws2s3get.posX;
  31. s2s4poolstackepos(tw).eyePosX=currtws2s4get.posX;
  32. s1s1poolstackepos(tw).eyePosY=currtws1s1get.posY;
  33. s1s2poolstackepos(tw).eyePosY=currtws1s2get.posY;
  34. s1s3poolstackepos(tw).eyePosY=currtws1s3get.posY;
  35. s1s4poolstackepos(tw).eyePosY=currtws1s4get.posY;
  36. s2s1poolstackepos(tw).eyePosY=currtws2s1get.posY;
  37. s2s2poolstackepos(tw).eyePosY=currtws2s2get.posY;
  38. s2s3poolstackepos(tw).eyePosY=currtws2s3get.posY;
  39. s2s4poolstackepos(tw).eyePosY=currtws2s4get.posY;
  40. end
  41. for tw=1:8
  42. for sn=1:4
  43. poolstackepos(sn,tw).eyePosX= eval(['s1s' num2str(sn) 'poolstackepos(tw).eyePosX']);
  44. poolstackepos(sn,tw).eyePosY= eval(['s1s' num2str(sn) 'poolstackepos(tw).eyePosY']);
  45. poolstackepos(sn+4,tw).eyePosX=eval(['s2s' num2str(sn) 'poolstackepos(tw).eyePosX']);
  46. poolstackepos(sn+4,tw).eyePosY=eval(['s2s' num2str(sn) 'poolstackepos(tw).eyePosY']);
  47. end
  48. end
  49. end