Commit 961d91c3 authored by Christian Poth's avatar Christian Poth
Browse files

First version for debugging.

parent 80d3ef8b
......@@ -2,12 +2,4 @@
This projects investigates whether alerting effects on reaction and perceptual performance can be dissociated from expectations.
In different blocks of trials, alerting cues either predict that a target is about to appear or that no target is about to appear. This prediction has a validity of 90%, leaving 10% of trials for analyzing the effects of alerting in the case of unpredicted targets.
- 2 blocks (in 4 sessions on separate days): target after alert in 90% of trials vs. target after alert in 10% of trials.
- alert vs. no alert (trial-by-trial)
- in the no alert condition, there is always a target
- 2 (blocks, p(t|alert) = .9 vs. .1) X 2 (alert vs. no alert) X 1000 trials = 4000 trials, 1000 per session
-> p(t|alert) = .9 -> alerting effect: 1000 no alert trials vs. 1000 X 0.9 = 900 alert trials
-> p(t|alert) = .1 -> alerting effect: 1000 no alert trials vs. 1000 X 0.1 = 100 alert trials
\ No newline at end of file
In different blocks of trials, alerting cues either predict that a target is about to appear or that no target is about to appear. This prediction has a validity of 90%, leaving 10% of trials for analyzing the effects of alerting in the case of unpredicted targets.
\ No newline at end of file
......@@ -57,18 +57,17 @@ try
% Setup design.
design = setupDesign(acValid);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Setup waiting times.
wFrFix = readmatrix('wtfix.csv');
wFrTg = readmatrix('wttg.csv');
% Open data file.
saveFolder = fileparts('data/');
fileName = [ptc.expName '_p' num2str(ptc.ptcNo) '_s' num2str(ptc.session) '.dat'];
varNames = {...
'participant' 'session' 'trial' 'practice' 'gabor_amp' 'mask_amp' 'gabor_frq' 'gabor_ori' 'gabor_sig' 'gabor_siz' 'gabor_x' 'gabor_y'...
'ori_rad' 'sac_target_ecc' 'stop_signal_del' 'stop_signal' 'resp' 'correct'...
'vbl_start' 'vbl_fix' 'vbl_sac_target_on' 'vbl_stop_signal_on' 'vbl_stop_signal_off' 'vbl_gabor_on' 'vbl_mask_on' 'vbl_post_on' 'vbl_post_off' 'resp_on' 'vbl_fb_on' 'vbl_fb_off' 'yes_sac' 'fix_error'...
'participant' 'session' 'trial' 'practice' 'cx' 'cy' 'tg_ecc' 'alert' 'tg_yes' 'ac_valid' 'resp' 'rt' 'correct'...
'vbl_start' 'vbl_fix' 'vbl_alert_on' 'vbl_alert_off' 'vbl_target' 'vbl_post_on' 'vbl_post_off'...
};
dataFile = openLog(saveFolder, fileName, varNames);
......@@ -94,12 +93,13 @@ try
% Practice trials.
% --------------------------------------------------------------------------
contr = 0.5; % Run practice trials at this contrast.
for tr = 1:size(design.practice, 1)
trial = trial + 1;
trialDesign = design.practice(tr, :);
isPractice = 1;
[correct, fixError] = runTrial(scr, vis, stim, key, ptc, trial, isPractice, trialDesign, el, aud, pahandle, dataFile, edfFile, saveFolder, contr);
wFix = wFrFix(randi(length(wFrFix), 1, 1);
wTg = wFrTg(randi(length(wFrTg), 1, 1);
[correct, forceCalib] = runTrial(scr, vis, stim, key, ptc, trial, isPractice, trialDesign, el, aud, pahandle, dataFile, edfFile, saveFolder, wFix, wTg);
end
% Instructions after practice.
......@@ -113,13 +113,7 @@ try
fixErrors = [];
calibCnt = 0;
% Setup Quest.
pThreshold = 0.75;
q = QuestCreate(log10(0.5), 3.5, pThreshold, 3.5, 0.01, 0.5);
q.normalizePdf = 1;
% Run trials.
tr = 0;
while tr < nTrial
......@@ -151,14 +145,9 @@ try
end
% Run trial.
contr = 10^QuestQuantile(q);
contr = min(0.5, max(0.004, contr)); % Restrict possible contrasts.
[correct, fixError, forceCalib] = runTrial(scr, vis, stim, key, ptc, trial, isPractice, trialDesign, el, aud, pahandle, dataFile, edfFile, saveFolder, contr);
% Update Quest, if no fixation error.
if ~fixError
q = QuestUpdate(q, log10(contr), correct);
end
wFix = wFrFix(randi(length(wFrFix), 1, 1);
wTg = wFrTg(randi(length(wFrTg), 1, 1);
[correct, forceCalib] = runTrial(scr, vis, stim, key, ptc, trial, isPractice, trialDesign, el, aud, pahandle, dataFile, edfFile, saveFolder, wFix, wTg);
% If fixation error, repeat trial later.
if fixError
......
getwd()
seed(1996)
wtfix <- rgeom(n = 10000, prob = 1/3) * 17 + 85
wttg <- rgeom(n = 10000, prob = 2/5) * 3
hist(wtfix)
min(wtfix)
max(wtfix)
hist(wttg)
min(wttg)
max(wttg)
write.csv(wtfix, file = "wtfix.csv")
write.csv(wttg, file = "wttg.csv")
write.csv(wtfix, file = "wtfix.csv", quote = FALSE, header = FALSE, row.names = FALSE, col.names = FALSE)
write.csv(wttg, file = "wttg.csv", quote = FALSE, header = FALSE, row.names = FALSE, col.names = FALSE)
write.csv(wtfix, file = "wtfix.csv", quote = FALSE, header = FALSE, row.names = FALSE)
write.csv(wtfix, file = "wtfix.csv", quote = FALSE, row.names = FALSE, col.names = FALSE)
write.csv(wttg, file = "wttg.csv", quote = FALSE, row.names = FALSE, col.names = FALSE)
write.table(wtfix, file = "wtfix.csv", sep = ",", quote = FALSE, row.names = FALSE, col.names = FALSE)
write.table(wttg, file = "wttg.csv", sep = ",", quote = FALSE, row.names = FALSE, col.names = FALSE)
200/12
seed(1996)
wtfix <- rgeom(n = 10000, prob = 1/3) * 17 + 85
wttg <- rgeom(n = 10000, prob = 2/5) * 3 + 8
hist(wtfix)
min(wtfix)
max(wtfix)
hist(wttg)
min(wttg)
max(wttg)
write.table(wtfix, file = "wtfix.csv", sep = ",", quote = FALSE, row.names = FALSE, col.names = FALSE)
write.table(wttg, file = "wttg.csv", sep = ",", quote = FALSE, row.names = FALSE, col.names = FALSE)
seed(1996)
wtfix <- rgeom(n = 10000, prob = 1/3) * 17 + 85
wttg <- rgeom(n = 10000, prob = 2/5) * 3 + 8
hist(wtfix)
min(wtfix)
max(wtfix)
hist(wttg)
min(wttg)
max(wttg)
write.table(wtfix, file = "wtfix.csv", sep = ",", quote = FALSE, row.names = FALSE, col.names = FALSE)
write.table(wttg, file = "wttg.csv", sep = ",", quote = FALSE, row.names = FALSE, col.names = FALSE)
seed(1996)
wtfix <- rgeom(n = 10000, prob = 1/3) * 17 + 85
wttg <- rgeom(n = 10000, prob = 2/5) * 3 + 8
hist(wtfix)
min(wtfix)
max(wtfix)
hist(wttg)
min(wttg)
max(wttg)
write.table(wtfix, file = "wtfix.csv", sep = ",", quote = FALSE, row.names = FALSE, col.names = FALSE)
write.table(wttg, file = "wttg.csv", sep = ",", quote = FALSE, row.names = FALSE, col.names = FALSE)
alt_xpc_211005/functions/mainTestInst.png

165 KB | W: | H:

alt_xpc_211005/functions/mainTestInst.png

114 KB | W: | H:

alt_xpc_211005/functions/mainTestInst.png
alt_xpc_211005/functions/mainTestInst.png
alt_xpc_211005/functions/mainTestInst.png
alt_xpc_211005/functions/mainTestInst.png
  • 2-up
  • Swipe
  • Onion skin
function [correct, fixError, forceCalib] = runTrial(scr, vis, stim, key, ptc, trial, isPractice, trialDesign, el, aud, pahandle, dataFile, edfFile, saveFolder, contr)
%function [correct, fixError, forceCalib] = runTrial(scr, vis, stim, key, ptc, trial, isPractice, trialDesign, el, aud, pahandle, dataFile, edfFile, saveFolder, contr)
function [correct, forceCalib] = runTrial(scr, vis, stim, key, ptc, trial, isPractice, trialDesign, el, aud, pahandle, dataFile, edfFile, saveFolder)
%function [correct, forceCalib] = runTrial(scr, vis, stim, key, ptc, trial, isPractice, trialDesign, el, aud, pahandle, dataFile, edfFile, saveFolder)
%
% Christian Poth, 2020, c.poth@uni-bielefeld.de
% Christian Poth, 2021, c.poth@uni-bielefeld.de
% Prepare trial.
% ------------------------------------------------------------------------------
......@@ -12,22 +12,20 @@ eyeUsed = -1;
fixError = 0;
forceCalib = 0;
yesSac = 0;
vblStart = 0;
vblFix = 0;
vblSacTargetOn = 0;
vblStopSignalOn = 0;
vblStopSignalOff = 0;
vblGaborOn = 0;
vblMaskOn = 0;
vblAlertOn = 0;
vblAlertOff = 0;
vblTarget = 0;
respTime = 0;
vblPostOn = 0;
vblPostOff = 0;
vblRespOn = 0;
resp = '?';
resp = 0;
correct = 0;
% Fixation duration.
fixDur = 1 + rand(1)*0.5;
fixDur = (wFix-0.5)*scr.FlipInt;
% Visual stimuli for this trial.
% ------------------------------------------------------------------------------
......@@ -36,42 +34,20 @@ gazeTex = Screen('MakeTexture', scr.win, stim.matGazeStim);
fixPos = CenterRectOnPoint([1 1 size(stim.matGazeStim(:, :, 1))], scr.cx, scr.cy);
Screen('DrawTexture', scr.win, gazeTex, [], fixPos);
stx = scr.cx - va2pix(trialDesign{2}, scr.distance, scr.width, scr.xRes);
sty = scr.cy;
stPos = CenterRectOnPoint([1 1 size(stim.matGazeStim(:, :, 1))], stx, sty);
% Gabor and mask.
pars.amp = contr;
pars.frq = 2;
pars.ori = trialDesign{1};
pars.pha = 2*pi * rand(1);
pars.sig = 0.2;
pars.siz = 1;
maskPars = pars;
maskPars.amp = 0.25; % Mask contrast fixed at this value.
gabor.mat = makeGabor(vis, pars);
gabor.pos = CenterRectOnPoint([1 1 size(gabor.mat)], scr.cx, scr.cy);
gabor.tex = Screen('MakeTexture', scr.win, gabor.mat);
Screen('DrawTexture', scr.win, gabor.tex, [], gabor.pos);
mask.mat = makeOriMask(vis, maskPars);
mask.pos = CenterRectOnPoint([1 1 size(mask.mat)], scr.cx, scr.cy);
mask.tex = Screen('MakeTexture', scr.win, mask.mat);
Screen('DrawTexture', scr.win, mask.tex, [], mask.pos);
% Response stimulus.
respTex = Screen('MakeTexture', scr.win, stim.matRespStim);
respPos = CenterRectOnPoint([1 1 size(stim.matRespStim(:, :, 1))], scr.cx, scr.cy);
Screen('DrawTexture', scr.win, respTex, [], respPos);
tx = scr.cx - va2pix(trialDesign(2), scr.distance, scr.width, scr.xRes);
ty = scr.cy;
if trialDesign(4) % If target should be presented...
tgTex = Screen('MakeTexture', scr.win, stim.matTgStim); ...load the target texture.
else % if no target should be presented...
tgTex = Screen('MakeTexture', scr.win, stim.matNoTgStim); ...load the no-target texture that is blank.
end
tgPos = CenterRectOnPoint([1 1 size(stim.matTgStim(:, :, 1))], tx, ty);
Screen('DrawTexture', scr.win, tgTex, [], tgPos);
% Auditory stimulus for this trial (not needed in the pre-test, we keep this just
% in case there are audio problems, to make sure they are noticed early in the
% first session.
toneFreq = 800;
if trialDesign{4} % Stop signal presented.
tone(1, :) = MakeBeep(toneFreq, 0.0471, aud.freq) * 0.2; % 55 dB(A), TACKLIFE SLM01 sound level meter.
% Auditory stimulus for this trial.
toneFreq = randi([700, 900], 1, 1);
if trialDesign(3) % Stop signal presented.
tone(1, :) = MakeBeep(toneFreq, 0.0471, aud.freq) * 0.2; % ~ dB(A), TACKLIFE SLM01 sound level meter.
else
tone(1, :) = MakeBeep(toneFreq, 0.0471, aud.freq) * 0; % Silent.
end
......@@ -129,196 +105,99 @@ while (GetSecs - vblFix) < fixDur
end
end
end
if ~fixError
if trialDesign{3} == 0
% Saccade target and stop signal simultaneously.
Screen('FillRect', scr.win, vis.bgColor);
Screen('DrawTexture', scr.win, gazeTex, [], stPos);
Screen('DrawingFinished', scr.win);
vblSacTargetOn = Screen('Flip', scr.win);
vblStopSignalOn = vblSacTargetOn;
Eyelink('Message', 'SAC_TARGET_ON');
Eyelink('Message', 'STOP_SIGNAL_ON');
PsychPortAudio('Start', pahandle, 1, 0, 0);
Screen('FillRect', scr.win, vis.bgColor);
Screen('DrawTexture', scr.win, gazeTex, [], stPos);
Screen('DrawingFinished', scr.win);
vblStopSignalOff = Screen('Flip', scr.win, vblStopSignalOn + (4-0.5) * scr.flipInt);
PsychPortAudio('Stop', pahandle, 1, 0, 0);
Eyelink('Message', 'STOP_SIGNAL_OFF');
else
% Saccade target, then stop signal after delay.
Screen('FillRect', scr.win, vis.bgColor);
Screen('DrawTexture', scr.win, gazeTex, [], stPos);
Screen('DrawingFinished', scr.win);
vblSacTargetOn = Screen('Flip', scr.win);
Eyelink('Message', 'SAC_TARGET_ON');
Screen('FillRect', scr.win, vis.bgColor);
Screen('DrawTexture', scr.win, gazeTex, [], stPos);
Screen('DrawingFinished', scr.win);
vblStopSignalOn = Screen('Flip', scr.win, vblSacTargetOn + (trialDesign{3}-0.5)*scr.flipInt);
Eyelink('Message', 'STOP_SIGNAL_ON');
PsychPortAudio('Start', pahandle, 1, 0, 0);
Screen('FillRect', scr.win, vis.bgColor);
Screen('DrawTexture', scr.win, gazeTex, [], stPos);
Screen('DrawingFinished', scr.win);
vblStopSignalOff = Screen('Flip', scr.win, vblStopSignalOn + (4-0.5) * scr.flipInt);
PsychPortAudio('Stop', pahandle, 1, 0, 0);
Eyelink('Message', 'STOP_SIGNAL_OFF');
end
% Gabor.
Screen('FillRect', scr.win, vis.bgColor);
Screen('DrawTexture', scr.win, gazeTex, [], stPos);
Screen('DrawTexture', scr.win, gabor.tex, [], gabor.pos);
Screen('DrawingFinished', scr.win);
vblGaborOn = Screen('Flip', scr.win, vblStopSignalOff + (4-0.5) * scr.flipInt);
Eyelink('Message', 'GABOR_ON');
% Mask.
Screen('FillRect', scr.win, vis.bgColor);
Screen('DrawTexture', scr.win, gazeTex, [], stPos);
Screen('DrawTexture', scr.win, mask.tex, [], mask.pos);
Screen('DrawingFinished', scr.win);
vblMaskOn = Screen('Flip', scr.win, vblGaborOn + (3-0.5) * scr.flipInt);
Eyelink('Message', 'MASK_ON');
% Post interval.
Screen('FillRect', scr.win, vis.bgColor);
vblPostOn = Screen('Flip', scr.win, vblMaskOn + (3-0.5)*scr.flipInt);
Eyelink('Message', 'POST_ON');
% Check if observers moved gaze.
while (GetSecs - vblPostOn) < 0.4
if Eyelink( 'NewFloatSampleAvailable') > 0
evt = Eyelink('NewestFloatSample');
if eyeUsed ~= -1
x = evt.gx(eyeUsed+1); % +1 as we're accessing MATLAB array.
y = evt.gy(eyeUsed+1);
% Valid data and pupil visible?
if x ~= el.MISSING_DATA && y ~= el.MISSING_DATA && evt.pa(eyeUsed+1) > 0
% Does participant fixate target stimulus?
if sqrt( (x-scr.cx)^2 + (y-scr.cy)^2 ) > stim.sacTrigg
Eyelink('Message', 'YES_GAZE_MOVED');
if ~yesSac
yesSac = 1;
end
end
end
else % Find used eye.
eyeUsed = Eyelink('EyeAvailable');
if eyeUsed == el.BINOCULAR; % If both eyes are tracked.
eyeUsed = el.RIGHT_EYE; % Use right eye.
end
end
end
end
% Alert or no alert. Lasts 8 screen refreshes, i.e. 94 ms at 85 Hz.
Screen('FillRect', scr.win, vis.bgColor);
Screen('DrawTexture', scr.win, gazeTex, [], fixPos);
Screen('DrawingFinished', scr.win);
vblAlertOn = Screen('Flip', scr.win);
Eyelink('Message', 'ALERT_ON');
PsychPortAudio('Start', pahandle, 1, 0, 0);
Screen('DrawTexture', scr.win, gazeTex, [], fixPos);
Screen('DrawingFinished', scr.win);
vblAlertOff = Screen('Flip', scr.win, vblAlertOff + (8-0.5) * scr.flipInt);
PsychPortAudio('Stop', pahandle, 1, 0, 0);
Eyelink('Message', 'ALERT_OFF');
vblPostOff = Screen('Flip', scr.win);
Eyelink('Message', 'POST_OFF');
% Target or no target and start of response collection.
Screen('FillRect', scr.win, vis.bgColor);
Screen('DrawTexture', scr.win, gazeTex, [], fixPos);
Screen('DrawTexture', scr.win, tgTex, [], tgPos);
Screen('DrawingFinished', scr.win);
vblTarget = Screen('Flip', scr.win, vblAlertOn + (wTg-0.5)*scr.flipInt);
Eyelink('Message', 'TARGET_ON');
% Response screen.
Screen('FillRect', scr.win, vis.bgColor);
Screen('DrawTexture', scr.win, respTex);
Screen(scr.win,'DrawingFinished');
vblRespOn = Screen('Flip', scr.win);
Eyelink('Message', 'RESP_ON');
while 1
[~, ~, keyCode] = KbCheck;
pressedKey = find(keyCode);
% Escape quits the experiment.
if keyCode(KbName('ESCAPE'))
Screen('FillRect', scr.win, vis.bgColor);
DrawFormattedText(scr.win, 'Experiment abgebrochen (via Escape).', 'center', 'center', [255 0 0]);
Screen('DrawingFinished', scr.win);
Screen('Flip', scr.win);
KbStrokeWait;
WaitSecs(0.1);
Eyelink('StopRecording');
PsychPortAudio('Close');
finishEyeLink(edfFile, saveFolder);
fclose(dataFile);
ShowCursor;
sca;
home;
end
% Check for response keys.
if ~isempty(pressedKey)
if ismember(pressedKey, key.respKeys)
resp = KbName(pressedKey);
break;
end
end
% Response collection.
while (GetSecs - vblTgOn) < 0.8 % Response deadline = 800 ms.
[x, y, buttons] = GetMouse(scr.win);
if sum(buttons) ~= 0
respTime = GetSecs;
Eyelink('Message', 'RESP_MADE');
break
end
end
while KbCheck; end % Wait until KbCheck finished collecting the response.
% Post-response interval.
Screen('FillRect', scr.win, vis.bgColor);
vblPostOn = Screen('Flip', scr.win);
Eyelink('Message', 'POST_ON');
if iscell(resp) % If two keys were pressed, etc.
resp = '?';
% Check keyboard in case experiment is aborted or calibration is forced.
while (GetSecs - vblPostOn) < 1 - 0.5*scr.flipInt
[~, ~, keyCode] = KbCheck;
pressedKey = find(keyCode);
% Escape quits the experiment.
if keyCode(KbName('ESCAPE'))
Screen('FillRect', scr.win, vis.bgColor);
DrawFormattedText(scr.win, 'Experiment abgebrochen (via Escape).', 'center', 'center', [255 0 0]);
Screen('DrawingFinished', scr.win);
Screen('Flip', scr.win);
KbStrokeWait;
WaitSecs(0.1);
Eyelink('StopRecording');
PsychPortAudio('Close');
finishEyeLink(edfFile, saveFolder);
fclose(dataFile);
ShowCursor;
sca;
home;
end
if strcmp(resp, 'c')
% C forces calibration on the next trial.
if keyCode(KbName('C'))
forceCalib = 1;
end
end
vblPostOff = Screen('Flip', scr.win);
Eyelink('Message', 'POST_OFF');
% Feedback regarding saccade or fixation error.
if ~fixError
while KbCheck; end % Wait until KbCheck finished.
if trialDesign{4} && yesSac
fbText = 'Falsch: Auge zur Seite bewegt.';
elseif trialDesign{4} && ~yesSac
fbText = 'Richtig: Auge in Mitte gehalten.';
elseif ~trialDesign{4} && yesSac
fbText = 'Richtig: Auge zur Seite bewegt.';
elseif ~trialDesign{4} && ~yesSac
fbText = 'Falsch: Auge in Mitte gehalten.';
end
% Score response.
if buttons(1) && ~buttons(3)
resp = -1;
elseif ~buttons(1) && buttons(3)
resp = 1;
else
fbText = 'Bitte anfangs zur Mitte schauen.';
resp = 0;
end
Screen('FillRect', scr.win, vis.bgColor);
DrawFormattedText(scr.win, fbText, 'center', scr.cy-40, vis.black);
Screen('DrawingFinished', scr.win);
vblFbOn = Screen('Flip', scr.win);
Eyelink('Message', 'FEEDBACK_ON');
Screen('FillRect', scr.win, vis.bgColor);
Screen('DrawingFinished', scr.win);
vblFbOff = Screen('Flip', scr.win, vblFbOn + (60-0.5)*scr.flipInt);
Eyelink('Message', 'FEEDBACK_OFF');
if trialDesign(2) < 0
correct = (resp == -1)
else
correct = (resp == 1)
end
% Stop recording.
WaitSecs(0.1);
Eyelink('StopRecording');
% Close stimulus textures.
Screen('Close', gazeTex);
Screen('Close', gabor.tex);
Screen('Close', mask.tex);
Screen('Close', respTex);
% Score response.
if pars.ori == (3/4*pi)
correct = strcmp(resp, 'LeftArrow') + 0;
else
correct = strcmp(resp, 'RightArrow') + 0;
end
Screen('Close', tgTex);
% Log data.
% ------------------------------------------------------------------------------
......@@ -329,39 +208,25 @@ fprintf(dataFile, '%d\t', ptc.session);
fprintf(dataFile, '%d\t', trial);
fprintf(dataFile, '%d\t', isPractice);
% Trial variables.
fprintf(dataFile, '%f\t', pars.amp);
fprintf(dataFile, '%f\t', maskPars.amp);
fprintf(dataFile, '%f\t', pars.frq);
fprintf(dataFile, '%f\t', pars.ori);
fprintf(dataFile, '%f\t', pars.sig);
fprintf(dataFile, '%f\t', pars.siz);
fprintf(dataFile, '%d\t', scr.cx);
fprintf(dataFile, '%d\t', scr.cy);
% Trial design.
fprintf(dataFile, '%f\t', trialDesign{1});
fprintf(dataFile, '%d\t', trialDesign{2});
fprintf(dataFile, '%d\t', trialDesign{3});
fprintf(dataFile, '%d\t', trialDesign{4});
fprintf(dataFile, '%d\t', trialDesign(2));
fprintf(dataFile, '%d\t', trialDesign(3));
fprintf(dataFile, '%d\t', trialDesign(4));
fprintf(dataFile, '%f\t', trialDesign(1));
% Response.
fprintf(dataFile, '%s\t', resp);
fprintf(dataFile, '%f\t', respTime);
fprintf(dataFile, '%d\t', correct);
% Timing.
fprintf(dataFile, '%f\t', vblStart);
fprintf(dataFile, '%f\t', vblFix);
fprintf(dataFile, '%f\t', vblSacTargetOn);
fprintf(dataFile, '%f\t', vblStopSignalOn);
fprintf(dataFile, '%f\t', vblStopSignalOff);
fprintf(dataFile, '%f\t', vblGaborOn);
fprintf(dataFile, '%f\t', vblMaskOn);
fprintf(dataFile, '%f\t', vblAlertOn);
fprintf(dataFile, '%f\t', vblAlertOff);
fprintf(dataFile, '%f\t', vblTarget);
fprintf(dataFile, '%f\t', vblPostOn);
fprintf(dataFile, '%f\t', vblPostOff);
fprintf(dataFile, '%f\t', vblRespOn);
fprintf(dataFile, '%f\t', vblFbOn);
fprintf(dataFile, '%f\t', vblFbOff);
% Saccade indicator.
fprintf(dataFile, '%d\t', yesSac);
% Fixation error.
fprintf(dataFile, '%d\n', fixError);
% Send trial variables to the Eyelink.
WaitSecs(0.001);
......@@ -373,38 +238,22 @@ Eyelink('Message', '!V TRIAL_VAR trial %d', trial);
WaitSecs(0.001);
Eyelink('Message', '!V TRIAL_VAR practice %d', isPractice);
WaitSecs(0.001);
Eyelink('Message', '!V TRIAL_VAR gabor_amp %s', num2str(pars.amp));
Eyelink('Message', '!V TRIAL_VAR cx %d', round(scr.cx));
WaitSecs(0.001);
Eyelink('Message', '!V TRIAL_VAR mask_amp %s', num2str(maskPars.amp));
Eyelink('Message', '!V TRIAL_VAR cy %d', round(scr.cy));
WaitSecs(0.001);
Eyelink('Message', '!V TRIAL_VAR gabor_frq %s', num2str(pars.frq));
Eyelink('Message', '!V TRIAL_VAR tg_ecc %d', trialDesign(2));
WaitSecs(0.001);