Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

showing_object1_jitter.m 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. OnsetResp=0;
  2. rt_catch = 0;
  3. resp_text = 0;
  4. resp_catch = 'No_Response'; %Just in case we don't have response
  5. % Screen priority
  6. Priority(MaxPriority(window1));
  7. Priority(2);
  8. % Show fixation cross
  9. drawCross(window1,W,H,barColor);
  10. tFixation = Screen('Flip', window1);
  11. Screen(window1, 'FillRect', backgroundColor);
  12. Screen('Flip', window1, tFixation + (fixationDuration + rand(1))- slack,0) %Adding between 0 and 1 second randomly to the minimum for the fixation duration
  13. % Show Object 1
  14. Screen('DrawTexture', window1, objectodisplay, [], positiontodisplay,rottodisplay);
  15. startTime = Screen('Flip', window1); % Start of trial
  16. Onset_object_1 = startTime-ExpStart; %Onset
  17. press_trigger(trigger_object_1,triggers_on);
  18. while GetSecs - startTime < objectTimeout
  19. [keyIsDown,secs,keyCode] = KbCheck;
  20. % ESC key quits the experiment
  21. if keyCode(KbName('Q')) == 1
  22. close all
  23. sca
  24. return;
  25. end
  26. respTime = GetSecs;
  27. pressedKeys = find(keyCode);
  28. % Check for response keys
  29. if ~isempty(pressedKeys)
  30. for i = 1:length(responseKeys)
  31. if KbName(responseKeys{i}) == pressedKeys(1)
  32. break
  33. end
  34. end
  35. end
  36. end
  37. % Empty screen between object offset and next fix cross
  38. % Screen priority
  39. Priority(MaxPriority(window1));
  40. Priority(2);
  41. Screen(window1, 'FillRect', backgroundColor);
  42. Screen('Flip', window1 )
  43. while GetSecs - startTime < postobjectTimeout1
  44. % ESC key quits the experiment
  45. if keyCode(KbName('Q')) == 1
  46. close all
  47. sca
  48. return;
  49. end
  50. [keyIsDown,secs,keyCode] = KbCheck;
  51. respTime = GetSecs;
  52. pressedKeys = find(keyCode);
  53. % Check for response keys
  54. if ~isempty(pressedKeys)
  55. for i = 1:length(responseKeys)
  56. if KbName(responseKeys{i}) == pressedKeys(1)
  57. resp_catch = responseKeys{i};
  58. rt_catch = respTime - startTime;
  59. OnsetResp = GetSecs - ExpStart;
  60. break
  61. end
  62. end
  63. end
  64. end
  65. %%
  66. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  67. %% Subfunctions
  68. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  69. % Draw a fixation cross (overlapping horizontal and vertical bar)
  70. function drawCross(window,W,H,barColor)
  71. if nargin==3
  72. barColor = [0 0 0];
  73. end
  74. barLength = 16; % in pixels
  75. barWidth = 2; % in pixels
  76. %0.5; % number from 0 (black) to 1 (white)
  77. Screen('FillRect', window, barColor,[ (W-barLength)/2 (H-barWidth)/2 (W+barLength)/2 (H+barWidth)/2]);
  78. Screen('FillRect', window, barColor,[ (W-barWidth)/2 (H-barLength)/2 (W+barWidth)/2 (H+barLength)/2]);
  79. end