Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions mainScript.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

% Prepare for the output logfiles with all
logFile.extraColumns = cfg.extraColumns;
logFile = saveEventsFile('init', cfg, logFile);
logFile = saveEventsFile('open', cfg, logFile);

disp(cfg);
Expand All @@ -48,7 +49,8 @@

eyeTracker('StartRecording', cfg);

cfg = getExperimentStart(cfg);
% Wait for Trigger from Scanner and add timestamp of experiment onset
cfg.experimentStart = waitForTrigger(cfg);

getResponse('start', cfg.keyboard.responseBox);

Expand All @@ -67,10 +69,8 @@

[thisEvent, thisFixation, cfg] = preTrialSetup(cfg, iBlock, iTrial);

% AVAILABLE IN A NEW RELEASE SOON
%
% eyeTracker('Message', cfg, ...
% ['start_trial-', num2str(iTrial), '_', thisEvent.trial_type]);
eyeTracker('Message', cfg, ...
['start_trial-', num2str(iTrial), '_', thisEvent.trial_type]);

% play the dots and collect onset and duraton of the event
[onset, duration] = doTrial(cfg, thisEvent, thisFixation);
Expand All @@ -79,7 +79,8 @@
thisEvent, ...
iBlock, ...
iTrial, ...
duration, onset, ...
duration, ...
onset, ...
cfg, ...
logFile);

Expand All @@ -89,19 +90,22 @@
% saving in the tsv file
responseEvents = getResponse('check', cfg.keyboard.responseBox, cfg);

responseEvents(1).isStim = logFile.isStim;
responseEvents(1).fileID = logFile.fileID;
responseEvents(1).extraColumns = logFile.extraColumns;
saveEventsFile('save', cfg, responseEvents);

% AVAILABLE IN A NEW RELEASE SOON
%
% eyeTracker('Message', cfg, ...
% ['end_trial-', num2str(iTrial), '_', thisEvent.trial_type]);
eyeTracker('Message', cfg, ...
['end_trial-', num2str(iTrial), '_', thisEvent.trial_type]);

waitFor(cfg, cfg.timing.ISI);

end

eyeTracker('Message', cfg, ['end_block-', num2str(iBlock)]);

waitFor(cfg, cfg.timing.IBI);

end

% End of the run for the BOLD to go down
Expand Down
9 changes: 5 additions & 4 deletions setParameters.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
% Initialize the parameters and general configuration variables
cfg = struct();

% by default the data will be stored in an output folder created where the
% setParamters.m file is
% change that if you want the data to be saved somewhere else
% By default the data will be stored in an output folder created one folder up where the
% setParamters.m file is. with CPP_BIDS 2.3.0 this will change.
% Change that if you want the data to be saved somewhere else,
% below will set it to save the output within the sxperiment folder
cfg.dir.output = fullfile( ...
fileparts(mfilename('fullpath')), '..', ...
fileparts(mfilename('fullpath')), ...
'output');

%% Debug mode settings
Expand Down
1 change: 1 addition & 0 deletions src/preSaveSetup.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

% Save the events txt logfile
% we save event by event so we clear this variable every loop
thisEvent.isStim = logFile.isStim;
thisEvent.fileID = logFile.fileID;
thisEvent.extraColumns = logFile.extraColumns;

Expand Down