diff --git a/mainScript.m b/mainScript.m index 2f3fa11..9c69cd4 100644 --- a/mainScript.m +++ b/mainScript.m @@ -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); @@ -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); @@ -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); @@ -79,7 +79,8 @@ thisEvent, ... iBlock, ... iTrial, ... - duration, onset, ... + duration, ... + onset, ... cfg, ... logFile); @@ -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 diff --git a/setParameters.m b/setParameters.m index 04dd784..24b0c79 100644 --- a/setParameters.m +++ b/setParameters.m @@ -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 diff --git a/src/preSaveSetup.m b/src/preSaveSetup.m index 59d2096..de5fa9a 100644 --- a/src/preSaveSetup.m +++ b/src/preSaveSetup.m @@ -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;