From c7d3c27cee9cb41b65032854a71025bec2f4fe40 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 1 Oct 2019 14:54:46 -0400 Subject: [PATCH 01/78] Fail to implement 4AFC set-up --- .../AdrianTests/ReversingDotsTestTrials.csv | 17 ++ modularTasks/tasks/AdrianTests/revdots1.log | 149 ++++++++++++++++++ .../tasks/topsTreeNodeTaskReversingDots.m | 48 +++--- 3 files changed, 193 insertions(+), 21 deletions(-) create mode 100644 modularTasks/tasks/AdrianTests/ReversingDotsTestTrials.csv create mode 100644 modularTasks/tasks/AdrianTests/revdots1.log diff --git a/modularTasks/tasks/AdrianTests/ReversingDotsTestTrials.csv b/modularTasks/tasks/AdrianTests/ReversingDotsTestTrials.csv new file mode 100644 index 0000000..af62e93 --- /dev/null +++ b/modularTasks/tasks/AdrianTests/ReversingDotsTestTrials.csv @@ -0,0 +1,17 @@ +direction,coherence,reversal,duration,finalDuration +180,100,0,.4,NaN +180,100,0,.4,NaN +180,100,0,.4,NaN +180,100,0,.4,NaN +180,100,0.2,.4,NaN +180,100,0.2,.4,NaN +180,100,0.2,.4,NaN +180,100,0.2,.4,NaN +0,100,0,.4,NaN +0,100,0,.4,NaN +0,100,0,.4,NaN +0,100,0,.4,NaN +0,100,0.2,.4,NaN +0,100,0.2,.4,NaN +0,100,0.2,.4,NaN +0,100,0.2,.4,NaN diff --git a/modularTasks/tasks/AdrianTests/revdots1.log b/modularTasks/tasks/AdrianTests/revdots1.log new file mode 100644 index 0000000..de42979 --- /dev/null +++ b/modularTasks/tasks/AdrianTests/revdots1.log @@ -0,0 +1,149 @@ +=========== MATLAB CONSOLE OUTPUT ========== +>> launchReversingDots() +(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the +vertical pix2deg of 10.598075 percent. To fix, you can either set your monitor to a mode with +square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are +using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! +(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the +vertical pix2deg of 13.448677 percent. To fix, you can either set your monitor to a mode with +square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are +using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! +dotsMglFlushGauge measuring 100 video refresh cycles. +Warning: topsTreeNodeTopNode named "oneCP" failed: + Index exceeds matrix dimensions. +> In topsTreeNode/run (line 322) + In launchReversingDots (line 20) +Index exceeds matrix dimensions. + +Error in topsSetObjectProperties (line 24) + object.(args{ii}) = args{ii+1}; + +Error in topsTaskHelper/parse (line 204) + topsSetObjectProperties(theObject, [], settings) + +Error in topsTaskHelper/parse (line 170) + specs(nn).object = self.parse(names{nn}, ... + +Error in topsTaskHelper (line 89) + self.theObject = self.parse(p.Results.name, p.Results.fevalable, ... + +Error in topsTaskHelperDrawable (line 20) + self = self@topsTaskHelper(passedArgs{:}); + +Error in topsTaskHelper.makeHelpers (line 533) + helper = feval(constructor, varargin{:}); + +Error in topsTaskHelper.makeHelpers (line 508) + helperStruct = topsTaskHelper.makeHelpers(constructor, + args{:}); + +Error in topsTaskHelperMessage/addGroup (line 150) + theDrawableHelpers = topsTaskHelper.makeHelpers('drawable', + specs); + +Error in topsTaskHelperMessage (line 68) + self.addGroup(ff{:}, p.Unmatched.(ff{:})); + +Error in topsTaskHelper.makeHelpers (line 533) + helper = feval(constructor, varargin{:}); + +Error in topsTaskHelper.makeHelpers (line 508) + helperStruct = topsTaskHelper.makeHelpers(constructor, + args{:}); + +Error in topsTreeNode/addHelpers (line 221) + theHelpers = topsTaskHelper.makeHelpers(constructor, varargin{:}); + +Error in topsTreeNode/addHelpers (line 214) + self.addHelpers(hh{:}, self.(hh{:})); + +Error in topsTreeNodeTask/start (line 153) + self.addHelpers(); + +Error in topsTreeNode/run (line 286) + self.start(); + +Error in topsTreeNode/run (line 313) + self.children{jj}.run(); + +Error in launchReversingDots (line 20) +topNode.run(); + +==== END + + +================ output written to file by the command 'diary' ============= +launchReversingDots() +(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the +vertical pix2deg of 10.598075 percent. To fix, you can either set your monitor to a mode with +square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are +using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! +(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the +vertical pix2deg of 13.448677 percent. To fix, you can either set your monitor to a mode with +square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are +using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! +dotsMglFlushGauge measuring 100 video refresh cycles. +[Warning: topsTreeNodeTopNode named "oneCP" failed: + Index exceeds matrix dimensions.] +[> In topsTreeNode/run (line 322) + In launchReversingDots (line 20)] +{Index exceeds matrix dimensions. + +Error in topsSetObjectProperties (line 24) + object.(args{ii}) = args{ii+1}; + +Error in topsTaskHelper/parse (line 204) + topsSetObjectProperties(theObject, [], settings) + +Error in topsTaskHelper/parse (line 170) + specs(nn).object = self.parse(names{nn}, ... + +Error in topsTaskHelper (line 89) + self.theObject = self.parse(p.Results.name, p.Results.fevalable, ... + +Error in topsTaskHelperDrawable (line 20) + self = self@topsTaskHelper(passedArgs{:}); + +Error in topsTaskHelper.makeHelpers (line 533) + helper = feval(constructor, varargin{:}); + +Error in topsTaskHelper.makeHelpers (line 508) + helperStruct = topsTaskHelper.makeHelpers(constructor, + args{:}); + +Error in topsTaskHelperMessage/addGroup (line 150) + theDrawableHelpers = topsTaskHelper.makeHelpers('drawable', + specs); + +Error in topsTaskHelperMessage (line 68) + self.addGroup(ff{:}, p.Unmatched.(ff{:})); + +Error in topsTaskHelper.makeHelpers (line 533) + helper = feval(constructor, varargin{:}); + +Error in topsTaskHelper.makeHelpers (line 508) + helperStruct = topsTaskHelper.makeHelpers(constructor, + args{:}); + +Error in topsTreeNode/addHelpers (line 221) + theHelpers = topsTaskHelper.makeHelpers(constructor, varargin{:}); + +Error in topsTreeNode/addHelpers (line 214) + self.addHelpers(hh{:}, self.(hh{:})); + +Error in topsTreeNodeTask/start (line 153) + self.addHelpers(); + +Error in topsTreeNode/run (line 286) + self.start(); + +Error in topsTreeNode/run (line 313) + self.children{jj}.run(); + +Error in launchReversingDots (line 20) +topNode.run(); + +} +diary off + +======== END diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots.m index e3a01aa..51da1c1 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots.m @@ -65,7 +65,7 @@ 'finalDuration', []); % dataFieldNames are used to set up the trialData structure - trialDataFields = {'RT', 'choice', 'correct', ... + trialDataFields = {'RT', 'dirChoice', 'cpChoice', 'dirCorrect', 'cpCorrect', ... 'direction', 'coherence', 'randSeedBase', 'fixationOn', ... 'fixationStart', 'targetOn', 'dotsOn', 'finalCPTime', 'dotsOff', ... 'choiceTime', 'blankScreen', 'feedbackOn'}; @@ -92,8 +92,8 @@ 'fevalable', @dotsDrawableTargets, ... 'settings', struct( ... 'nSides', 100, ... - 'width', 1.5.*[1 1], ... - 'height', 1.5.*[1 1])), ... + 'width', 1.5.*[1 1 1 1], ... + 'height', 1.5.*[1 1 1 1])), ... ... ... % Dots drawable settings 'dots', struct( ... @@ -128,9 +128,9 @@ ... % The keyboard events .. 'uiType' is used to conditionally use these depending on the theObject type 'dotsReadableHIDKeyboard', struct( ... 'start', {{@defineEventsFromStruct, struct( ... - 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... - 'component', {'KeyboardSpacebar', 'KeyboardF', 'KeyboardJ'}, ... - 'isRelease', {true, false, false})}}), ... + 'name', {'holdFixation', 'choseTopLeft', 'choseTopRight', 'choseBottomLeft', 'choseBottomRight'}, ... + 'component', {'KeyboardSpacebar', 'KeyboardA', 'KeyboardK', 'KeyboardZ', 'KeyboardM'}, ... + 'isRelease', {true, false, false, false, false})}}), ... ... ... % Gamepad 'dotsReadableHIDGamepad', struct( ... @@ -152,7 +152,7 @@ ... ... Instructions 'Instructions', struct( ... - 'text', {{'Indicate the final dot direction', 'Good luck!'}}, ... + 'text', {{'', ''}}, ... 'duration', 1, ... 'pauseDuration', 0.5, ... 'bgEnd', [0 0 0]), ... @@ -259,9 +259,10 @@ function startTrial(self) % ---- Show information about the task/trial % % Task information - taskString = sprintf('%s (task %d/%d): %d correct, %d error, mean RT=%.2f', ... + taskString = sprintf('%s (task %d/%d): %d dirCorrect, %d cpCorrect, %d dirError, %d cpError, mean RT=%.2f', ... self.name, self.taskID, length(self.caller.children), ... - sum([self.trialData.correct]==1), sum([self.trialData.correct]==0), ... + sum([self.trialData.dirCorrect]==1), sum([self.trialData.cpCorrect]==1), ... + sum([self.trialData.dirCorrect]==0), sum([self.trialData.cpCorrect]==0), ... nanmean([self.trialData.RT])); % Trial information @@ -320,10 +321,10 @@ function finishTrial(self) eh.getSynchronizedTime(frameInfo.onsetTime, true) - trial.dotsOn; % For debugging - disp(sprintf('FLIPPED to %d at time: %.2f planned, %.2f actual', ... + fprintf('FLIPPED to %d at time: %.2f planned, %.2f actual\n', ... self.reversals.directions(self.nextReversal), ... self.reversals.plannedTimes(self.nextReversal), ... - self.reversals.actualTimes(self.nextReversal))) + self.reversals.actualTimes(self.nextReversal)) % update the counter self.nextReversal = self.nextReversal + 1; @@ -368,13 +369,18 @@ function finishTrial(self) nextState = nextStateAfterChoice; % Save the choice - trial.choice = double(strcmp(eventName, 'choseRight')); + trial.dirChoice = double(strcmp(eventName, 'choseTopRight') || ... + strcmp(eventName, 'choseBottomRight')); + trial.cpChoice = double(strcmp(eventName, 'choseTopRight') || ... + strcmp(eventName, 'choseTopLeft')); % Mark as correct/error - trial.correct = double( ... - (trial.choice==0 && cosd(trial.direction)<0) || ... - (trial.choice==1 && cosd(trial.direction)>0)); - + trial.dirCorrect = double( ... + (trial.dirChoice==0 && cosd(trial.direction)<0) || ... + (trial.dirChoice==1 && cosd(trial.direction)>0)); + trial.cpCorrect = double( ... + (trial.cpChoice==0 && trial.reversal == 0) || ... + (trial.cpChoice==1 && trial.reversal ~= 0)); % Save RT trial.RT = RT; @@ -399,9 +405,9 @@ function showFeedback(self) trial = self.getTrial(); % Get feedback message group - if trial.correct == 1 + if trial.dirCorrect * trial.cpCorrect == 1 messageGroup = 'Correct'; - elseif trial.correct == 0 + elseif trial.dirCorrect * trial.cpCorrect == 0 messageGroup = 'Error'; else messageGroup = 'No_choice'; @@ -516,9 +522,9 @@ function prepareDrawables(self) fpX = ensemble.getObjectProperty('xCenter', self.fpIndex); fpY = ensemble.getObjectProperty('yCenter', self.fpIndex); - % Now set the target x,y - ensemble.setObjectProperty('xCenter', [fpX - td, fpX + td], self.targetIndex); - ensemble.setObjectProperty('yCenter', [fpY fpY], self.targetIndex); + % Now set the targets x,y + ensemble.setObjectProperty('xCenter', [fpX - td, fpX + td, fpX - td, fpX + td], self.targetIndex); + ensemble.setObjectProperty('yCenter', [fpY - td, fpY + td, fpY - td, fpY + td], self.targetIndex); end % ---- Save dots properties From b76199044831cf071c07c35c83beb92d81b9d589 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 1 Oct 2019 14:59:36 -0400 Subject: [PATCH 02/78] rename Adrian's version of ReversingDots --- .../tasks/topsTreeNodeTaskReversingDots.m | 48 +- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 629 ++++++++++++++++++ 2 files changed, 650 insertions(+), 27 deletions(-) create mode 100644 modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots.m index 51da1c1..e3a01aa 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots.m @@ -65,7 +65,7 @@ 'finalDuration', []); % dataFieldNames are used to set up the trialData structure - trialDataFields = {'RT', 'dirChoice', 'cpChoice', 'dirCorrect', 'cpCorrect', ... + trialDataFields = {'RT', 'choice', 'correct', ... 'direction', 'coherence', 'randSeedBase', 'fixationOn', ... 'fixationStart', 'targetOn', 'dotsOn', 'finalCPTime', 'dotsOff', ... 'choiceTime', 'blankScreen', 'feedbackOn'}; @@ -92,8 +92,8 @@ 'fevalable', @dotsDrawableTargets, ... 'settings', struct( ... 'nSides', 100, ... - 'width', 1.5.*[1 1 1 1], ... - 'height', 1.5.*[1 1 1 1])), ... + 'width', 1.5.*[1 1], ... + 'height', 1.5.*[1 1])), ... ... ... % Dots drawable settings 'dots', struct( ... @@ -128,9 +128,9 @@ ... % The keyboard events .. 'uiType' is used to conditionally use these depending on the theObject type 'dotsReadableHIDKeyboard', struct( ... 'start', {{@defineEventsFromStruct, struct( ... - 'name', {'holdFixation', 'choseTopLeft', 'choseTopRight', 'choseBottomLeft', 'choseBottomRight'}, ... - 'component', {'KeyboardSpacebar', 'KeyboardA', 'KeyboardK', 'KeyboardZ', 'KeyboardM'}, ... - 'isRelease', {true, false, false, false, false})}}), ... + 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... + 'component', {'KeyboardSpacebar', 'KeyboardF', 'KeyboardJ'}, ... + 'isRelease', {true, false, false})}}), ... ... ... % Gamepad 'dotsReadableHIDGamepad', struct( ... @@ -152,7 +152,7 @@ ... ... Instructions 'Instructions', struct( ... - 'text', {{'', ''}}, ... + 'text', {{'Indicate the final dot direction', 'Good luck!'}}, ... 'duration', 1, ... 'pauseDuration', 0.5, ... 'bgEnd', [0 0 0]), ... @@ -259,10 +259,9 @@ function startTrial(self) % ---- Show information about the task/trial % % Task information - taskString = sprintf('%s (task %d/%d): %d dirCorrect, %d cpCorrect, %d dirError, %d cpError, mean RT=%.2f', ... + taskString = sprintf('%s (task %d/%d): %d correct, %d error, mean RT=%.2f', ... self.name, self.taskID, length(self.caller.children), ... - sum([self.trialData.dirCorrect]==1), sum([self.trialData.cpCorrect]==1), ... - sum([self.trialData.dirCorrect]==0), sum([self.trialData.cpCorrect]==0), ... + sum([self.trialData.correct]==1), sum([self.trialData.correct]==0), ... nanmean([self.trialData.RT])); % Trial information @@ -321,10 +320,10 @@ function finishTrial(self) eh.getSynchronizedTime(frameInfo.onsetTime, true) - trial.dotsOn; % For debugging - fprintf('FLIPPED to %d at time: %.2f planned, %.2f actual\n', ... + disp(sprintf('FLIPPED to %d at time: %.2f planned, %.2f actual', ... self.reversals.directions(self.nextReversal), ... self.reversals.plannedTimes(self.nextReversal), ... - self.reversals.actualTimes(self.nextReversal)) + self.reversals.actualTimes(self.nextReversal))) % update the counter self.nextReversal = self.nextReversal + 1; @@ -369,18 +368,13 @@ function finishTrial(self) nextState = nextStateAfterChoice; % Save the choice - trial.dirChoice = double(strcmp(eventName, 'choseTopRight') || ... - strcmp(eventName, 'choseBottomRight')); - trial.cpChoice = double(strcmp(eventName, 'choseTopRight') || ... - strcmp(eventName, 'choseTopLeft')); + trial.choice = double(strcmp(eventName, 'choseRight')); % Mark as correct/error - trial.dirCorrect = double( ... - (trial.dirChoice==0 && cosd(trial.direction)<0) || ... - (trial.dirChoice==1 && cosd(trial.direction)>0)); - trial.cpCorrect = double( ... - (trial.cpChoice==0 && trial.reversal == 0) || ... - (trial.cpChoice==1 && trial.reversal ~= 0)); + trial.correct = double( ... + (trial.choice==0 && cosd(trial.direction)<0) || ... + (trial.choice==1 && cosd(trial.direction)>0)); + % Save RT trial.RT = RT; @@ -405,9 +399,9 @@ function showFeedback(self) trial = self.getTrial(); % Get feedback message group - if trial.dirCorrect * trial.cpCorrect == 1 + if trial.correct == 1 messageGroup = 'Correct'; - elseif trial.dirCorrect * trial.cpCorrect == 0 + elseif trial.correct == 0 messageGroup = 'Error'; else messageGroup = 'No_choice'; @@ -522,9 +516,9 @@ function prepareDrawables(self) fpX = ensemble.getObjectProperty('xCenter', self.fpIndex); fpY = ensemble.getObjectProperty('yCenter', self.fpIndex); - % Now set the targets x,y - ensemble.setObjectProperty('xCenter', [fpX - td, fpX + td, fpX - td, fpX + td], self.targetIndex); - ensemble.setObjectProperty('yCenter', [fpY - td, fpY + td, fpY - td, fpY + td], self.targetIndex); + % Now set the target x,y + ensemble.setObjectProperty('xCenter', [fpX - td, fpX + td], self.targetIndex); + ensemble.setObjectProperty('yCenter', [fpY fpY], self.targetIndex); end % ---- Save dots properties diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m new file mode 100644 index 0000000..51da1c1 --- /dev/null +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -0,0 +1,629 @@ +classdef topsTreeNodeTaskReversingDots < topsTreeNodeTask + % @class topsTreeNodeTaskReversingDots + % + % Reversing dots (RD) task + % + % For standard configurations, call: + % topsTreeNodeTaskReversingDots.getStandardConfiguration + % + % Otherwise: + % 1. Create an instance directly: + % task = topsTreeNodeTaskReversingDots(); + % + % 2. Set properties. These are required: + % task.screenEnsemble + % task.helpers.readers.theObject + % Others can use defaults + % + % 3. Add this as a child to another topsTreeNode + % + % 8/17/19 created by jig + + properties % (SetObservable) + + % Trial properties. + % + % Set useQuest to a handle to a topsTreeNodeTaskRTDots to use it + % to get coherences + settings = struct( ... + 'useQuest', [], ... + 'valsFromQuest', [], ... % % cor vals on pmf to get + 'targetDistance', 8, ... + 'dotsSeedBase', randi(9999), ... + 'reversalSet', [0.3 0.6 0.9], ... % if reversal<-1 + 'reversalType', 'time'); % 'time' or 'hazard'; see prepareDrawables + + % Timing properties, referenced in statelist + timing = struct( ... + 'fixationTimeout', 5.0, ... + 'holdFixation', 0.5, ... + 'duration', [0.2 0.5 1.0], ... % min mean max + 'finalEpochDuration', [], ... + 'minEpochDuration', 0.1, ... + 'maxEpochDuration', 5.0, ... + 'minimumRT', 0.05, ... + 'showFeedback', 1.0, ... + 'interTrialInterval', 1.0, ... + 'preDots', [0.1 0.3 0.6], ... + 'dotsTimeout', 5.0, ... + 'choiceTimeout', 3.0); + + % Fields below are optional but if found with the given names + % will be used to automatically configure the task + + % Array of structures of independent variables, used by makeTrials + % NOTE that this is the simple way of setting up this struct. You can + % also still use: + % indepdendentVariables = struct( ... + % 'direction', struct('values', [0 180], 'priors', []), ... + % etc. + independentVariables = struct( ... + 'direction', [0 180], ... + 'coherence', 90, ... + 'reversal', [0.2 0.5], ... + 'duration', 1.0, ... + 'finalDuration', []); + + % dataFieldNames are used to set up the trialData structure + trialDataFields = {'RT', 'dirChoice', 'cpChoice', 'dirCorrect', 'cpCorrect', ... + 'direction', 'coherence', 'randSeedBase', 'fixationOn', ... + 'fixationStart', 'targetOn', 'dotsOn', 'finalCPTime', 'dotsOff', ... + 'choiceTime', 'blankScreen', 'feedbackOn'}; + + % Drawables settings + drawable = struct( ... + ... + ... % Stimulus ensemble and settings + 'stimulusEnsemble', struct( ... + ... + ... % Fixation drawable settings + 'fixation', struct( ... + 'fevalable', @dotsDrawableTargets, ... + 'settings', struct( ... + 'xCenter', 0, ... + 'yCenter', 0, ... + 'nSides', 4, ... + 'width', 1.0.*[1.0 0.1], ... + 'height', 1.0.*[0.1 1.0], ... + 'colors', [1 1 1])), ... + ... + ... % Targets drawable settings + 'targets', struct( ... + 'fevalable', @dotsDrawableTargets, ... + 'settings', struct( ... + 'nSides', 100, ... + 'width', 1.5.*[1 1 1 1], ... + 'height', 1.5.*[1 1 1 1])), ... + ... + ... % Dots drawable settings + 'dots', struct( ... + 'fevalable', @dotsDrawableDotKinetogram, ... + 'settings', struct( ... + 'xCenter', 0, ... + 'yCenter', 0, ... + 'coherenceSTD', 10, ... + 'stencilNumber', 1, ... + 'pixelSize', 5, ... + 'diameter', 10, ... + 'density', 180, ... + 'speed', 3)))); + + % Readable settings + readable = struct( ... + ... + ... % The readable object + 'reader', struct( ... + ... + 'copySpecs', struct( ... + ... + ... % The gaze windows + 'dotsReadableEye', struct( ... + 'bindingNames', 'stimulusEnsemble', ... + 'prepare', {{@updateGazeWindows}}, ... + 'start', {{@defineEventsFromStruct, struct( ... + 'name', {'holdFixation', 'breakFixation', 'choseLeft', 'choseRight'}, ... + 'ensemble', {'stimulusEnsemble', 'stimulusEnsemble', 'stimulusEnsemble', 'stimulusEnsemble'}, ... % ensemble object to bind to + 'ensembleIndices', {[1 1], [1 1], [2 1], [2 2]})}}), ... + ... + ... % The keyboard events .. 'uiType' is used to conditionally use these depending on the theObject type + 'dotsReadableHIDKeyboard', struct( ... + 'start', {{@defineEventsFromStruct, struct( ... + 'name', {'holdFixation', 'choseTopLeft', 'choseTopRight', 'choseBottomLeft', 'choseBottomRight'}, ... + 'component', {'KeyboardSpacebar', 'KeyboardA', 'KeyboardK', 'KeyboardZ', 'KeyboardM'}, ... + 'isRelease', {true, false, false, false, false})}}), ... + ... + ... % Gamepad + 'dotsReadableHIDGamepad', struct( ... + 'start', {{@defineEventsFromStruct, struct( ... + 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... + 'component', {'Button1', 'Trigger1', 'Trigger2'}, ... + 'isRelease', {true, false, false})}}), ... + ... + ... % Dummy to run in demo mode + 'dotsReadableDummy', struct( ... + 'start', {{@defineEventsFromStruct, struct( ... + 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... + 'component', {'Dummy1', 'Dummy2', 'Dummy3'})}})))); + + % Feedback messages + message = struct( ... + ... + 'message', struct( ... + ... + ... Instructions + 'Instructions', struct( ... + 'text', {{'', ''}}, ... + 'duration', 1, ... + 'pauseDuration', 0.5, ... + 'bgEnd', [0 0 0]), ... + ... + ... Correct + 'Correct', struct( ... + 'text', {{'Correct', 'y', 6}}, ... + 'images', {{'thumbsUp.jpg', 'y', -6}}, ... + ...%'playable', 'cashRegister.wav', ... + 'bgStart', [0 0.6 0], ... + 'bgEnd', [0 0 0]), ... + ... + ... Error + 'Error', struct( ... + 'text', 'Error', ... + ...%'playable', 'buzzer.wav', ... + 'bgStart', [0.6 0 0], ... + 'bgEnd', [0 0 0]), ... + ... + ... No choice + 'No_choice', struct( ... + 'text', 'No choice - please try again!'))); + end + + properties (SetAccess = protected) + + % Check for changes in properties that require drawables to be recomputed + targetDistance; + + % Reversal directions/times -- precomputed for each trial and then executed. + reversals = struct('directions', [], 'plannedTimes', [], 'actualTimes', []); + + % Keep track of reversals + nextReversal; + + % indices for drawable objects + fpIndex; + targetIndex; + dotsIndex; + end + + methods + + %% Constuctor + % Use topsTreeNodeTask method, which can parse the argument list + % that can set properties (even those nested in structs) + function self = topsTreeNodeTaskReversingDots(varargin) + + % ---- Make it from the superclass + % + self = self@topsTreeNodeTask(varargin{:}); + end + + %% Start task (overloaded) + % + % Put stuff here that you want to do before each time you run this + % task + function startTask(self) + + if ~isempty(self.settings.useQuest) + + % Update independent variable struct using Quest threshold + self.independentVariables.coherence = ... + self.settings.useQuest.getQuestThreshold( ... + self.settings.valsFromQuest); + end + + % ---- Get some useful indices + % + fn = fieldnames(self.drawable.stimulusEnsemble); + self.fpIndex = find(strcmp('fixation', fn)); + self.targetIndex = find(strcmp('targets', fn)); + self.dotsIndex = find(strcmp('dots', fn)); + + % ---- Initialize the state machine + % + self.initializeStateMachine(); + + % ---- Show task-specific instructions + % + self.helpers.message.show('Instructions'); + end + + %% Finish task (overloaded) + % + % Put stuff here that you want to do after each time you run this + % task + function finishTask(self) + end + + %% Start trial + % + % Put stuff here that you want to do before each time you run a trial + function startTrial(self) + + % ---- Prepare components + % + self.prepareDrawables(); + + % ---- Use the task ITI + % + self.interTrialInterval = self.timing.interTrialInterval; + + % ---- Show information about the task/trial + % + % Task information + taskString = sprintf('%s (task %d/%d): %d dirCorrect, %d cpCorrect, %d dirError, %d cpError, mean RT=%.2f', ... + self.name, self.taskID, length(self.caller.children), ... + sum([self.trialData.dirCorrect]==1), sum([self.trialData.cpCorrect]==1), ... + sum([self.trialData.dirCorrect]==0), sum([self.trialData.cpCorrect]==0), ... + nanmean([self.trialData.RT])); + + % Trial information + trial = self.getTrial(); + if ~isempty(self.reversals) + numReversals = length(self.reversals.plannedTimes)-1; + else + numReversals = 0; + end + trialString = sprintf('Trial %d/%d, coh=%.0f, dur=%.2f, nflips=%d', ... + self.trialCount, numel(self.trialData), trial.coherence, ... + trial.duration, numReversals); + + % Show the information on the GUI + self.updateStatus(taskString, trialString); % just update the second one + end + + %% Finish Trial + % + % Could add stuff here + function finishTrial(self) + end + + %% Check for flip + % + % + function next = checkForReversal(self) + + % For now, never return anything + next = ''; + + % Make sure we're reversing + if isempty(self.nextReversal) + return + end + + % Get the trial for timing info + trial = self.getTrial(); + + % Check for reversal + if feval(self.clockFunction) - trial.trialStart - trial.dotsOn >= ... + self.reversals.plannedTimes(self.nextReversal) + + % Reverse! + % + % Set the direction + eh = self.helpers.stimulusEnsemble; + eh.theObject.setObjectProperty('direction', self.reversals.directions(self.nextReversal), ... + self.dotsIndex); + + % Explicitly flip here so we can get the timestamp + frameInfo = eh.theObject.callObjectMethod(@dotsDrawable.drawFrame, {}, [], true); + + % Save the time in SCREEN time + self.reversals.actualTimes(self.nextReversal) = ... + eh.getSynchronizedTime(frameInfo.onsetTime, true) - trial.dotsOn; + + % For debugging + fprintf('FLIPPED to %d at time: %.2f planned, %.2f actual\n', ... + self.reversals.directions(self.nextReversal), ... + self.reversals.plannedTimes(self.nextReversal), ... + self.reversals.actualTimes(self.nextReversal)) + + % update the counter + self.nextReversal = self.nextReversal + 1; + if self.nextReversal > length(self.reversals.plannedTimes) + self.nextReversal = []; + end + end + end + + %% Check for choice + % + % Save choice/RT information and set up feedback for the dots task + function nextState = checkForChoice(self, events, eventTag, nextStateAfterChoice) + + % ---- Check for event + % + eventName = self.helpers.reader.readEvent(events, self, eventTag); + + % Default return + nextState = []; + + % Nothing... keep checking + if isempty(eventName) + return + end + + % Get current task/trial + trial = self.getTrial(); + + % Check for minimum RT, wrt dotsOn for RT, dotsOff for non-RT + RT = trial.choiceTime - trial.dotsOff; + if RT < self.timing.minimumRT + return + end + + % ---- Good choice! + % + % Override completedTrial flag + self.completedTrial = true; + + % Jump to next state when done + nextState = nextStateAfterChoice; + + % Save the choice + trial.dirChoice = double(strcmp(eventName, 'choseTopRight') || ... + strcmp(eventName, 'choseBottomRight')); + trial.cpChoice = double(strcmp(eventName, 'choseTopRight') || ... + strcmp(eventName, 'choseTopLeft')); + + % Mark as correct/error + trial.dirCorrect = double( ... + (trial.dirChoice==0 && cosd(trial.direction)<0) || ... + (trial.dirChoice==1 && cosd(trial.direction)>0)); + trial.cpCorrect = double( ... + (trial.cpChoice==0 && trial.reversal == 0) || ... + (trial.cpChoice==1 && trial.reversal ~= 0)); + % Save RT + trial.RT = RT; + + % Save the final reversal time + if ~isempty(self.reversals) + trial.finalCPTime = self.reversals.actualTimes(end); + end + + % Store the reversal times + topsDataLog.logDataInGroup(self.reversals, 'ReversingDotsReversals'); + + % ---- Re-save the trial + % + self.setTrial(trial); + end + + %% Show feedback + % + function showFeedback(self) + + % Get current task/trial + trial = self.getTrial(); + + % Get feedback message group + if trial.dirCorrect * trial.cpCorrect == 1 + messageGroup = 'Correct'; + elseif trial.dirCorrect * trial.cpCorrect == 0 + messageGroup = 'Error'; + else + messageGroup = 'No_choice'; + end + + % --- Show trial feedback in GUI/text window + % + trialString = ... + sprintf('Trial %d/%d: %s, RT=%.2f', ... + self.trialCount, numel(self.trialData), ... + messageGroup, trial.RT); + self.updateStatus([], trialString); % just update the second one + + % ---- Show trial feedback on the screen + % + self.helpers.message.show(messageGroup, self, 'feedbackOn'); + end + end + + methods (Access = protected) + + %% Prepare drawables for this trial + % + function prepareDrawables(self) + + % ---- Get the current trial and other useful stuff, and set + % values + % + trial = self.getTrial(); + + % Set the seed base for the random number generator + trial.randSeedBase = self.settings.dotsSeedBase; + + % Set the dots duration if not already given in trial struct + if ~isfinite(trial.duration) + trial.duration = self.timing.duration; % Set the dots duration + end + + % Funny value in case we want to control timing after final + % change-point + if ~isfinite(trial.finalDuration) + trial.finalDuration = self.timing.finalEpochDuration; + end + + % ---- Compute reversal times, start/final directions + % + % Defaults -- no flippy! + self.reversals = []; + self.nextReversal = []; + startDirection = trial.direction; + + % Use trial.reversal property + if trial.reversal ~= 0 + + % Setting up reversals array + switch(self.settings.reversalType) + case 'hazard' + + % Interpret "reversal" as fixed hazard rate. + [plannedTimes, trial.duration] = ... + computeChangePoints(trial.reversal, ... + self.timing.minEpochDuration, ... + self.timing.maxEpochDuration, ... + trial.duration, ... + trial.finalDuration); + + otherwise % case 'time' + + % Special case -- check if trial.reversal < 0 ... if so, + % that's just a flag saying to use the set + if trial.reversal < 0 + plannedTimes = self.settings.reversalSet; + else + plannedTimes = trial.reversal; + end + + % Strip unnecessary values + plannedTimes = plannedTimes(plannedTimes 0 + + % Set up reversals struct, with one entry per direction epoch + otherDirection = setdiff(... + self.independentVariables.direction, trial.direction); + self.reversals.directions = repmat(trial.direction, 1, numReversals+1); + self.reversals.directions(end:-2:1) = otherDirection; + self.reversals.plannedTimes = [0 plannedTimes]; + self.reversals.actualTimes = [0 nans(1, numReversals)]; + self.nextReversal = 2; + startDirection = self.reversals.directions(1); + trial.direction = self.reversals.directions(end); + end + end + + % Set the dots duration in the statelist + self.stateMachine.editStateByName('showDots', 'timeout', trial.duration); + + % ---- Possibly update all stimulusEnsemble objects if settings + % changed + % + ensemble = self.helpers.stimulusEnsemble.theObject; + td = self.settings.targetDistance; + if isempty(self.targetDistance) || self.targetDistance ~= td + + % Save current value(s) + self.targetDistance = self.settings.targetDistance; + + % Get target locations relative to fp location + fpX = ensemble.getObjectProperty('xCenter', self.fpIndex); + fpY = ensemble.getObjectProperty('yCenter', self.fpIndex); + + % Now set the targets x,y + ensemble.setObjectProperty('xCenter', [fpX - td, fpX + td, fpX - td, fpX + td], self.targetIndex); + ensemble.setObjectProperty('yCenter', [fpY - td, fpY + td, fpY - td, fpY + td], self.targetIndex); + end + + % ---- Save dots properties + % + ensemble.setObjectProperty('randBase', trial.randSeedBase, self.dotsIndex); + ensemble.setObjectProperty('coherence', trial.coherence, self.dotsIndex); + ensemble.setObjectProperty('direction', startDirection, self.dotsIndex); + + % ---- Prepare to draw dots stimulus + % + ensemble.callObjectMethod(@prepareToDrawInWindow); + + % ---- Save the trial + self.setTrial(trial); + end + + %% Initialize StateMachine + % + function initializeStateMachine(self) + + % ---- Fevalables for state list + % + % blanks = {@dotsTheScreen.blankScreen}; + blanks = {@blankScreen, self, 'blankScreen'}; + % chkuif = {@getNextEvent, self.helpers.reader.theObject, false, {'holdFixation'}}; + chkuif = {@readEvent, self.helpers.reader, {'holdFixation'}, self, 'fixationStart'}; + + chkuib = {}; % {@getNextEvent, self.readables.theObject, false, {}}; % {'brokeFixation'} + chkuic = {@checkForChoice, self, {'choseLeft' 'choseRight'}, 'choiceTime', 'blank'}; + chkrev = {@checkForReversal, self}; + showfx = {@draw, self.helpers.stimulusEnsemble, {self.fpIndex, [self.targetIndex self.dotsIndex]}, self, 'fixationOn'}; + showt = {@draw, self.helpers.stimulusEnsemble, {self.targetIndex, []}, self, 'targetOn'}; + showfb = {@showFeedback, self}; + showd = {@draw,self.helpers.stimulusEnsemble, {self.dotsIndex, []}, self, 'dotsOn'}; + hided = {@draw,self.helpers.stimulusEnsemble, {[], [self.fpIndex self.dotsIndex]}, self, 'dotsOff'}; + + % Drift correction + hfdc = {@reset, self.helpers.reader.theObject, true}; + + % Save values in trialData + % tdhf = {@setTrialDataValue, self, 'holdFixation', value, trialIndex}; + + % Activate/deactivate readable events + sea = @setEventsActiveFlag; + gwfxw = {sea, self.helpers.reader.theObject, 'holdFixation', 'all'}; + gwfxh = {}; + gwts = {sea, self.helpers.reader.theObject, {'choseLeft', 'choseRight'}, 'holdFixation'}; + + % ---- Timing variables, read directly from the timing property struct + % + t = self.timing; + + % ---- Make the state machine. These will be added into the + % stateMachine (in topsTreeNode) + % + states = {... + 'name' 'entry' 'input' 'timeout' 'exit' 'next' ; ... + 'showFixation' showfx {} 0 {} 'waitForFixation' ; ... + 'waitForFixation' gwfxw chkuif t.fixationTimeout {} 'blankNoFeedback' ; ... + 'holdFixation' gwfxh chkuib t.holdFixation hfdc 'showTargets' ; ... + 'showTargets' showt chkuib t.preDots gwts 'preDots' ; ... + 'preDots' {} {} 0 {} 'showDots' ; ... + 'showDots' showd chkrev 0 hided 'waitForChoice' ; ... + 'waitForChoice' {} chkuic t.choiceTimeout {} 'blank' ; ... + 'blank' {} {} 0.2 blanks 'showFeedback' ; ... + 'showFeedback' showfb {} t.showFeedback blanks 'done' ; ... + 'blankNoFeedback' {} {} 0 blanks 'done' ; ... + 'done' {} {} 0 {} '' ; ... + }; + + % Set up the state list with automatic drawing/fipping of the + % objects in stimulusEnsemble in the given list of states + self.addStateMachineWithDrawing(states, ... + 'stimulusEnsemble', {'preDots' 'showDots'}); + + % Turn on state debug flag + % self.debugStates(); + end + end + + methods (Static) + + %% ---- Utility for defining standard configurations + % + % name is string + function task = getStandardConfiguration(name, varargin) + + % ---- Get the task object, with optional property/value pairs + % + task = topsTreeNodeTaskReversingDots(name, varargin{:}); + end + + %% ---- Utility for getting test configuration + % + function task = getTestConfiguration() + + task = topsTreeNodeTaskReversingDots(); + task.timing.minimumRT = 0.3; + task.message.message.Instructions.text = {'Testing', 'topsTreeNodeTaskRTDots'}; + end + end +end From a85037a6e6d52c6a3fc2881ed73ebbd5d5471916 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 1 Oct 2019 15:01:37 -0400 Subject: [PATCH 03/78] update class name for topsTreeNodeTaskReversingDots4AFC --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 51da1c1..134e71c 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -1,5 +1,5 @@ -classdef topsTreeNodeTaskReversingDots < topsTreeNodeTask - % @class topsTreeNodeTaskReversingDots +classdef topsTreeNodeTaskReversingDots4AFC < topsTreeNodeTask + % @class topsTreeNodeTaskReversingDots4AFC % % Reversing dots (RD) task % @@ -17,7 +17,7 @@ % % 3. Add this as a child to another topsTreeNode % - % 8/17/19 created by jig + % 10/01/19 created by aer properties % (SetObservable) @@ -199,7 +199,7 @@ %% Constuctor % Use topsTreeNodeTask method, which can parse the argument list % that can set properties (even those nested in structs) - function self = topsTreeNodeTaskReversingDots(varargin) + function self = topsTreeNodeTaskReversingDots4AFC(varargin) % ---- Make it from the superclass % @@ -614,14 +614,14 @@ function initializeStateMachine(self) % ---- Get the task object, with optional property/value pairs % - task = topsTreeNodeTaskReversingDots(name, varargin{:}); + task = topsTreeNodeTaskReversingDots4AFC(name, varargin{:}); end %% ---- Utility for getting test configuration % function task = getTestConfiguration() - task = topsTreeNodeTaskReversingDots(); + task = topsTreeNodeTaskReversingDots4AFC(); task.timing.minimumRT = 0.3; task.message.message.Instructions.text = {'Testing', 'topsTreeNodeTaskRTDots'}; end From e150564b3953a1ca72a8b1e337263b0200c5b85b Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Thu, 3 Oct 2019 13:26:58 -0400 Subject: [PATCH 04/78] debug session for 4AFC -- dataset 2019_10_03_12_55 --- .../console_log_4AFC_2019_10_03_12_54.log | 951 ++++++++++++++++++ .../tasks/AdrianTests/launchReversingDots.m | 25 + 2 files changed, 976 insertions(+) create mode 100644 modularTasks/tasks/AdrianTests/console_log_4AFC_2019_10_03_12_54.log create mode 100644 modularTasks/tasks/AdrianTests/launchReversingDots.m diff --git a/modularTasks/tasks/AdrianTests/console_log_4AFC_2019_10_03_12_54.log b/modularTasks/tasks/AdrianTests/console_log_4AFC_2019_10_03_12_54.log new file mode 100644 index 0000000..9811e89 --- /dev/null +++ b/modularTasks/tasks/AdrianTests/console_log_4AFC_2019_10_03_12_54.log @@ -0,0 +1,951 @@ +launchReversingDots +(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the +vertical pix2deg of 10.598075 percent. To fix, you can either set your monitor to a mode with +square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are +using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! +(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the +vertical pix2deg of 13.448677 percent. To fix, you can either set your monitor to a mode with +square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are +using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! +dotsMglFlushGauge measuring 100 video refresh cycles. +24 object.(args{ii}) = args{ii+1}; +args + +args = + + Columns 1 through 2 + + 'xCenter' [0] + + Columns 3 through 4 + + 'yCenter' [0] + + Columns 5 through 6 + + 'nSides' [4] + + Column 7 + + 'width' + + Column 8 + + [1x2 double] + + Column 9 + + 'height' + + Column 10 + + [1x2 double] + + Column 11 + + 'colors' + + Column 12 + + [1x3 double] + +size(args) + +ans = + + 1 12 + +1:2:length(args) + +ans = + + 1 3 5 7 9 11 + +object + +object = + + dotsDrawableTargets with properties: + + xCenter: 0 + yCenter: 0 + width: 1 + height: 1 + nSides: 30 + isInscribed: 1 + verticesPerTarget: 30 + x: [30x1 double] + y: [30x1 double] + z: 0 + colors: [1 1 1] + isColorByVertexGroup: 1 + indices: [84x1 double] + pixelSize: 1 + isSmooth: 0 + primitive: 6 + usageHint: 3 + translation: [] + rotation: [] + scaling: [] + attribBufferInfo: [] + isAttribBufferStale: 1 + indexBufferInfo: [] + isIndexBufferStale: 1 + colorBufferInfo: [] + isColorBufferStale: 1 + smoothMap: [10x1 containers.Map] + isVisible: 1 + +for jj=1:2:length(args) +object.(args{jj}) +args{jj+1} +end + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 30 + + +ans = + + 4 + + +ans = + + 1 + + +ans = + + 1.0000 0.1000 + + +ans = + + 1 + + +ans = + + 0.1000 1.0000 + + +ans = + + 1 1 1 + + +ans = + + 1 1 1 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('second iteration') +second iteration +size(args) + +ans = + + 1 12 + +for jj=1:2:length(args) +object.(args{jj}) +args{jj+1} +end + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 30 + + +ans = + + 4 + + +ans = + + 1 + + +ans = + + 1.0000 0.1000 + + +ans = + + 1 + + +ans = + + 0.1000 1.0000 + + +ans = + + 1 1 1 + + +ans = + + 1 1 1 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('third iteration') +third iteration +size(args) + +ans = + + 1 12 + +for jj=1:2:length(args) +object.(args{jj}) +args{jj+1} +end + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 30 + + +ans = + + 4 + + +ans = + + 1 + + +ans = + + 1.0000 0.1000 + + +ans = + + 1 + + +ans = + + 0.1000 1.0000 + + +ans = + + 1 1 1 + + +ans = + + 1 1 1 + +object + +object = + + dotsDrawableTargets with properties: + + xCenter: 0 + yCenter: 0 + width: 1 + height: 1 + nSides: 30 + isInscribed: 1 + verticesPerTarget: 30 + x: [30x1 double] + y: [30x1 double] + z: 0 + colors: [1 1 1] + isColorByVertexGroup: 1 + indices: [84x1 double] + pixelSize: 1 + isSmooth: 0 + primitive: 6 + usageHint: 3 + translation: [] + rotation: [] + scaling: [] + attribBufferInfo: [] + isAttribBufferStale: 1 + indexBufferInfo: [] + isIndexBufferStale: 1 + colorBufferInfo: [] + isColorBufferStale: 1 + smoothMap: [10x1 containers.Map] + isVisible: 1 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('fourth iteration') +fourth iteration +size(args) + +ans = + + 1 12 + +for jj=1:2:length(args) +object.(args{jj}) +args{jj+1} +end + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 4 + + +ans = + + 4 + + +ans = + + 1 + + +ans = + + 1.0000 0.1000 + + +ans = + + 1 + + +ans = + + 0.1000 1.0000 + + +ans = + + 1 1 1 + + +ans = + + 1 1 1 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('fifth iteration') +fifth iteration +size(args) + +ans = + + 1 12 + +for jj=1:2:length(args) +object.(args{jj}) +args{jj+1} +end + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 4 + + +ans = + + 4 + + +ans = + + 1.0000 0.1000 + + +ans = + + 1.0000 0.1000 + + +ans = + + 1 + + +ans = + + 0.1000 1.0000 + + +ans = + + 1 1 1 + + +ans = + + 1 1 1 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('sixth iteration') +sixth iteration +for jj=1:2:length(args) +object.(args{jj}) + +args{jj+1} +end + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 4 + + +ans = + + 4 + + +ans = + + 1.0000 0.1000 + + +ans = + + 1.0000 0.1000 + + +ans = + + 0.1000 1.0000 + + +ans = + + 0.1000 1.0000 + + +ans = + + 1 1 1 + + +ans = + + 1 1 1 + +if system_dependent('IsDebugMode')==1, dbstep out; end +if system_dependent('IsDebugMode')==1, dbcont; end +disp('about to start 1st iteration - 2nd round') +about to start 1st iteration - 2nd round +size(args) + +ans = + + 1 6 + +for jj=1:2:length(args) +object.(args{jj}) +args{jj+1} +end + +ans = + + 30 + + +ans = + + 100 + + +ans = + + 1 + + +ans = + + 1.5000 1.5000 1.5000 1.5000 + + +ans = + + 1 + + +ans = + + 1.5000 1.5000 1.5000 1.5000 + +if system_dependent('IsDebugMode')==1, dbstep out; end +size(args) + +ans = + + 1 6 + +disp('about to start 2nd iteration - 2nd round') +about to start 2nd iteration - 2nd round +for jj=1:2:length(args) +object.(args{jj}) +args{jj+1} +end + +ans = + + 100 + + +ans = + + 100 + + +ans = + + 1 + + +ans = + + 1.5000 1.5000 1.5000 1.5000 + + +ans = + + 1 + + +ans = + + 1.5000 1.5000 1.5000 1.5000 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('about to start 2rd iteration - 2nd round') +about to start 2rd iteration - 2nd round +disp('about to start 3rd iteration - 2nd round') +about to start 3rd iteration - 2nd round +size(args) + +ans = + + 1 6 + +for jj=1:2:length(args) +object.(args{jj}) +args{jj+1} +end + +ans = + + 100 + + +ans = + + 100 + + +ans = + + 1.5000 1.5000 1.5000 1.5000 + + +ans = + + 1.5000 1.5000 1.5000 1.5000 + + +ans = + + 1 + + +ans = + + 1.5000 1.5000 1.5000 1.5000 + +if system_dependent('IsDebugMode')==1, dbstep out; end +if system_dependent('IsDebugMode')==1, dbcont; end +disp('about to start 1st iteration - 3rd round') +about to start 1st iteration - 3rd round +size(args) + +ans = + + 1 16 + +for jj=1:2:length(args) +object.(args{jj}) +args{jj+1} +end + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 0 + + +ans = + + 10 + + +ans = + + 2 + + +ans = + + 1 + + +ans = + + 1 + + +ans = + + 5 + + +ans = + + 5 + + +ans = + + 10 + + +ans = + + 16.7000 + + +ans = + + 180 + + +ans = + + 3 + + +ans = + + 3 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('about to start 2nd iteration - 3rd round') +about to start 2nd iteration - 3rd round +size(args) + +ans = + + 1 16 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('about to start 3rd iteration - 3rd round') +about to start 3rd iteration - 3rd round +size(args) + +ans = + + 1 16 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('about to start 4ht iteration - 3rd round') +about to start 4ht iteration - 3rd round +size(args) + +ans = + + 1 16 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('about to start 5th iteration - 3rd round') +about to start 5th iteration - 3rd round +size(args) + +ans = + + 1 16 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('about to start 6th iteration - 3rd round') +about to start 6th iteration - 3rd round +size(args) + +ans = + + 1 16 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('about to start 7th iteration - 3rd round') +about to start 7th iteration - 3rd round +size(args) + +ans = + + 1 16 + +if system_dependent('IsDebugMode')==1, dbstep out; end +disp('about to start 8th iteration - 3rd round') +about to start 8th iteration - 3rd round +size(args) + +ans = + + 1 16 + +if system_dependent('IsDebugMode')==1, dbstep out; end +if system_dependent('IsDebugMode')==1, dbcont; end +disp('about to start 1st iteration - 4th round') +about to start 1st iteration - 4th round +size(args) + +ans = + + 1 4 + +if system_dependent('IsDebugMode')==1, dbstep out; end +size(args) + +ans = + + 1 4 + +if system_dependent('IsDebugMode')==1, dbstep out; end +if system_dependent('IsDebugMode')==1, dbcont; end +disp('about to start 1st iteration - 5th round') +about to start 1st iteration - 5th round +size(args) + +ans = + + 1 4 + +if system_dependent('IsDebugMode')==1, dbstep out; end +size(args) + +ans = + + 1 4 + +if system_dependent('IsDebugMode')==1, dbstep out; end +if system_dependent('IsDebugMode')==1, dbcont; end +disp('about to start 1st iteration - 6th round') +about to start 1st iteration - 6th round +size(args) + +ans = + + 1 2 + +for jj=1:2:length(args) +object.(args{jj}) +args{jj+1} +end + +ans = + + '' + + + +ans = + +Error + +args + +args = + + 'string' 'Error' + +if system_dependent('IsDebugMode')==1, dbstep out; end +if system_dependent('IsDebugMode')==1, dbcont; end +disp('about to start 1st iteration - 7th round') +about to start 1st iteration - 7th round +size(args) + +ans = + + 1 3 + +args + +args = + + 'string' 'y' [1.5000] + +object + +object = + + dotsDrawableText with properties: + + x: 0 + y: 0 + string: '' + color: [255 255 255] + rotation: 0 + isFlippedHorizontal: 0 + isFlippedVertical: 0 + typefaceName: 'Helvetica' + fontSize: 64 + isBold: 0 + isItalic: 0 + isUnderline: 0 + isStrikethrough: 0 + textureInfo: [] + isTextureStale: 1 + isVisible: 1 + +diary off diff --git a/modularTasks/tasks/AdrianTests/launchReversingDots.m b/modularTasks/tasks/AdrianTests/launchReversingDots.m new file mode 100644 index 0000000..e365585 --- /dev/null +++ b/modularTasks/tasks/AdrianTests/launchReversingDots.m @@ -0,0 +1,25 @@ +function launchReversingDots() +% function to launch Reversing Dots task while I am designing it -- aer + +topNode = topsTreeNodeTopNode('oneCP'); + +topNode.addHelpers('screenEnsemble', ... + 'displayIndex', 0, ... + 'remoteDrawing', false, ... + 'topNode', topNode); + +topNode.addReadable('dotsReadableHIDKeyboard'); + +pauseBeforeTask = -1; % -1 means wait for keypress -- see topsTreeNode.pauseBeforeTask + +cpDotsTask = topsTreeNodeTaskReversingDots4AFC('cpDots'); +cpDotsTask.taskID = 1; +cpDotsTask.independentVariables='ReversingDotsTestTrials.csv'; +cpDotsTask.trialIterationMethod='sequential'; +cpDotsTask.pauseBeforeTask = pauseBeforeTask; +topNode.addChild(cpDotsTask); + +topNode.run(); + +% csvfile = 'completedReversingDots4AFCtrials.csv'; +% topNode.children{1}.saveTrials(csvfile, 'all'); From c2923d9e3beb1ccf10a3a8248e0297fd7d84a219 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Thu, 3 Oct 2019 13:38:20 -0400 Subject: [PATCH 05/78] 4AFC task runs -- with bugs for targets and response keys --- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 134e71c..506255d 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -152,7 +152,7 @@ ... ... Instructions 'Instructions', struct( ... - 'text', {{'', ''}}, ... + 'text', {{'bleble', 'blabla'}}, ... 'duration', 1, ... 'pauseDuration', 0.5, ... 'bgEnd', [0 0 0]), ... From 19eee8fa4616e64a46358d767b136c347c0e4d8e Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Mon, 7 Oct 2019 14:44:20 -0400 Subject: [PATCH 06/78] silence console output in dotsDrawableDotKinetogram.m --- snow-dots/classes/drawable/dotsDrawableDotKinetogram.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m index 99fb5a4..a2849eb 100755 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m @@ -132,7 +132,7 @@ % Compute some parameters and create a circular aperture texture. function prepareToDrawInWindow(self) - disp('HERE') + %disp('HERE') % Get the frame rate -- rounding to nearest 10 to avoid % problems with keeping track of random positions when there % are slight differences in frame rate From 9552eb7f1517ad8570eba5641969dcd73ae478cc Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Mon, 7 Oct 2019 14:51:59 -0400 Subject: [PATCH 07/78] targets and keys behave ok --- modularTasks/tasks/AdrianTests/extract_timestamp.m | 7 +++++++ .../tasks/AdrianTests/launchReversingDots.m | 14 +++++++++++--- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 8 ++++---- 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 modularTasks/tasks/AdrianTests/extract_timestamp.m diff --git a/modularTasks/tasks/AdrianTests/extract_timestamp.m b/modularTasks/tasks/AdrianTests/extract_timestamp.m new file mode 100644 index 0000000..d3d52d8 --- /dev/null +++ b/modularTasks/tasks/AdrianTests/extract_timestamp.m @@ -0,0 +1,7 @@ +function ts = extract_timestamp(tn) +% returns the timestamp as a string 'YYYY_MM_DD_HH_mm' associated with +% the topsTreeNodeTopNode object tn +ts = regexprep(tn.filename, ... + '[^[0-9]{4}_[0-9]{2}_[0-9]{2}_[0-9]{2}_[0-9]{2}]', ''); +ts = ts(1:16); +end \ No newline at end of file diff --git a/modularTasks/tasks/AdrianTests/launchReversingDots.m b/modularTasks/tasks/AdrianTests/launchReversingDots.m index e365585..ea333f0 100644 --- a/modularTasks/tasks/AdrianTests/launchReversingDots.m +++ b/modularTasks/tasks/AdrianTests/launchReversingDots.m @@ -4,7 +4,7 @@ function launchReversingDots() topNode = topsTreeNodeTopNode('oneCP'); topNode.addHelpers('screenEnsemble', ... - 'displayIndex', 0, ... + 'displayIndex', 1, ... 'remoteDrawing', false, ... 'topNode', topNode); @@ -21,5 +21,13 @@ function launchReversingDots() topNode.run(); -% csvfile = 'completedReversingDots4AFCtrials.csv'; -% topNode.children{1}.saveTrials(csvfile, 'all'); +timestamp = extract_timestamp(topNode); + +csvfile = ... + ['/Users/adrian/Documents/MATLAB/toolboxes/Lab_Matlab_Control/', ... + 'modularTasks/tasks/AdrianTests/', ... + 'completedReversingDots4AFCtrials_', ... + timestamp,'.csv']; + +task = topNode.children{1}; +task.saveTrials(csvfile, 'all'); diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 506255d..12fd319 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -523,8 +523,8 @@ function prepareDrawables(self) fpY = ensemble.getObjectProperty('yCenter', self.fpIndex); % Now set the targets x,y - ensemble.setObjectProperty('xCenter', [fpX - td, fpX + td, fpX - td, fpX + td], self.targetIndex); - ensemble.setObjectProperty('yCenter', [fpY - td, fpY + td, fpY - td, fpY + td], self.targetIndex); + ensemble.setObjectProperty('xCenter', [fpX + td, fpX - td, fpX - td, fpX + td], self.targetIndex); + ensemble.setObjectProperty('yCenter', [fpY + td, fpY + td, fpY - td, fpY - td], self.targetIndex); end % ---- Save dots properties @@ -553,7 +553,7 @@ function initializeStateMachine(self) chkuif = {@readEvent, self.helpers.reader, {'holdFixation'}, self, 'fixationStart'}; chkuib = {}; % {@getNextEvent, self.readables.theObject, false, {}}; % {'brokeFixation'} - chkuic = {@checkForChoice, self, {'choseLeft' 'choseRight'}, 'choiceTime', 'blank'}; + chkuic = {@checkForChoice, self, {'choseTopLeft' 'choseTopRight' 'choseBottomLeft' 'choseBottomRight'}, 'choiceTime', 'blank'}; chkrev = {@checkForReversal, self}; showfx = {@draw, self.helpers.stimulusEnsemble, {self.fpIndex, [self.targetIndex self.dotsIndex]}, self, 'fixationOn'}; showt = {@draw, self.helpers.stimulusEnsemble, {self.targetIndex, []}, self, 'targetOn'}; @@ -571,7 +571,7 @@ function initializeStateMachine(self) sea = @setEventsActiveFlag; gwfxw = {sea, self.helpers.reader.theObject, 'holdFixation', 'all'}; gwfxh = {}; - gwts = {sea, self.helpers.reader.theObject, {'choseLeft', 'choseRight'}, 'holdFixation'}; + gwts = {sea, self.helpers.reader.theObject, {'choseTopLeft', 'choseBottomLeft', 'choseTopRight', 'choseBottomRight'}, 'holdFixation'}; % ---- Timing variables, read directly from the timing property struct % From 65f4d578abc1e9ae0e26d3c2fe3de410262a876a Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Mon, 7 Oct 2019 15:30:06 -0400 Subject: [PATCH 08/78] task runs with tbUseProject('Lab_Matlab_Control') --- .../tasks/AdrianTests/Lab_Matlab_Control.json | 25 +++++++++++++++++++ .../tasks/AdrianTests/launchReversingDots.m | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 modularTasks/tasks/AdrianTests/Lab_Matlab_Control.json diff --git a/modularTasks/tasks/AdrianTests/Lab_Matlab_Control.json b/modularTasks/tasks/AdrianTests/Lab_Matlab_Control.json new file mode 100644 index 0000000..2248b6a --- /dev/null +++ b/modularTasks/tasks/AdrianTests/Lab_Matlab_Control.json @@ -0,0 +1,25 @@ +[ + { + "name": "Lab_Matlab_Control", + "type": "git", + "update": "never", + "url": "https://github.com/TheGoldLab/Lab_Matlab_Control.git", + "pathPlacement": "append" + }, + { + "name": "Lab_Matlab_Utilities", + "type": "include", + "pathPlacement": "append" + }, + { + "name": "mgl", + "type": "git", + "url": "https://github.com/justingardner/mgl.git", + "pathPlacement": "append" + }, + { + "name": "mQUESTPlus", + "pathPlacement": "append", + "type": "include" + } +] diff --git a/modularTasks/tasks/AdrianTests/launchReversingDots.m b/modularTasks/tasks/AdrianTests/launchReversingDots.m index ea333f0..68d8cf5 100644 --- a/modularTasks/tasks/AdrianTests/launchReversingDots.m +++ b/modularTasks/tasks/AdrianTests/launchReversingDots.m @@ -24,7 +24,7 @@ function launchReversingDots() timestamp = extract_timestamp(topNode); csvfile = ... - ['/Users/adrian/Documents/MATLAB/toolboxes/Lab_Matlab_Control/', ... + ['/Users/adrian/Documents/MATLAB/projects/Lab_Matlab_Control/', ... 'modularTasks/tasks/AdrianTests/', ... 'completedReversingDots4AFCtrials_', ... timestamp,'.csv']; From 6bdccef0b4c99abacb74318a8dca3b8b5391f4f2 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Mon, 7 Oct 2019 17:44:53 -0400 Subject: [PATCH 09/78] improving metadata --- .../tasks/AdrianTests/launchReversingDots.m | 33 - modularTasks/tasks/AdrianTests/singlecp.m | 58 + .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 1273 +++++++++-------- 3 files changed, 709 insertions(+), 655 deletions(-) delete mode 100644 modularTasks/tasks/AdrianTests/launchReversingDots.m create mode 100644 modularTasks/tasks/AdrianTests/singlecp.m diff --git a/modularTasks/tasks/AdrianTests/launchReversingDots.m b/modularTasks/tasks/AdrianTests/launchReversingDots.m deleted file mode 100644 index 68d8cf5..0000000 --- a/modularTasks/tasks/AdrianTests/launchReversingDots.m +++ /dev/null @@ -1,33 +0,0 @@ -function launchReversingDots() -% function to launch Reversing Dots task while I am designing it -- aer - -topNode = topsTreeNodeTopNode('oneCP'); - -topNode.addHelpers('screenEnsemble', ... - 'displayIndex', 1, ... - 'remoteDrawing', false, ... - 'topNode', topNode); - -topNode.addReadable('dotsReadableHIDKeyboard'); - -pauseBeforeTask = -1; % -1 means wait for keypress -- see topsTreeNode.pauseBeforeTask - -cpDotsTask = topsTreeNodeTaskReversingDots4AFC('cpDots'); -cpDotsTask.taskID = 1; -cpDotsTask.independentVariables='ReversingDotsTestTrials.csv'; -cpDotsTask.trialIterationMethod='sequential'; -cpDotsTask.pauseBeforeTask = pauseBeforeTask; -topNode.addChild(cpDotsTask); - -topNode.run(); - -timestamp = extract_timestamp(topNode); - -csvfile = ... - ['/Users/adrian/Documents/MATLAB/projects/Lab_Matlab_Control/', ... - 'modularTasks/tasks/AdrianTests/', ... - 'completedReversingDots4AFCtrials_', ... - timestamp,'.csv']; - -task = topNode.children{1}; -task.saveTrials(csvfile, 'all'); diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m new file mode 100644 index 0000000..20533d2 --- /dev/null +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -0,0 +1,58 @@ +function singlecp(subject_code, experiment_day, probCP, dump_folder) +% function to launch single CP Reversing Dots task +% +% ARGS: +% subject_code -- string that identifies subject uniquely, e.g. 'S4' +% experiment_day -- integer counting the days of experimentation with this subject +% probCP -- numeric value +% dump_folder -- e.g '/Users/adrian/Documents/MATLAB/projects/Lab_Matlab_Control/modularTasks/tasks/AdrianTests/' + +% +% This function attempts to implement the following rules: +% 1. If experiment_day is > 1, checks that probCP alternates across days +% 2. Check whether a previous session on the same day contains relevant +% Quest info. +% + +topNode = topsTreeNodeTopNode('oneCP'); + +topNode.addHelpers('screenEnsemble', ... + 'displayIndex', 1, ... + 'remoteDrawing', false, ... + 'topNode', topNode); + +topNode.addReadable('dotsReadableHIDKeyboard'); + +pauseBeforeTask = -1; % -1 means wait for keypress -- see topsTreeNode.pauseBeforeTask + +cpDotsTask = topsTreeNodeTaskReversingDots4AFC('cpDots'); +cpDotsTask.taskID = 1; +cpDotsTask.independentVariables='ReversingDotsTestTrials.csv'; +cpDotsTask.trialIterationMethod='sequential'; +cpDotsTask.pauseBeforeTask = pauseBeforeTask; + +% must be numeric +cpDotsTask.subject = num2str(regexprep(subject_code,'[^0-9]','')); + +timestamp = extract_timestamp(topNode); +diary([dump_folder, 'session_console_',timestamp,'.log']) + +cpDotsTask.date = num2str(regexprep(timestamp,'_','')); % must be numeric + +cpDotsTask.probCP = probCP; + +topNode.addChild(cpDotsTask); + +topNode.run(); + + + +csvfile = ... + [dump_folder, ... + 'completedReversingDots4AFCtrials_', ... + timestamp,'.csv']; + +task = topNode.children{1}; +task.saveTrials(csvfile, 'all'); +diary off +end \ No newline at end of file diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 12fd319..8c2ccb6 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -1,629 +1,658 @@ classdef topsTreeNodeTaskReversingDots4AFC < topsTreeNodeTask - % @class topsTreeNodeTaskReversingDots4AFC - % - % Reversing dots (RD) task - % - % For standard configurations, call: - % topsTreeNodeTaskReversingDots.getStandardConfiguration - % - % Otherwise: - % 1. Create an instance directly: - % task = topsTreeNodeTaskReversingDots(); - % - % 2. Set properties. These are required: - % task.screenEnsemble - % task.helpers.readers.theObject - % Others can use defaults - % - % 3. Add this as a child to another topsTreeNode - % - % 10/01/19 created by aer - - properties % (SetObservable) - - % Trial properties. - % - % Set useQuest to a handle to a topsTreeNodeTaskRTDots to use it - % to get coherences - settings = struct( ... - 'useQuest', [], ... - 'valsFromQuest', [], ... % % cor vals on pmf to get - 'targetDistance', 8, ... - 'dotsSeedBase', randi(9999), ... - 'reversalSet', [0.3 0.6 0.9], ... % if reversal<-1 - 'reversalType', 'time'); % 'time' or 'hazard'; see prepareDrawables - - % Timing properties, referenced in statelist - timing = struct( ... - 'fixationTimeout', 5.0, ... - 'holdFixation', 0.5, ... - 'duration', [0.2 0.5 1.0], ... % min mean max - 'finalEpochDuration', [], ... - 'minEpochDuration', 0.1, ... - 'maxEpochDuration', 5.0, ... - 'minimumRT', 0.05, ... - 'showFeedback', 1.0, ... - 'interTrialInterval', 1.0, ... - 'preDots', [0.1 0.3 0.6], ... - 'dotsTimeout', 5.0, ... - 'choiceTimeout', 3.0); - - % Fields below are optional but if found with the given names - % will be used to automatically configure the task - - % Array of structures of independent variables, used by makeTrials - % NOTE that this is the simple way of setting up this struct. You can - % also still use: - % indepdendentVariables = struct( ... - % 'direction', struct('values', [0 180], 'priors', []), ... - % etc. - independentVariables = struct( ... - 'direction', [0 180], ... - 'coherence', 90, ... - 'reversal', [0.2 0.5], ... - 'duration', 1.0, ... - 'finalDuration', []); - - % dataFieldNames are used to set up the trialData structure - trialDataFields = {'RT', 'dirChoice', 'cpChoice', 'dirCorrect', 'cpCorrect', ... - 'direction', 'coherence', 'randSeedBase', 'fixationOn', ... - 'fixationStart', 'targetOn', 'dotsOn', 'finalCPTime', 'dotsOff', ... - 'choiceTime', 'blankScreen', 'feedbackOn'}; - - % Drawables settings - drawable = struct( ... - ... - ... % Stimulus ensemble and settings - 'stimulusEnsemble', struct( ... - ... - ... % Fixation drawable settings - 'fixation', struct( ... - 'fevalable', @dotsDrawableTargets, ... - 'settings', struct( ... - 'xCenter', 0, ... - 'yCenter', 0, ... - 'nSides', 4, ... - 'width', 1.0.*[1.0 0.1], ... - 'height', 1.0.*[0.1 1.0], ... - 'colors', [1 1 1])), ... - ... - ... % Targets drawable settings - 'targets', struct( ... - 'fevalable', @dotsDrawableTargets, ... - 'settings', struct( ... - 'nSides', 100, ... - 'width', 1.5.*[1 1 1 1], ... - 'height', 1.5.*[1 1 1 1])), ... - ... - ... % Dots drawable settings - 'dots', struct( ... - 'fevalable', @dotsDrawableDotKinetogram, ... - 'settings', struct( ... - 'xCenter', 0, ... - 'yCenter', 0, ... - 'coherenceSTD', 10, ... - 'stencilNumber', 1, ... - 'pixelSize', 5, ... - 'diameter', 10, ... - 'density', 180, ... - 'speed', 3)))); - - % Readable settings - readable = struct( ... - ... - ... % The readable object - 'reader', struct( ... - ... - 'copySpecs', struct( ... - ... - ... % The gaze windows - 'dotsReadableEye', struct( ... - 'bindingNames', 'stimulusEnsemble', ... - 'prepare', {{@updateGazeWindows}}, ... - 'start', {{@defineEventsFromStruct, struct( ... - 'name', {'holdFixation', 'breakFixation', 'choseLeft', 'choseRight'}, ... - 'ensemble', {'stimulusEnsemble', 'stimulusEnsemble', 'stimulusEnsemble', 'stimulusEnsemble'}, ... % ensemble object to bind to - 'ensembleIndices', {[1 1], [1 1], [2 1], [2 2]})}}), ... - ... - ... % The keyboard events .. 'uiType' is used to conditionally use these depending on the theObject type - 'dotsReadableHIDKeyboard', struct( ... - 'start', {{@defineEventsFromStruct, struct( ... - 'name', {'holdFixation', 'choseTopLeft', 'choseTopRight', 'choseBottomLeft', 'choseBottomRight'}, ... - 'component', {'KeyboardSpacebar', 'KeyboardA', 'KeyboardK', 'KeyboardZ', 'KeyboardM'}, ... - 'isRelease', {true, false, false, false, false})}}), ... - ... - ... % Gamepad - 'dotsReadableHIDGamepad', struct( ... - 'start', {{@defineEventsFromStruct, struct( ... - 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... - 'component', {'Button1', 'Trigger1', 'Trigger2'}, ... - 'isRelease', {true, false, false})}}), ... - ... - ... % Dummy to run in demo mode - 'dotsReadableDummy', struct( ... - 'start', {{@defineEventsFromStruct, struct( ... - 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... - 'component', {'Dummy1', 'Dummy2', 'Dummy3'})}})))); - - % Feedback messages - message = struct( ... - ... - 'message', struct( ... - ... - ... Instructions - 'Instructions', struct( ... - 'text', {{'bleble', 'blabla'}}, ... - 'duration', 1, ... - 'pauseDuration', 0.5, ... - 'bgEnd', [0 0 0]), ... - ... - ... Correct - 'Correct', struct( ... - 'text', {{'Correct', 'y', 6}}, ... - 'images', {{'thumbsUp.jpg', 'y', -6}}, ... - ...%'playable', 'cashRegister.wav', ... - 'bgStart', [0 0.6 0], ... - 'bgEnd', [0 0 0]), ... - ... - ... Error - 'Error', struct( ... - 'text', 'Error', ... - ...%'playable', 'buzzer.wav', ... - 'bgStart', [0.6 0 0], ... - 'bgEnd', [0 0 0]), ... - ... - ... No choice - 'No_choice', struct( ... - 'text', 'No choice - please try again!'))); - end - - properties (SetAccess = protected) - - % Check for changes in properties that require drawables to be recomputed - targetDistance; - - % Reversal directions/times -- precomputed for each trial and then executed. - reversals = struct('directions', [], 'plannedTimes', [], 'actualTimes', []); - - % Keep track of reversals - nextReversal; - - % indices for drawable objects - fpIndex; - targetIndex; - dotsIndex; - end - - methods - - %% Constuctor - % Use topsTreeNodeTask method, which can parse the argument list - % that can set properties (even those nested in structs) - function self = topsTreeNodeTaskReversingDots4AFC(varargin) - - % ---- Make it from the superclass - % - self = self@topsTreeNodeTask(varargin{:}); - end - - %% Start task (overloaded) - % - % Put stuff here that you want to do before each time you run this - % task - function startTask(self) - - if ~isempty(self.settings.useQuest) - - % Update independent variable struct using Quest threshold - self.independentVariables.coherence = ... - self.settings.useQuest.getQuestThreshold( ... - self.settings.valsFromQuest); - end - - % ---- Get some useful indices - % - fn = fieldnames(self.drawable.stimulusEnsemble); - self.fpIndex = find(strcmp('fixation', fn)); - self.targetIndex = find(strcmp('targets', fn)); - self.dotsIndex = find(strcmp('dots', fn)); - - % ---- Initialize the state machine - % - self.initializeStateMachine(); - - % ---- Show task-specific instructions - % - self.helpers.message.show('Instructions'); - end - - %% Finish task (overloaded) - % - % Put stuff here that you want to do after each time you run this - % task - function finishTask(self) - end - - %% Start trial - % - % Put stuff here that you want to do before each time you run a trial - function startTrial(self) - - % ---- Prepare components - % - self.prepareDrawables(); - - % ---- Use the task ITI - % - self.interTrialInterval = self.timing.interTrialInterval; - - % ---- Show information about the task/trial - % - % Task information - taskString = sprintf('%s (task %d/%d): %d dirCorrect, %d cpCorrect, %d dirError, %d cpError, mean RT=%.2f', ... - self.name, self.taskID, length(self.caller.children), ... - sum([self.trialData.dirCorrect]==1), sum([self.trialData.cpCorrect]==1), ... - sum([self.trialData.dirCorrect]==0), sum([self.trialData.cpCorrect]==0), ... - nanmean([self.trialData.RT])); - - % Trial information - trial = self.getTrial(); - if ~isempty(self.reversals) - numReversals = length(self.reversals.plannedTimes)-1; - else - numReversals = 0; - end - trialString = sprintf('Trial %d/%d, coh=%.0f, dur=%.2f, nflips=%d', ... - self.trialCount, numel(self.trialData), trial.coherence, ... - trial.duration, numReversals); - - % Show the information on the GUI - self.updateStatus(taskString, trialString); % just update the second one - end - - %% Finish Trial - % - % Could add stuff here - function finishTrial(self) - end - - %% Check for flip - % - % - function next = checkForReversal(self) - - % For now, never return anything - next = ''; - - % Make sure we're reversing - if isempty(self.nextReversal) - return - end - - % Get the trial for timing info - trial = self.getTrial(); - - % Check for reversal - if feval(self.clockFunction) - trial.trialStart - trial.dotsOn >= ... - self.reversals.plannedTimes(self.nextReversal) - - % Reverse! + % @class topsTreeNodeTaskReversingDots4AFC + % + % Reversing dots (RD) task + % + % For standard configurations, call: + % topsTreeNodeTaskReversingDots.getStandardConfiguration + % + % Otherwise: + % 1. Create an instance directly: + % task = topsTreeNodeTaskReversingDots(); + % + % 2. Set properties. These are required: + % task.screenEnsemble + % task.helpers.readers.theObject + % Others can use defaults + % + % 3. Add this as a child to another topsTreeNode + % + % 10/01/19 created by aer + + properties % (SetObservable) + + % Trial properties. + % + % Set useQuest to a handle to a topsTreeNodeTaskRTDots to use it + % to get coherences + settings = struct( ... + 'useQuest', [], ... + 'valsFromQuest', [], ... % % cor vals on pmf to get + 'targetDistance', 8, ... + 'dotsSeedBase', randi(9999), ... + 'reversalSet', [0.3 0.6 0.9], ... % if reversal<-1 + 'reversalType', 'time'); % 'time' or 'hazard'; see prepareDrawables + + % Timing properties, referenced in statelist + timing = struct( ... + 'fixationTimeout', 5.0, ... + 'holdFixation', 0.5, ... + 'duration', [0.2 0.5 1.0], ... % min mean max + 'finalEpochDuration', [], ... + 'minEpochDuration', 0.1, ... + 'maxEpochDuration', 5.0, ... + 'minimumRT', 0.05, ... + 'showFeedback', 1.0, ... + 'interTrialInterval', 1.0, ... + 'preDots', [0.1 0.3 0.6], ... + 'dotsTimeout', 5.0, ... + 'choiceTimeout', 3.0); + + % Fields below are optional but if found with the given names + % will be used to automatically configure the task + + % Array of structures of independent variables, used by makeTrials + % NOTE that this is the simple way of setting up this struct. You can + % also still use: + % indepdendentVariables = struct( ... + % 'direction', struct('values', [0 180], 'priors', []), ... + % etc. + independentVariables = struct( ... + 'direction', [0 180], ... + 'coherence', 90, ... + 'reversal', [0.2 0.5], ... + 'duration', 1.0, ... + 'finalDuration', []); + + % dataFieldNames are used to set up the trialData structure + trialDataFields = { ... + 'RT', ... + 'dirChoice', ... + 'cpChoice', ... + 'dirCorrect', ... + 'cpCorrect', ... + 'direction', ... + 'coherence', ... + 'randSeedBase', ... + 'fixationOn', ... + 'fixationStart', ... + 'targetOn', ... + 'dotsOn', ... + 'finalCPTime', ... + 'dotsOff', ... + 'choiceTime', ... + 'blankScreen', ... + 'feedbackOn', ... + 'subject', ... + 'date', ... + 'probCP'}; + + % Drawables settings + drawable = struct( ... + ... + ... % Stimulus ensemble and settings + 'stimulusEnsemble', struct( ... + ... + ... % Fixation drawable settings + 'fixation', struct( ... + 'fevalable', @dotsDrawableTargets, ... + 'settings', struct( ... + 'xCenter', 0, ... + 'yCenter', 0, ... + 'nSides', 4, ... + 'width', 1.0.*[1.0 0.1], ... + 'height', 1.0.*[0.1 1.0], ... + 'colors', [1 1 1])), ... + ... + ... % Targets drawable settings + 'targets', struct( ... + 'fevalable', @dotsDrawableTargets, ... + 'settings', struct( ... + 'nSides', 100, ... + 'width', 1.5.*[1 1 1 1], ... + 'height', 1.5.*[1 1 1 1])), ... + ... + ... % Dots drawable settings + 'dots', struct( ... + 'fevalable', @dotsDrawableDotKinetogram, ... + 'settings', struct( ... + 'xCenter', 0, ... + 'yCenter', 0, ... + 'coherenceSTD', 10, ... + 'stencilNumber', 1, ... + 'pixelSize', 5, ... + 'diameter', 10, ... + 'density', 180, ... + 'speed', 3)))); + + % Readable settings + readable = struct( ... + ... + ... % The readable object + 'reader', struct( ... + ... + 'copySpecs', struct( ... + ... + ... % The gaze windows + 'dotsReadableEye', struct( ... + 'bindingNames', 'stimulusEnsemble', ... + 'prepare', {{@updateGazeWindows}}, ... + 'start', {{@defineEventsFromStruct, struct( ... + 'name', {'holdFixation', 'breakFixation', 'choseLeft', 'choseRight'}, ... + 'ensemble', {'stimulusEnsemble', 'stimulusEnsemble', 'stimulusEnsemble', 'stimulusEnsemble'}, ... % ensemble object to bind to + 'ensembleIndices', {[1 1], [1 1], [2 1], [2 2]})}}), ... + ... + ... % The keyboard events .. 'uiType' is used to conditionally use these depending on the theObject type + 'dotsReadableHIDKeyboard', struct( ... + 'start', {{@defineEventsFromStruct, struct( ... + 'name', {'holdFixation', 'choseTopLeft', 'choseTopRight', 'choseBottomLeft', 'choseBottomRight'}, ... + 'component', {'KeyboardSpacebar', 'KeyboardA', 'KeyboardK', 'KeyboardZ', 'KeyboardM'}, ... + 'isRelease', {true, false, false, false, false})}}), ... + ... + ... % Gamepad + 'dotsReadableHIDGamepad', struct( ... + 'start', {{@defineEventsFromStruct, struct( ... + 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... + 'component', {'Button1', 'Trigger1', 'Trigger2'}, ... + 'isRelease', {true, false, false})}}), ... + ... + ... % Dummy to run in demo mode + 'dotsReadableDummy', struct( ... + 'start', {{@defineEventsFromStruct, struct( ... + 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... + 'component', {'Dummy1', 'Dummy2', 'Dummy3'})}})))); + + % Feedback messages + message = struct( ... + ... + 'message', struct( ... + ... + ... Instructions + 'Instructions', struct( ... + 'text', {{'bleble', 'blabla'}}, ... + 'duration', 1, ... + 'pauseDuration', 0.5, ... + 'bgEnd', [0 0 0]), ... + ... + ... Correct + 'Correct', struct( ... + 'text', {{'Correct', 'y', 6}}, ... + 'images', {{'thumbsUp.jpg', 'y', -6}}, ... + ...%'playable', 'cashRegister.wav', ... + 'bgStart', [0 0.6 0], ... + 'bgEnd', [0 0 0]), ... + ... + ... Error + 'Error', struct( ... + 'text', 'Error', ... + ...%'playable', 'buzzer.wav', ... + 'bgStart', [0.6 0 0], ... + 'bgEnd', [0 0 0]), ... + ... + ... No choice + 'No_choice', struct( ... + 'text', 'No choice - please try again!'))); + + % metadata + subject; + date; + probCP; + end + + properties (SetAccess = protected) + + % Check for changes in properties that require drawables to be recomputed + targetDistance; + + % Reversal directions/times -- precomputed for each trial and then executed. + reversals = struct('directions', [], 'plannedTimes', [], 'actualTimes', []); + + % Keep track of reversals + nextReversal; + + % indices for drawable objects + fpIndex; + targetIndex; + dotsIndex; + + end + + methods + + %% Constuctor + % Use topsTreeNodeTask method, which can parse the argument list + % that can set properties (even those nested in structs) + function self = topsTreeNodeTaskReversingDots4AFC(varargin) + + % ---- Make it from the superclass + % + self = self@topsTreeNodeTask(varargin{:}); + end + + %% Start task (overloaded) + % + % Put stuff here that you want to do before each time you run this + % task + function startTask(self) + + if ~isempty(self.settings.useQuest) + + % Update independent variable struct using Quest threshold + self.independentVariables.coherence = ... + self.settings.useQuest.getQuestThreshold( ... + self.settings.valsFromQuest); + end + + % ---- Get some useful indices + % + fn = fieldnames(self.drawable.stimulusEnsemble); + self.fpIndex = find(strcmp('fixation', fn)); + self.targetIndex = find(strcmp('targets', fn)); + self.dotsIndex = find(strcmp('dots', fn)); + + % ---- Initialize the state machine + % + self.initializeStateMachine(); + + % ---- Show task-specific instructions + % + self.helpers.message.show('Instructions'); + end + + %% Finish task (overloaded) + % + % Put stuff here that you want to do after each time you run this + % task + function finishTask(self) + end + + %% Start trial + % + % Put stuff here that you want to do before each time you run a trial + function startTrial(self) + + % ---- Prepare components + % + self.prepareDrawables(); + + % ---- Use the task ITI + % + self.interTrialInterval = self.timing.interTrialInterval; + + % ---- Show information about the task/trial + % + % Task information + taskString = sprintf('%s (task %d/%d): %d dirCorrect, %d cpCorrect, %d dirError, %d cpError, mean RT=%.2f', ... + self.name, self.taskID, length(self.caller.children), ... + sum([self.trialData.dirCorrect]==1), sum([self.trialData.cpCorrect]==1), ... + sum([self.trialData.dirCorrect]==0), sum([self.trialData.cpCorrect]==0), ... + nanmean([self.trialData.RT])); + + % Trial information + trial = self.getTrial(); + if ~isempty(self.reversals) + numReversals = length(self.reversals.plannedTimes)-1; + else + numReversals = 0; + end + trialString = sprintf('Trial %d/%d, coh=%.0f, dur=%.2f, nflips=%d', ... + self.trialCount, numel(self.trialData), trial.coherence, ... + trial.duration, numReversals); + + % Show the information on the GUI + self.updateStatus(taskString, trialString); % just update the second one + end + + %% Finish Trial + % + % Could add stuff here + function finishTrial(self) + end + + %% Check for flip + % + % + function next = checkForReversal(self) + + % For now, never return anything + next = ''; + + % Make sure we're reversing + if isempty(self.nextReversal) + return + end + + % Get the trial for timing info + trial = self.getTrial(); + + % Check for reversal + if feval(self.clockFunction) - trial.trialStart - trial.dotsOn >= ... + self.reversals.plannedTimes(self.nextReversal) + + % Reverse! + % + % Set the direction + eh = self.helpers.stimulusEnsemble; + eh.theObject.setObjectProperty('direction', self.reversals.directions(self.nextReversal), ... + self.dotsIndex); + + % Explicitly flip here so we can get the timestamp + frameInfo = eh.theObject.callObjectMethod(@dotsDrawable.drawFrame, {}, [], true); + + % Save the time in SCREEN time + self.reversals.actualTimes(self.nextReversal) = ... + eh.getSynchronizedTime(frameInfo.onsetTime, true) - trial.dotsOn; + + % For debugging + fprintf('FLIPPED to %d at time: %.2f planned, %.2f actual\n', ... + self.reversals.directions(self.nextReversal), ... + self.reversals.plannedTimes(self.nextReversal), ... + self.reversals.actualTimes(self.nextReversal)) + + % update the counter + self.nextReversal = self.nextReversal + 1; + if self.nextReversal > length(self.reversals.plannedTimes) + self.nextReversal = []; + end + end + end + + %% Check for choice + % + % Save choice/RT information and set up feedback for the dots task + function nextState = checkForChoice(self, events, eventTag, nextStateAfterChoice) + + % ---- Check for event + % + eventName = self.helpers.reader.readEvent(events, self, eventTag); + + % Default return + nextState = []; + + % Nothing... keep checking + if isempty(eventName) + return + end + + % Get current task/trial + trial = self.getTrial(); + + % Check for minimum RT, wrt dotsOn for RT, dotsOff for non-RT + RT = trial.choiceTime - trial.dotsOff; + if RT < self.timing.minimumRT + return + end + + % ---- Good choice! + % + % Override completedTrial flag + self.completedTrial = true; + + % Jump to next state when done + nextState = nextStateAfterChoice; + + % Save the choice + trial.dirChoice = double(strcmp(eventName, 'choseTopRight') || ... + strcmp(eventName, 'choseBottomRight')); + trial.cpChoice = double(strcmp(eventName, 'choseTopRight') || ... + strcmp(eventName, 'choseTopLeft')); + + % Mark as correct/error + trial.dirCorrect = double( ... + (trial.dirChoice==0 && cosd(trial.direction)<0) || ... + (trial.dirChoice==1 && cosd(trial.direction)>0)); + trial.cpCorrect = double( ... + (trial.cpChoice==0 && trial.reversal == 0) || ... + (trial.cpChoice==1 && trial.reversal ~= 0)); + % Save RT + trial.RT = RT; + + % Save the final reversal time + if ~isempty(self.reversals) + trial.finalCPTime = self.reversals.actualTimes(end); + end + + % Store the reversal times + topsDataLog.logDataInGroup(self.reversals, 'ReversingDotsReversals'); + + + % write metadata (same for all trials) + trial.subject = self.subject; + trial.date = self.date; + trial.probCP = self.probCP; + + % ---- Re-save the trial % - % Set the direction - eh = self.helpers.stimulusEnsemble; - eh.theObject.setObjectProperty('direction', self.reversals.directions(self.nextReversal), ... - self.dotsIndex); - - % Explicitly flip here so we can get the timestamp - frameInfo = eh.theObject.callObjectMethod(@dotsDrawable.drawFrame, {}, [], true); - - % Save the time in SCREEN time - self.reversals.actualTimes(self.nextReversal) = ... - eh.getSynchronizedTime(frameInfo.onsetTime, true) - trial.dotsOn; - - % For debugging - fprintf('FLIPPED to %d at time: %.2f planned, %.2f actual\n', ... - self.reversals.directions(self.nextReversal), ... - self.reversals.plannedTimes(self.nextReversal), ... - self.reversals.actualTimes(self.nextReversal)) - - % update the counter - self.nextReversal = self.nextReversal + 1; - if self.nextReversal > length(self.reversals.plannedTimes) - self.nextReversal = []; + self.setTrial(trial); + end + + %% Show feedback + % + function showFeedback(self) + + % Get current task/trial + trial = self.getTrial(); + + % Get feedback message group + if trial.dirCorrect * trial.cpCorrect == 1 + messageGroup = 'Correct'; + elseif trial.dirCorrect * trial.cpCorrect == 0 + messageGroup = 'Error'; + else + messageGroup = 'No_choice'; end - end - end - - %% Check for choice - % - % Save choice/RT information and set up feedback for the dots task - function nextState = checkForChoice(self, events, eventTag, nextStateAfterChoice) - - % ---- Check for event - % - eventName = self.helpers.reader.readEvent(events, self, eventTag); - - % Default return - nextState = []; - - % Nothing... keep checking - if isempty(eventName) - return - end - - % Get current task/trial - trial = self.getTrial(); - - % Check for minimum RT, wrt dotsOn for RT, dotsOff for non-RT - RT = trial.choiceTime - trial.dotsOff; - if RT < self.timing.minimumRT - return - end - - % ---- Good choice! - % - % Override completedTrial flag - self.completedTrial = true; - - % Jump to next state when done - nextState = nextStateAfterChoice; - - % Save the choice - trial.dirChoice = double(strcmp(eventName, 'choseTopRight') || ... - strcmp(eventName, 'choseBottomRight')); - trial.cpChoice = double(strcmp(eventName, 'choseTopRight') || ... - strcmp(eventName, 'choseTopLeft')); - - % Mark as correct/error - trial.dirCorrect = double( ... - (trial.dirChoice==0 && cosd(trial.direction)<0) || ... - (trial.dirChoice==1 && cosd(trial.direction)>0)); - trial.cpCorrect = double( ... - (trial.cpChoice==0 && trial.reversal == 0) || ... - (trial.cpChoice==1 && trial.reversal ~= 0)); - % Save RT - trial.RT = RT; - - % Save the final reversal time - if ~isempty(self.reversals) - trial.finalCPTime = self.reversals.actualTimes(end); - end - - % Store the reversal times - topsDataLog.logDataInGroup(self.reversals, 'ReversingDotsReversals'); - - % ---- Re-save the trial - % - self.setTrial(trial); - end - - %% Show feedback - % - function showFeedback(self) - - % Get current task/trial - trial = self.getTrial(); - - % Get feedback message group - if trial.dirCorrect * trial.cpCorrect == 1 - messageGroup = 'Correct'; - elseif trial.dirCorrect * trial.cpCorrect == 0 - messageGroup = 'Error'; - else - messageGroup = 'No_choice'; - end - - % --- Show trial feedback in GUI/text window - % - trialString = ... - sprintf('Trial %d/%d: %s, RT=%.2f', ... - self.trialCount, numel(self.trialData), ... - messageGroup, trial.RT); - self.updateStatus([], trialString); % just update the second one - - % ---- Show trial feedback on the screen - % - self.helpers.message.show(messageGroup, self, 'feedbackOn'); - end - end - - methods (Access = protected) - - %% Prepare drawables for this trial - % - function prepareDrawables(self) - - % ---- Get the current trial and other useful stuff, and set - % values - % - trial = self.getTrial(); - - % Set the seed base for the random number generator - trial.randSeedBase = self.settings.dotsSeedBase; - - % Set the dots duration if not already given in trial struct - if ~isfinite(trial.duration) - trial.duration = self.timing.duration; % Set the dots duration - end - - % Funny value in case we want to control timing after final - % change-point - if ~isfinite(trial.finalDuration) - trial.finalDuration = self.timing.finalEpochDuration; - end - - % ---- Compute reversal times, start/final directions - % - % Defaults -- no flippy! - self.reversals = []; - self.nextReversal = []; - startDirection = trial.direction; - - % Use trial.reversal property - if trial.reversal ~= 0 - - % Setting up reversals array - switch(self.settings.reversalType) - case 'hazard' - - % Interpret "reversal" as fixed hazard rate. - [plannedTimes, trial.duration] = ... - computeChangePoints(trial.reversal, ... - self.timing.minEpochDuration, ... - self.timing.maxEpochDuration, ... - trial.duration, ... - trial.finalDuration); - - otherwise % case 'time' - - % Special case -- check if trial.reversal < 0 ... if so, - % that's just a flag saying to use the set - if trial.reversal < 0 - plannedTimes = self.settings.reversalSet; - else - plannedTimes = trial.reversal; - end - - % Strip unnecessary values - plannedTimes = plannedTimes(plannedTimes 0 + + % Set up reversals struct, with one entry per direction epoch + otherDirection = setdiff(... + self.independentVariables.direction, trial.direction); + self.reversals.directions = repmat(trial.direction, 1, numReversals+1); + self.reversals.directions(end:-2:1) = otherDirection; + self.reversals.plannedTimes = [0 plannedTimes]; + self.reversals.actualTimes = [0 nans(1, numReversals)]; + self.nextReversal = 2; + startDirection = self.reversals.directions(1); + trial.direction = self.reversals.directions(end); + end end - % Check that we have reversals - numReversals = length(plannedTimes); - if numReversals > 0 - - % Set up reversals struct, with one entry per direction epoch - otherDirection = setdiff(... - self.independentVariables.direction, trial.direction); - self.reversals.directions = repmat(trial.direction, 1, numReversals+1); - self.reversals.directions(end:-2:1) = otherDirection; - self.reversals.plannedTimes = [0 plannedTimes]; - self.reversals.actualTimes = [0 nans(1, numReversals)]; - self.nextReversal = 2; - startDirection = self.reversals.directions(1); - trial.direction = self.reversals.directions(end); + % Set the dots duration in the statelist + self.stateMachine.editStateByName('showDots', 'timeout', trial.duration); + + % ---- Possibly update all stimulusEnsemble objects if settings + % changed + % + ensemble = self.helpers.stimulusEnsemble.theObject; + td = self.settings.targetDistance; + if isempty(self.targetDistance) || self.targetDistance ~= td + + % Save current value(s) + self.targetDistance = self.settings.targetDistance; + + % Get target locations relative to fp location + fpX = ensemble.getObjectProperty('xCenter', self.fpIndex); + fpY = ensemble.getObjectProperty('yCenter', self.fpIndex); + + % Now set the targets x,y + ensemble.setObjectProperty('xCenter', [fpX + td, fpX - td, fpX - td, fpX + td], self.targetIndex); + ensemble.setObjectProperty('yCenter', [fpY + td, fpY + td, fpY - td, fpY - td], self.targetIndex); end - end - - % Set the dots duration in the statelist - self.stateMachine.editStateByName('showDots', 'timeout', trial.duration); - - % ---- Possibly update all stimulusEnsemble objects if settings - % changed - % - ensemble = self.helpers.stimulusEnsemble.theObject; - td = self.settings.targetDistance; - if isempty(self.targetDistance) || self.targetDistance ~= td - - % Save current value(s) - self.targetDistance = self.settings.targetDistance; - - % Get target locations relative to fp location - fpX = ensemble.getObjectProperty('xCenter', self.fpIndex); - fpY = ensemble.getObjectProperty('yCenter', self.fpIndex); - - % Now set the targets x,y - ensemble.setObjectProperty('xCenter', [fpX + td, fpX - td, fpX - td, fpX + td], self.targetIndex); - ensemble.setObjectProperty('yCenter', [fpY + td, fpY + td, fpY - td, fpY - td], self.targetIndex); - end - - % ---- Save dots properties - % - ensemble.setObjectProperty('randBase', trial.randSeedBase, self.dotsIndex); - ensemble.setObjectProperty('coherence', trial.coherence, self.dotsIndex); - ensemble.setObjectProperty('direction', startDirection, self.dotsIndex); - - % ---- Prepare to draw dots stimulus - % - ensemble.callObjectMethod(@prepareToDrawInWindow); - - % ---- Save the trial - self.setTrial(trial); - end - - %% Initialize StateMachine - % - function initializeStateMachine(self) - - % ---- Fevalables for state list - % - % blanks = {@dotsTheScreen.blankScreen}; - blanks = {@blankScreen, self, 'blankScreen'}; - % chkuif = {@getNextEvent, self.helpers.reader.theObject, false, {'holdFixation'}}; - chkuif = {@readEvent, self.helpers.reader, {'holdFixation'}, self, 'fixationStart'}; - - chkuib = {}; % {@getNextEvent, self.readables.theObject, false, {}}; % {'brokeFixation'} - chkuic = {@checkForChoice, self, {'choseTopLeft' 'choseTopRight' 'choseBottomLeft' 'choseBottomRight'}, 'choiceTime', 'blank'}; - chkrev = {@checkForReversal, self}; - showfx = {@draw, self.helpers.stimulusEnsemble, {self.fpIndex, [self.targetIndex self.dotsIndex]}, self, 'fixationOn'}; - showt = {@draw, self.helpers.stimulusEnsemble, {self.targetIndex, []}, self, 'targetOn'}; - showfb = {@showFeedback, self}; - showd = {@draw,self.helpers.stimulusEnsemble, {self.dotsIndex, []}, self, 'dotsOn'}; - hided = {@draw,self.helpers.stimulusEnsemble, {[], [self.fpIndex self.dotsIndex]}, self, 'dotsOff'}; - - % Drift correction - hfdc = {@reset, self.helpers.reader.theObject, true}; - - % Save values in trialData - % tdhf = {@setTrialDataValue, self, 'holdFixation', value, trialIndex}; - - % Activate/deactivate readable events - sea = @setEventsActiveFlag; - gwfxw = {sea, self.helpers.reader.theObject, 'holdFixation', 'all'}; - gwfxh = {}; - gwts = {sea, self.helpers.reader.theObject, {'choseTopLeft', 'choseBottomLeft', 'choseTopRight', 'choseBottomRight'}, 'holdFixation'}; - - % ---- Timing variables, read directly from the timing property struct - % - t = self.timing; - - % ---- Make the state machine. These will be added into the - % stateMachine (in topsTreeNode) - % - states = {... - 'name' 'entry' 'input' 'timeout' 'exit' 'next' ; ... - 'showFixation' showfx {} 0 {} 'waitForFixation' ; ... - 'waitForFixation' gwfxw chkuif t.fixationTimeout {} 'blankNoFeedback' ; ... - 'holdFixation' gwfxh chkuib t.holdFixation hfdc 'showTargets' ; ... - 'showTargets' showt chkuib t.preDots gwts 'preDots' ; ... - 'preDots' {} {} 0 {} 'showDots' ; ... - 'showDots' showd chkrev 0 hided 'waitForChoice' ; ... - 'waitForChoice' {} chkuic t.choiceTimeout {} 'blank' ; ... - 'blank' {} {} 0.2 blanks 'showFeedback' ; ... - 'showFeedback' showfb {} t.showFeedback blanks 'done' ; ... - 'blankNoFeedback' {} {} 0 blanks 'done' ; ... - 'done' {} {} 0 {} '' ; ... - }; - - % Set up the state list with automatic drawing/fipping of the - % objects in stimulusEnsemble in the given list of states - self.addStateMachineWithDrawing(states, ... - 'stimulusEnsemble', {'preDots' 'showDots'}); - - % Turn on state debug flag - % self.debugStates(); - end - end - - methods (Static) - - %% ---- Utility for defining standard configurations - % - % name is string - function task = getStandardConfiguration(name, varargin) - - % ---- Get the task object, with optional property/value pairs - % - task = topsTreeNodeTaskReversingDots4AFC(name, varargin{:}); - end - - %% ---- Utility for getting test configuration - % - function task = getTestConfiguration() - - task = topsTreeNodeTaskReversingDots4AFC(); - task.timing.minimumRT = 0.3; - task.message.message.Instructions.text = {'Testing', 'topsTreeNodeTaskRTDots'}; - end - end + + % ---- Save dots properties + % + ensemble.setObjectProperty('randBase', trial.randSeedBase, self.dotsIndex); + ensemble.setObjectProperty('coherence', trial.coherence, self.dotsIndex); + ensemble.setObjectProperty('direction', startDirection, self.dotsIndex); + + % ---- Prepare to draw dots stimulus + % + ensemble.callObjectMethod(@prepareToDrawInWindow); + + % ---- Save the trial + self.setTrial(trial); + end + + %% Initialize StateMachine + % + function initializeStateMachine(self) + + % ---- Fevalables for state list + % + % blanks = {@dotsTheScreen.blankScreen}; + blanks = {@blankScreen, self, 'blankScreen'}; + % chkuif = {@getNextEvent, self.helpers.reader.theObject, false, {'holdFixation'}}; + chkuif = {@readEvent, self.helpers.reader, {'holdFixation'}, self, 'fixationStart'}; + + chkuib = {}; % {@getNextEvent, self.readables.theObject, false, {}}; % {'brokeFixation'} + chkuic = {@checkForChoice, self, {'choseTopLeft' 'choseTopRight' 'choseBottomLeft' 'choseBottomRight'}, 'choiceTime', 'blank'}; + chkrev = {@checkForReversal, self}; + showfx = {@draw, self.helpers.stimulusEnsemble, {self.fpIndex, [self.targetIndex self.dotsIndex]}, self, 'fixationOn'}; + showt = {@draw, self.helpers.stimulusEnsemble, {self.targetIndex, []}, self, 'targetOn'}; + showfb = {@showFeedback, self}; + showd = {@draw,self.helpers.stimulusEnsemble, {self.dotsIndex, []}, self, 'dotsOn'}; + hided = {@draw,self.helpers.stimulusEnsemble, {[], [self.fpIndex self.dotsIndex]}, self, 'dotsOff'}; + + % Drift correction + hfdc = {@reset, self.helpers.reader.theObject, true}; + + % Save values in trialData + % tdhf = {@setTrialDataValue, self, 'holdFixation', value, trialIndex}; + + % Activate/deactivate readable events + sea = @setEventsActiveFlag; + gwfxw = {sea, self.helpers.reader.theObject, 'holdFixation', 'all'}; + gwfxh = {}; + gwts = {sea, self.helpers.reader.theObject, {'choseTopLeft', 'choseBottomLeft', 'choseTopRight', 'choseBottomRight'}, 'holdFixation'}; + + % ---- Timing variables, read directly from the timing property struct + % + t = self.timing; + + % ---- Make the state machine. These will be added into the + % stateMachine (in topsTreeNode) + % + states = {... + 'name' 'entry' 'input' 'timeout' 'exit' 'next' ; ... + 'showFixation' showfx {} 0 {} 'waitForFixation' ; ... + 'waitForFixation' gwfxw chkuif t.fixationTimeout {} 'blankNoFeedback' ; ... + 'holdFixation' gwfxh chkuib t.holdFixation hfdc 'showTargets' ; ... + 'showTargets' showt chkuib t.preDots gwts 'preDots' ; ... + 'preDots' {} {} 0 {} 'showDots' ; ... + 'showDots' showd chkrev 0 hided 'waitForChoice' ; ... + 'waitForChoice' {} chkuic t.choiceTimeout {} 'blank' ; ... + 'blank' {} {} 0.2 blanks 'showFeedback' ; ... + 'showFeedback' showfb {} t.showFeedback blanks 'done' ; ... + 'blankNoFeedback' {} {} 0 blanks 'done' ; ... + 'done' {} {} 0 {} '' ; ... + }; + + % Set up the state list with automatic drawing/fipping of the + % objects in stimulusEnsemble in the given list of states + self.addStateMachineWithDrawing(states, ... + 'stimulusEnsemble', {'preDots' 'showDots'}); + + % Turn on state debug flag + % self.debugStates(); + end + end + + methods (Static) + + %% ---- Utility for defining standard configurations + % + % name is string + function task = getStandardConfiguration(name, varargin) + + % ---- Get the task object, with optional property/value pairs + % + task = topsTreeNodeTaskReversingDots4AFC(name, varargin{:}); + end + + %% ---- Utility for getting test configuration + % + function task = getTestConfiguration() + + task = topsTreeNodeTaskReversingDots4AFC(); + task.timing.minimumRT = 0.3; + task.message.message.Instructions.text = {'Testing', 'topsTreeNodeTaskRTDots'}; + end + end end From f139a23aad915716dff0da53fa8f9f76e6640b75 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 8 Oct 2019 13:39:49 -0400 Subject: [PATCH 10/78] conditional stop --- .../tasks/AdrianTests/extract_timestamp.m | 7 -- modularTasks/tasks/AdrianTests/singlecp.m | 83 ++++++++++++------- .../training_1.csv} | 0 .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 19 +++++ 4 files changed, 73 insertions(+), 36 deletions(-) delete mode 100644 modularTasks/tasks/AdrianTests/extract_timestamp.m rename modularTasks/tasks/AdrianTests/{ReversingDotsTestTrials.csv => trials_pre_expt/training_1.csv} (100%) diff --git a/modularTasks/tasks/AdrianTests/extract_timestamp.m b/modularTasks/tasks/AdrianTests/extract_timestamp.m deleted file mode 100644 index d3d52d8..0000000 --- a/modularTasks/tasks/AdrianTests/extract_timestamp.m +++ /dev/null @@ -1,7 +0,0 @@ -function ts = extract_timestamp(tn) -% returns the timestamp as a string 'YYYY_MM_DD_HH_mm' associated with -% the topsTreeNodeTopNode object tn -ts = regexprep(tn.filename, ... - '[^[0-9]{4}_[0-9]{2}_[0-9]{2}_[0-9]{2}_[0-9]{2}]', ''); -ts = ts(1:16); -end \ No newline at end of file diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 20533d2..bfa7e02 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -1,58 +1,83 @@ function singlecp(subject_code, experiment_day, probCP, dump_folder) % function to launch single CP Reversing Dots task -% +% % ARGS: % subject_code -- string that identifies subject uniquely, e.g. 'S4' -% experiment_day -- integer counting the days of experimentation with this subject +% experiment_day -- integer counting the days of experimentation with this subject % probCP -- numeric value % dump_folder -- e.g '/Users/adrian/Documents/MATLAB/projects/Lab_Matlab_Control/modularTasks/tasks/AdrianTests/' % % This function attempts to implement the following rules: -% 1. If experiment_day is > 1, checks that probCP alternates across days +% 1. If experiment_day is > 1, checks that probCP alternates across days % 2. Check whether a previous session on the same day contains relevant % Quest info. % topNode = topsTreeNodeTopNode('oneCP'); -topNode.addHelpers('screenEnsemble', ... - 'displayIndex', 1, ... - 'remoteDrawing', false, ... - 'topNode', topNode); - -topNode.addReadable('dotsReadableHIDKeyboard'); - -pauseBeforeTask = -1; % -1 means wait for keypress -- see topsTreeNode.pauseBeforeTask - -cpDotsTask = topsTreeNodeTaskReversingDots4AFC('cpDots'); -cpDotsTask.taskID = 1; -cpDotsTask.independentVariables='ReversingDotsTestTrials.csv'; -cpDotsTask.trialIterationMethod='sequential'; -cpDotsTask.pauseBeforeTask = pauseBeforeTask; - -% must be numeric -cpDotsTask.subject = num2str(regexprep(subject_code,'[^0-9]','')); + function ts = extract_timestamp(tn) + % returns the timestamp as a string 'YYYY_MM_DD_HH_mm' associated with + % the topsTreeNodeTopNode object tn + ts = regexprep(tn.filename, ... + '[^[0-9]{4}_[0-9]{2}_[0-9]{2}_[0-9]{2}_[0-9]{2}]', ''); + ts = ts(1:16); + end timestamp = extract_timestamp(topNode); + diary([dump_folder, 'session_console_',timestamp,'.log']) -cpDotsTask.date = num2str(regexprep(timestamp,'_','')); % must be numeric +topNode.addHelpers('screenEnsemble', ... + 'displayIndex', 0, ... + 'remoteDrawing', false, ... + 'topNode', topNode); +topNode.addReadable('dotsReadableHIDKeyboard'); + +pauseBeforeTask = -1; % -1 means wait for keypress -- see topsTreeNode.pauseBeforeTask -cpDotsTask.probCP = probCP; + function add_block(topnode, taskID, task_name, trials_file, stop_cond) + t = topsTreeNodeTaskReversingDots4AFC(task_name); + t.taskID = taskID; + t.independentVariables=trials_file; + t.trialIterationMethod='sequential'; + t.pauseBeforeTask = pauseBeforeTask; + t.stopCondition = stop_cond; + + % must be numeric + t.subject = num2str(regexprep(subject_code,'[^0-9]','')); + t.date = num2str(regexprep(timestamp,'_','')); % must be numeric + t.probCP = probCP; + + topnode.addChild(t); + end + + +add_block(topNode, 1, 'training_1', 'training_1.csv', 7) +add_block(topNode, 2, 'training_2', 'training_2.csv', 7) +add_block(topNode, 3, 'training_3', 'training_3.csv', 7) +add_block(topNode, 4, 'training_4', 'training_4.csv', 15) +add_block(topNode, 5, 'training_5', 'training_5.csv', 25) +add_block(topNode, 6, 'training_6', 'training_6.csv', 'button') +add_block(topNode, 7, 'training_7', 'training_7.csv', 'button') +add_block(topNode, 8, 'training_8', 'training_8.csv', 'button') -topNode.addChild(cpDotsTask); topNode.run(); + function dumpFIRA(topnode, child) + task = topnode.children{child}; + csvfile = ... + [dump_folder, 'completedReversingDots4AFCtrials_task', ... + num2str(child), '_date_', ... + timestamp,'.csv']; + task.saveTrials(csvfile, 'all'); + end -csvfile = ... - [dump_folder, ... - 'completedReversingDots4AFCtrials_', ... - timestamp,'.csv']; +for c = 1:num_children + dumpFIRA(topNode, c) +end -task = topNode.children{1}; -task.saveTrials(csvfile, 'all'); diary off end \ No newline at end of file diff --git a/modularTasks/tasks/AdrianTests/ReversingDotsTestTrials.csv b/modularTasks/tasks/AdrianTests/trials_pre_expt/training_1.csv similarity index 100% rename from modularTasks/tasks/AdrianTests/ReversingDotsTestTrials.csv rename to modularTasks/tasks/AdrianTests/trials_pre_expt/training_1.csv diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 8c2ccb6..b12f9b6 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -197,6 +197,10 @@ subject; date; probCP; + + % stop condition + stopCondition; + consecutiveCorrect; end properties (SetAccess = protected) @@ -234,6 +238,7 @@ % Put stuff here that you want to do before each time you run this % task function startTask(self) + self.consecutiveCorrect = 0; if ~isempty(self.settings.useQuest) @@ -307,6 +312,20 @@ function startTrial(self) % % Could add stuff here function finishTrial(self) + % update running count of consecutive correct trials + trial = self.getTrial(); + if trial.dirCorrect && ... + trial.cpCorrect && ... + self.consecutiveCorrect + self.consecutiveCorrect = self.consecutiveCorrect + 1; + + if isnumeric(self.stopCondition) && self.consecutiveCorrect == self.stopCondition + self.abort() + end + else + self.consecutiveCorrect = 0; + end + end %% Check for flip From 4384d464aa54f233cb461619d1556f25482f3307 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 8 Oct 2019 14:12:35 -0400 Subject: [PATCH 11/78] numeric stop condition works --- modularTasks/tasks/AdrianTests/singlecp.m | 12 ++++++----- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 20 +++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index bfa7e02..b7aa699 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -53,11 +53,11 @@ function add_block(topnode, taskID, task_name, trials_file, stop_cond) end -add_block(topNode, 1, 'training_1', 'training_1.csv', 7) -add_block(topNode, 2, 'training_2', 'training_2.csv', 7) -add_block(topNode, 3, 'training_3', 'training_3.csv', 7) -add_block(topNode, 4, 'training_4', 'training_4.csv', 15) -add_block(topNode, 5, 'training_5', 'training_5.csv', 25) +add_block(topNode, 1, 'training_1', 'training_1.csv', 3) +add_block(topNode, 2, 'training_2', 'training_2.csv', 3) +add_block(topNode, 3, 'training_3', 'training_3.csv', 3) +add_block(topNode, 4, 'training_4', 'training_4.csv', 5) +add_block(topNode, 5, 'training_5', 'training_5.csv', 10) add_block(topNode, 6, 'training_6', 'training_6.csv', 'button') add_block(topNode, 7, 'training_7', 'training_7.csv', 'button') add_block(topNode, 8, 'training_8', 'training_8.csv', 'button') @@ -75,6 +75,8 @@ function dumpFIRA(topnode, child) task.saveTrials(csvfile, 'all'); end +num_children = length(topNode.children); + for c = 1:num_children dumpFIRA(topNode, c) end diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index b12f9b6..1796085 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -314,18 +314,18 @@ function startTrial(self) function finishTrial(self) % update running count of consecutive correct trials trial = self.getTrial(); - if trial.dirCorrect && ... - trial.cpCorrect && ... - self.consecutiveCorrect - self.consecutiveCorrect = self.consecutiveCorrect + 1; - - if isnumeric(self.stopCondition) && self.consecutiveCorrect == self.stopCondition - self.abort() + dcorr = trial.dirCorrect; + ccorr = trial.cpCorrect; + if ~isnan(ccorr) && ~isnan(dcorr) + if dcorr && ccorr + self.consecutiveCorrect = self.consecutiveCorrect + 1; + if isnumeric(self.stopCondition) && self.consecutiveCorrect == self.stopCondition + self.abort() + end + else + self.consecutiveCorrect = 0; end - else - self.consecutiveCorrect = 0; end - end %% Check for flip From 3119559dd0a51618d40475aab62254e6089fde9b Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 8 Oct 2019 14:29:52 -0400 Subject: [PATCH 12/78] only dump non-empty FIRA --- modularTasks/tasks/AdrianTests/singlecp.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index b7aa699..fb6acb3 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -45,8 +45,8 @@ function add_block(topnode, taskID, task_name, trials_file, stop_cond) t.stopCondition = stop_cond; % must be numeric - t.subject = num2str(regexprep(subject_code,'[^0-9]','')); - t.date = num2str(regexprep(timestamp,'_','')); % must be numeric + t.subject = str2double(regexprep(subject_code,'[^0-9]','')); + t.date = str2double(regexprep(timestamp,'_','')); % must be numeric t.probCP = probCP; topnode.addChild(t); @@ -78,7 +78,9 @@ function dumpFIRA(topnode, child) num_children = length(topNode.children); for c = 1:num_children - dumpFIRA(topNode, c) + if numel(topNode.children{c}.trialData) + dumpFIRA(topNode, c) + end end diary off From f210e75fa613eacb441d19e2fc9048a9c2868ff4 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 8 Oct 2019 14:58:35 -0400 Subject: [PATCH 13/78] experimenter specifies whether first session of day or not --- modularTasks/tasks/AdrianTests/singlecp.m | 45 ++++++++++++++++++----- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index fb6acb3..26bc52a 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -1,4 +1,5 @@ -function singlecp(subject_code, experiment_day, probCP, dump_folder) +function singlecp(subject_code, experiment_day, first_block_of_day, ... + probCP, dump_folder) % function to launch single CP Reversing Dots task % % ARGS: @@ -36,7 +37,8 @@ function singlecp(subject_code, experiment_day, probCP, dump_folder) pauseBeforeTask = -1; % -1 means wait for keypress -- see topsTreeNode.pauseBeforeTask - function add_block(topnode, taskID, task_name, trials_file, stop_cond) + function add_block(topnode, taskID, task_name, trials_file, ... + stop_cond, block_description) t = topsTreeNodeTaskReversingDots4AFC(task_name); t.taskID = taskID; t.independentVariables=trials_file; @@ -49,18 +51,41 @@ function add_block(topnode, taskID, task_name, trials_file, stop_cond) t.date = str2double(regexprep(timestamp,'_','')); % must be numeric t.probCP = probCP; + t.message.message.Instructions.text = {... + block_description ... + }; + topnode.addChild(t); end + function add_training_block(tid, name, condstop) + add_block(topNode, tid, name, [name,'.csv'], condstop, ... + {'training block',num2str(tid)}) + end + +num_training_blocks=1; + +stop_conditions = {... + 3, 3, 3, 3, 3, 'button', 'button', 'button' ... + }; + +for jj = 1:num_training_blocks + add_training_block(jj, ['training_',num2str(jj)], stop_conditions{jj}) +end + +% Optional Quest +% only put Quest block if this is the first block of the day +if first_block_of_day + questTask = topsTreeNodeTaskRTDots('Quest'); + questTask.taskID = 99; + questTask.trialIterations = 1; + questTask.timing.dotsDuration = 0.4; + questTask.pauseBeforeTask = pauseBeforeTask; + questTask.message.message.Instructions.text = {{'Quest block','There are no switches'}}; + topNode.addChild(questTask); +end -add_block(topNode, 1, 'training_1', 'training_1.csv', 3) -add_block(topNode, 2, 'training_2', 'training_2.csv', 3) -add_block(topNode, 3, 'training_3', 'training_3.csv', 3) -add_block(topNode, 4, 'training_4', 'training_4.csv', 5) -add_block(topNode, 5, 'training_5', 'training_5.csv', 10) -add_block(topNode, 6, 'training_6', 'training_6.csv', 'button') -add_block(topNode, 7, 'training_7', 'training_7.csv', 'button') -add_block(topNode, 8, 'training_8', 'training_8.csv', 'button') +% Task blocks topNode.run(); From a093fddf16c2ade18b1e11ea2702009b30ba8f6c Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 8 Oct 2019 15:47:47 -0400 Subject: [PATCH 14/78] get Quest threshold dynamically --- modularTasks/tasks/AdrianTests/singlecp.m | 45 ++++++++++++++++++- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 8 ++++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 26bc52a..ef96138 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -1,12 +1,18 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... - probCP, dump_folder) + probCP, dump_folder, quest_task_topsDataLog) % function to launch single CP Reversing Dots task % % ARGS: % subject_code -- string that identifies subject uniquely, e.g. 'S4' % experiment_day -- integer counting the days of experimentation with this subject +% first_block_of_day -- true or false % probCP -- numeric value -% dump_folder -- e.g '/Users/adrian/Documents/MATLAB/projects/Lab_Matlab_Control/modularTasks/tasks/AdrianTests/' +% dump_folder -- e.g +% '/Users/adrian/Documents/MATLAB/projects/Lab_Matlab_Control/modularTasks/tasks/AdrianTests/' +% quest_task_topsDataLog -- full path to topsDataLog containing the Quest +% task +% + % % This function attempts to implement the following rules: @@ -83,9 +89,44 @@ function add_training_block(tid, name, condstop) questTask.pauseBeforeTask = pauseBeforeTask; questTask.message.message.Instructions.text = {{'Quest block','There are no switches'}}; topNode.addChild(questTask); +else + % get questTask from first topsDataLog of the day + % right now, stops at first Quest block found + ts = regexprep(quest_task_topsDataLog, ... + '[^[0-9]{4}_[0-9]{2}_[0-9]{2}_[0-9]{2}_[0-9]{2}]', ''); + ts = ts(1:16); + [oldTopNode, ~] = topsTreeNodeTopNode.loadRawData('oneCP', ts); + for tt = 1:length(oldTopNode.children) + task_child = oldTopNode.children{tt}; + if strcmp(task_child.name,'Quest') + questTask = task_child; + break + end + end end + % Task blocks +ttt = topsTreeNodeTaskReversingDots4AFC('TASK'); +ttt.taskID = 100; +ttt.independentVariables=trials_file; +ttt.trialIterationMethod='sequential'; +ttt.pauseBeforeTask = pauseBeforeTask; +ttt.stopCondition = 'button'; + +% must be numeric +ttt.subject = str2double(regexprep(subject_code,'[^0-9]','')); +ttt.date = str2double(regexprep(timestamp,'_','')); % must be numeric +ttt.probCP = probCP; + +ttt.message.message.Instructions.text = {... + block_description ... + }; + +ttt.questThreshold = questTask.getQuestThreshold(); + +topnode.addChild(ttt); + topNode.run(); diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 1796085..7d3d74c 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -197,6 +197,7 @@ subject; date; probCP; + questThreshold; % stop condition stopCondition; @@ -300,6 +301,7 @@ function startTrial(self) else numReversals = 0; end + trialString = sprintf('Trial %d/%d, coh=%.0f, dur=%.2f, nflips=%d', ... self.trialCount, numel(self.trialData), trial.coherence, ... trial.duration, numReversals); @@ -486,6 +488,12 @@ function prepareDrawables(self) % trial = self.getTrial(); + % negative coherence in the .csv file is our way to code for + % threshold coherence + if trial.coherence < 0 + trial.coherence = self.questThreshold; + end + % Set the seed base for the random number generator trial.randSeedBase = self.settings.dotsSeedBase; From e9936db96a694853848570b46ac16ae233b4b936 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 8 Oct 2019 16:53:12 -0400 Subject: [PATCH 15/78] Fail at Quest block Following command launched at roughly 4:42 on 10/08 2019 >>> singlecp('S1', 1, true, 0.3, 'path to trials_post_experiment', '') --- modularTasks/tasks/AdrianTests/singlecp.m | 24 +++++++++++++------ .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 5 ++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index ef96138..c712c0b 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -36,7 +36,7 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... diary([dump_folder, 'session_console_',timestamp,'.log']) topNode.addHelpers('screenEnsemble', ... - 'displayIndex', 0, ... + 'displayIndex', 1, ... 'remoteDrawing', false, ... 'topNode', topNode); topNode.addReadable('dotsReadableHIDKeyboard'); @@ -69,7 +69,7 @@ function add_training_block(tid, name, condstop) {'training block',num2str(tid)}) end -num_training_blocks=1; +num_training_blocks=2; stop_conditions = {... 3, 3, 3, 3, 3, 'button', 'button', 'button' ... @@ -84,7 +84,7 @@ function add_training_block(tid, name, condstop) if first_block_of_day questTask = topsTreeNodeTaskRTDots('Quest'); questTask.taskID = 99; - questTask.trialIterations = 1; + questTask.trialIterations = 25; questTask.timing.dotsDuration = 0.4; questTask.pauseBeforeTask = pauseBeforeTask; questTask.message.message.Instructions.text = {{'Quest block','There are no switches'}}; @@ -107,9 +107,15 @@ function add_training_block(tid, name, condstop) % Task blocks +if probCP < 0.5 + task_file = 'task_low.csv'; +else + task_file = 'task_high.csv'; +end + ttt = topsTreeNodeTaskReversingDots4AFC('TASK'); ttt.taskID = 100; -ttt.independentVariables=trials_file; +ttt.independentVariables=task_file; ttt.trialIterationMethod='sequential'; ttt.pauseBeforeTask = pauseBeforeTask; ttt.stopCondition = 'button'; @@ -120,12 +126,16 @@ function add_training_block(tid, name, condstop) ttt.probCP = probCP; ttt.message.message.Instructions.text = {... - block_description ... + {{'REAL TASK', 'RARE SWITCHES'}} ... }; -ttt.questThreshold = questTask.getQuestThreshold(); +if ~first_block_of_day + ttt.questThreshold = questTask.getQuestThreshold(); +else + ttt.questThreshold = questTask; +end -topnode.addChild(ttt); +topNode.addChild(ttt); diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 7d3d74c..d09b8bc 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -239,6 +239,11 @@ % Put stuff here that you want to do before each time you run this % task function startTask(self) + if ~isempty(self.questThreshold) + if ~isnumeric(self.questThreshold) + self.questThreshold = self.questThreshold.getQuestThreshold(); + end + end self.consecutiveCorrect = 0; if ~isempty(self.settings.useQuest) From 36381564d81703176860174ab36ea93dbcb218d1 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 8 Oct 2019 17:12:49 -0400 Subject: [PATCH 16/78] no pb anymore\? --- modularTasks/tasks/AdrianTests/singlecp.m | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index c712c0b..affaa5a 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -21,6 +21,15 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... % Quest info. % +if nargin < 1 + subject_code = 'S1'; + experiment_day = 1; + first_block_of_day = true; + probCP = 0.3; + dump_folder = '/Users/adrian/Documents/MATLAB/projects/Lab_Matlab_Control/modularTasks/tasks/AdrianTests/'; + quest_task_topsDataLog = '/Users/adrian/oneCP/raw/2019_10_03_10_01/2019_10_03_10_01_topsDataLog.mat'; % made up +end + topNode = topsTreeNodeTopNode('oneCP'); function ts = extract_timestamp(tn) @@ -69,7 +78,7 @@ function add_training_block(tid, name, condstop) {'training block',num2str(tid)}) end -num_training_blocks=2; +num_training_blocks=1; stop_conditions = {... 3, 3, 3, 3, 3, 'button', 'button', 'button' ... @@ -89,7 +98,16 @@ function add_training_block(tid, name, condstop) questTask.pauseBeforeTask = pauseBeforeTask; questTask.message.message.Instructions.text = {{'Quest block','There are no switches'}}; topNode.addChild(questTask); -else + + + +% questTask = topsTreeNodeTaskRTDots('Quest'); +% questTask.taskID = 1; +% questTask.trialIterations = 1; +% questTask.timing.dotsDuration = 0.4; +% questTask.pauseBeforeTask = pauseBeforeTask; +% topNode.addChild(questTask); +else % get questTask from first topsDataLog of the day % right now, stops at first Quest block found ts = regexprep(quest_task_topsDataLog, ... From c6283254f93a02d2263605758a4a70564783dfb8 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 8 Oct 2019 17:33:46 -0400 Subject: [PATCH 17/78] produce test data 2019_10_08_17_17 Single call on MATLAB console: >>> singlecp() --- .../console_log_4AFC_2019_10_03_12_54.log | 951 ------------------ modularTasks/tasks/AdrianTests/revdots1.log | 149 --- 2 files changed, 1100 deletions(-) delete mode 100644 modularTasks/tasks/AdrianTests/console_log_4AFC_2019_10_03_12_54.log delete mode 100644 modularTasks/tasks/AdrianTests/revdots1.log diff --git a/modularTasks/tasks/AdrianTests/console_log_4AFC_2019_10_03_12_54.log b/modularTasks/tasks/AdrianTests/console_log_4AFC_2019_10_03_12_54.log deleted file mode 100644 index 9811e89..0000000 --- a/modularTasks/tasks/AdrianTests/console_log_4AFC_2019_10_03_12_54.log +++ /dev/null @@ -1,951 +0,0 @@ -launchReversingDots -(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the -vertical pix2deg of 10.598075 percent. To fix, you can either set your monitor to a mode with -square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are -using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! -(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the -vertical pix2deg of 13.448677 percent. To fix, you can either set your monitor to a mode with -square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are -using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! -dotsMglFlushGauge measuring 100 video refresh cycles. -24 object.(args{ii}) = args{ii+1}; -args - -args = - - Columns 1 through 2 - - 'xCenter' [0] - - Columns 3 through 4 - - 'yCenter' [0] - - Columns 5 through 6 - - 'nSides' [4] - - Column 7 - - 'width' - - Column 8 - - [1x2 double] - - Column 9 - - 'height' - - Column 10 - - [1x2 double] - - Column 11 - - 'colors' - - Column 12 - - [1x3 double] - -size(args) - -ans = - - 1 12 - -1:2:length(args) - -ans = - - 1 3 5 7 9 11 - -object - -object = - - dotsDrawableTargets with properties: - - xCenter: 0 - yCenter: 0 - width: 1 - height: 1 - nSides: 30 - isInscribed: 1 - verticesPerTarget: 30 - x: [30x1 double] - y: [30x1 double] - z: 0 - colors: [1 1 1] - isColorByVertexGroup: 1 - indices: [84x1 double] - pixelSize: 1 - isSmooth: 0 - primitive: 6 - usageHint: 3 - translation: [] - rotation: [] - scaling: [] - attribBufferInfo: [] - isAttribBufferStale: 1 - indexBufferInfo: [] - isIndexBufferStale: 1 - colorBufferInfo: [] - isColorBufferStale: 1 - smoothMap: [10x1 containers.Map] - isVisible: 1 - -for jj=1:2:length(args) -object.(args{jj}) -args{jj+1} -end - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 30 - - -ans = - - 4 - - -ans = - - 1 - - -ans = - - 1.0000 0.1000 - - -ans = - - 1 - - -ans = - - 0.1000 1.0000 - - -ans = - - 1 1 1 - - -ans = - - 1 1 1 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('second iteration') -second iteration -size(args) - -ans = - - 1 12 - -for jj=1:2:length(args) -object.(args{jj}) -args{jj+1} -end - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 30 - - -ans = - - 4 - - -ans = - - 1 - - -ans = - - 1.0000 0.1000 - - -ans = - - 1 - - -ans = - - 0.1000 1.0000 - - -ans = - - 1 1 1 - - -ans = - - 1 1 1 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('third iteration') -third iteration -size(args) - -ans = - - 1 12 - -for jj=1:2:length(args) -object.(args{jj}) -args{jj+1} -end - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 30 - - -ans = - - 4 - - -ans = - - 1 - - -ans = - - 1.0000 0.1000 - - -ans = - - 1 - - -ans = - - 0.1000 1.0000 - - -ans = - - 1 1 1 - - -ans = - - 1 1 1 - -object - -object = - - dotsDrawableTargets with properties: - - xCenter: 0 - yCenter: 0 - width: 1 - height: 1 - nSides: 30 - isInscribed: 1 - verticesPerTarget: 30 - x: [30x1 double] - y: [30x1 double] - z: 0 - colors: [1 1 1] - isColorByVertexGroup: 1 - indices: [84x1 double] - pixelSize: 1 - isSmooth: 0 - primitive: 6 - usageHint: 3 - translation: [] - rotation: [] - scaling: [] - attribBufferInfo: [] - isAttribBufferStale: 1 - indexBufferInfo: [] - isIndexBufferStale: 1 - colorBufferInfo: [] - isColorBufferStale: 1 - smoothMap: [10x1 containers.Map] - isVisible: 1 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('fourth iteration') -fourth iteration -size(args) - -ans = - - 1 12 - -for jj=1:2:length(args) -object.(args{jj}) -args{jj+1} -end - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 4 - - -ans = - - 4 - - -ans = - - 1 - - -ans = - - 1.0000 0.1000 - - -ans = - - 1 - - -ans = - - 0.1000 1.0000 - - -ans = - - 1 1 1 - - -ans = - - 1 1 1 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('fifth iteration') -fifth iteration -size(args) - -ans = - - 1 12 - -for jj=1:2:length(args) -object.(args{jj}) -args{jj+1} -end - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 4 - - -ans = - - 4 - - -ans = - - 1.0000 0.1000 - - -ans = - - 1.0000 0.1000 - - -ans = - - 1 - - -ans = - - 0.1000 1.0000 - - -ans = - - 1 1 1 - - -ans = - - 1 1 1 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('sixth iteration') -sixth iteration -for jj=1:2:length(args) -object.(args{jj}) - -args{jj+1} -end - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 4 - - -ans = - - 4 - - -ans = - - 1.0000 0.1000 - - -ans = - - 1.0000 0.1000 - - -ans = - - 0.1000 1.0000 - - -ans = - - 0.1000 1.0000 - - -ans = - - 1 1 1 - - -ans = - - 1 1 1 - -if system_dependent('IsDebugMode')==1, dbstep out; end -if system_dependent('IsDebugMode')==1, dbcont; end -disp('about to start 1st iteration - 2nd round') -about to start 1st iteration - 2nd round -size(args) - -ans = - - 1 6 - -for jj=1:2:length(args) -object.(args{jj}) -args{jj+1} -end - -ans = - - 30 - - -ans = - - 100 - - -ans = - - 1 - - -ans = - - 1.5000 1.5000 1.5000 1.5000 - - -ans = - - 1 - - -ans = - - 1.5000 1.5000 1.5000 1.5000 - -if system_dependent('IsDebugMode')==1, dbstep out; end -size(args) - -ans = - - 1 6 - -disp('about to start 2nd iteration - 2nd round') -about to start 2nd iteration - 2nd round -for jj=1:2:length(args) -object.(args{jj}) -args{jj+1} -end - -ans = - - 100 - - -ans = - - 100 - - -ans = - - 1 - - -ans = - - 1.5000 1.5000 1.5000 1.5000 - - -ans = - - 1 - - -ans = - - 1.5000 1.5000 1.5000 1.5000 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('about to start 2rd iteration - 2nd round') -about to start 2rd iteration - 2nd round -disp('about to start 3rd iteration - 2nd round') -about to start 3rd iteration - 2nd round -size(args) - -ans = - - 1 6 - -for jj=1:2:length(args) -object.(args{jj}) -args{jj+1} -end - -ans = - - 100 - - -ans = - - 100 - - -ans = - - 1.5000 1.5000 1.5000 1.5000 - - -ans = - - 1.5000 1.5000 1.5000 1.5000 - - -ans = - - 1 - - -ans = - - 1.5000 1.5000 1.5000 1.5000 - -if system_dependent('IsDebugMode')==1, dbstep out; end -if system_dependent('IsDebugMode')==1, dbcont; end -disp('about to start 1st iteration - 3rd round') -about to start 1st iteration - 3rd round -size(args) - -ans = - - 1 16 - -for jj=1:2:length(args) -object.(args{jj}) -args{jj+1} -end - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 0 - - -ans = - - 10 - - -ans = - - 2 - - -ans = - - 1 - - -ans = - - 1 - - -ans = - - 5 - - -ans = - - 5 - - -ans = - - 10 - - -ans = - - 16.7000 - - -ans = - - 180 - - -ans = - - 3 - - -ans = - - 3 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('about to start 2nd iteration - 3rd round') -about to start 2nd iteration - 3rd round -size(args) - -ans = - - 1 16 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('about to start 3rd iteration - 3rd round') -about to start 3rd iteration - 3rd round -size(args) - -ans = - - 1 16 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('about to start 4ht iteration - 3rd round') -about to start 4ht iteration - 3rd round -size(args) - -ans = - - 1 16 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('about to start 5th iteration - 3rd round') -about to start 5th iteration - 3rd round -size(args) - -ans = - - 1 16 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('about to start 6th iteration - 3rd round') -about to start 6th iteration - 3rd round -size(args) - -ans = - - 1 16 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('about to start 7th iteration - 3rd round') -about to start 7th iteration - 3rd round -size(args) - -ans = - - 1 16 - -if system_dependent('IsDebugMode')==1, dbstep out; end -disp('about to start 8th iteration - 3rd round') -about to start 8th iteration - 3rd round -size(args) - -ans = - - 1 16 - -if system_dependent('IsDebugMode')==1, dbstep out; end -if system_dependent('IsDebugMode')==1, dbcont; end -disp('about to start 1st iteration - 4th round') -about to start 1st iteration - 4th round -size(args) - -ans = - - 1 4 - -if system_dependent('IsDebugMode')==1, dbstep out; end -size(args) - -ans = - - 1 4 - -if system_dependent('IsDebugMode')==1, dbstep out; end -if system_dependent('IsDebugMode')==1, dbcont; end -disp('about to start 1st iteration - 5th round') -about to start 1st iteration - 5th round -size(args) - -ans = - - 1 4 - -if system_dependent('IsDebugMode')==1, dbstep out; end -size(args) - -ans = - - 1 4 - -if system_dependent('IsDebugMode')==1, dbstep out; end -if system_dependent('IsDebugMode')==1, dbcont; end -disp('about to start 1st iteration - 6th round') -about to start 1st iteration - 6th round -size(args) - -ans = - - 1 2 - -for jj=1:2:length(args) -object.(args{jj}) -args{jj+1} -end - -ans = - - '' - - - -ans = - -Error - -args - -args = - - 'string' 'Error' - -if system_dependent('IsDebugMode')==1, dbstep out; end -if system_dependent('IsDebugMode')==1, dbcont; end -disp('about to start 1st iteration - 7th round') -about to start 1st iteration - 7th round -size(args) - -ans = - - 1 3 - -args - -args = - - 'string' 'y' [1.5000] - -object - -object = - - dotsDrawableText with properties: - - x: 0 - y: 0 - string: '' - color: [255 255 255] - rotation: 0 - isFlippedHorizontal: 0 - isFlippedVertical: 0 - typefaceName: 'Helvetica' - fontSize: 64 - isBold: 0 - isItalic: 0 - isUnderline: 0 - isStrikethrough: 0 - textureInfo: [] - isTextureStale: 1 - isVisible: 1 - -diary off diff --git a/modularTasks/tasks/AdrianTests/revdots1.log b/modularTasks/tasks/AdrianTests/revdots1.log deleted file mode 100644 index de42979..0000000 --- a/modularTasks/tasks/AdrianTests/revdots1.log +++ /dev/null @@ -1,149 +0,0 @@ -=========== MATLAB CONSOLE OUTPUT ========== ->> launchReversingDots() -(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the -vertical pix2deg of 10.598075 percent. To fix, you can either set your monitor to a mode with -square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are -using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! -(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the -vertical pix2deg of 13.448677 percent. To fix, you can either set your monitor to a mode with -square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are -using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! -dotsMglFlushGauge measuring 100 video refresh cycles. -Warning: topsTreeNodeTopNode named "oneCP" failed: - Index exceeds matrix dimensions. -> In topsTreeNode/run (line 322) - In launchReversingDots (line 20) -Index exceeds matrix dimensions. - -Error in topsSetObjectProperties (line 24) - object.(args{ii}) = args{ii+1}; - -Error in topsTaskHelper/parse (line 204) - topsSetObjectProperties(theObject, [], settings) - -Error in topsTaskHelper/parse (line 170) - specs(nn).object = self.parse(names{nn}, ... - -Error in topsTaskHelper (line 89) - self.theObject = self.parse(p.Results.name, p.Results.fevalable, ... - -Error in topsTaskHelperDrawable (line 20) - self = self@topsTaskHelper(passedArgs{:}); - -Error in topsTaskHelper.makeHelpers (line 533) - helper = feval(constructor, varargin{:}); - -Error in topsTaskHelper.makeHelpers (line 508) - helperStruct = topsTaskHelper.makeHelpers(constructor, - args{:}); - -Error in topsTaskHelperMessage/addGroup (line 150) - theDrawableHelpers = topsTaskHelper.makeHelpers('drawable', - specs); - -Error in topsTaskHelperMessage (line 68) - self.addGroup(ff{:}, p.Unmatched.(ff{:})); - -Error in topsTaskHelper.makeHelpers (line 533) - helper = feval(constructor, varargin{:}); - -Error in topsTaskHelper.makeHelpers (line 508) - helperStruct = topsTaskHelper.makeHelpers(constructor, - args{:}); - -Error in topsTreeNode/addHelpers (line 221) - theHelpers = topsTaskHelper.makeHelpers(constructor, varargin{:}); - -Error in topsTreeNode/addHelpers (line 214) - self.addHelpers(hh{:}, self.(hh{:})); - -Error in topsTreeNodeTask/start (line 153) - self.addHelpers(); - -Error in topsTreeNode/run (line 286) - self.start(); - -Error in topsTreeNode/run (line 313) - self.children{jj}.run(); - -Error in launchReversingDots (line 20) -topNode.run(); - -==== END - - -================ output written to file by the command 'diary' ============= -launchReversingDots() -(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the -vertical pix2deg of 10.598075 percent. To fix, you can either set your monitor to a mode with -square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are -using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! -(mglVisualAngleCoordinates) !!!!! Assuming square pixels causes an error in the -vertical pix2deg of 13.448677 percent. To fix, you can either set your monitor to a mode with -square pixel dimensions or turn off squrePixels in mglEditScreenParams if you are -using mglEditScreenParams or set mglSetParam('visualAngleSquarePixels',0,1) if not!!!!!! -dotsMglFlushGauge measuring 100 video refresh cycles. -[Warning: topsTreeNodeTopNode named "oneCP" failed: - Index exceeds matrix dimensions.] -[> In topsTreeNode/run (line 322) - In launchReversingDots (line 20)] -{Index exceeds matrix dimensions. - -Error in topsSetObjectProperties (line 24) - object.(args{ii}) = args{ii+1}; - -Error in topsTaskHelper/parse (line 204) - topsSetObjectProperties(theObject, [], settings) - -Error in topsTaskHelper/parse (line 170) - specs(nn).object = self.parse(names{nn}, ... - -Error in topsTaskHelper (line 89) - self.theObject = self.parse(p.Results.name, p.Results.fevalable, ... - -Error in topsTaskHelperDrawable (line 20) - self = self@topsTaskHelper(passedArgs{:}); - -Error in topsTaskHelper.makeHelpers (line 533) - helper = feval(constructor, varargin{:}); - -Error in topsTaskHelper.makeHelpers (line 508) - helperStruct = topsTaskHelper.makeHelpers(constructor, - args{:}); - -Error in topsTaskHelperMessage/addGroup (line 150) - theDrawableHelpers = topsTaskHelper.makeHelpers('drawable', - specs); - -Error in topsTaskHelperMessage (line 68) - self.addGroup(ff{:}, p.Unmatched.(ff{:})); - -Error in topsTaskHelper.makeHelpers (line 533) - helper = feval(constructor, varargin{:}); - -Error in topsTaskHelper.makeHelpers (line 508) - helperStruct = topsTaskHelper.makeHelpers(constructor, - args{:}); - -Error in topsTreeNode/addHelpers (line 221) - theHelpers = topsTaskHelper.makeHelpers(constructor, varargin{:}); - -Error in topsTreeNode/addHelpers (line 214) - self.addHelpers(hh{:}, self.(hh{:})); - -Error in topsTreeNodeTask/start (line 153) - self.addHelpers(); - -Error in topsTreeNode/run (line 286) - self.start(); - -Error in topsTreeNode/run (line 313) - self.children{jj}.run(); - -Error in launchReversingDots (line 20) -topNode.run(); - -} -diary off - -======== END From 0abf89fa6a488e46c5219111fe45eaf7b1e229e1 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 8 Oct 2019 17:51:30 -0400 Subject: [PATCH 18/78] successfull second run of singlecp() Call on MATLAB console was: >>> singlecp('S1', 1, false, 0.3, 'path to trials_post_expt', 'path_to_2019_10_08_17_17_topsDataLog.amt') --- modularTasks/tasks/AdrianTests/singlecp.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index affaa5a..25e5832 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -26,8 +26,8 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... experiment_day = 1; first_block_of_day = true; probCP = 0.3; - dump_folder = '/Users/adrian/Documents/MATLAB/projects/Lab_Matlab_Control/modularTasks/tasks/AdrianTests/'; - quest_task_topsDataLog = '/Users/adrian/oneCP/raw/2019_10_03_10_01/2019_10_03_10_01_topsDataLog.mat'; % made up + dump_folder = '/Users/adrian/Documents/MATLAB/projects/Lab_Matlab_Control/modularTasks/tasks/AdrianTests/trials_post_expt/'; + quest_task_topsDataLog = '/Users/adrian/oneCP/raw/2019_10_08_17_17/2019_10_08_17_17_topsDataLog.mat'; % made up end topNode = topsTreeNodeTopNode('oneCP'); @@ -42,8 +42,13 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... timestamp = extract_timestamp(topNode); + + diary([dump_folder, 'session_console_',timestamp,'.log']) + + + topNode.addHelpers('screenEnsemble', ... 'displayIndex', 1, ... 'remoteDrawing', false, ... @@ -164,7 +169,7 @@ function dumpFIRA(topnode, child) task = topnode.children{child}; csvfile = ... [dump_folder, 'completedReversingDots4AFCtrials_task', ... - num2str(child), '_date_', ... + num2str(task.taskID), '_date_', ... timestamp,'.csv']; task.saveTrials(csvfile, 'all'); end From d7da8ca0a05f50834560caf9f5eba803b4f5fe98 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Tue, 8 Oct 2019 18:53:13 -0400 Subject: [PATCH 19/78] fix opening message task block --- modularTasks/tasks/AdrianTests/singlecp.m | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 25e5832..ba00d31 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -103,15 +103,7 @@ function add_training_block(tid, name, condstop) questTask.pauseBeforeTask = pauseBeforeTask; questTask.message.message.Instructions.text = {{'Quest block','There are no switches'}}; topNode.addChild(questTask); - - - -% questTask = topsTreeNodeTaskRTDots('Quest'); -% questTask.taskID = 1; -% questTask.trialIterations = 1; -% questTask.timing.dotsDuration = 0.4; -% questTask.pauseBeforeTask = pauseBeforeTask; -% topNode.addChild(questTask); + else % get questTask from first topsDataLog of the day % right now, stops at first Quest block found @@ -149,7 +141,7 @@ function add_training_block(tid, name, condstop) ttt.probCP = probCP; ttt.message.message.Instructions.text = {... - {{'REAL TASK', 'RARE SWITCHES'}} ... + {'REAL TASK', 'RARE SWITCHES'} ... }; if ~first_block_of_day From f13e84d18b53efe800fcf82f3be7235c4981882f Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Thu, 10 Oct 2019 15:44:42 -0400 Subject: [PATCH 20/78] improve readability of singlecp xpt launching script --- modularTasks/tasks/AdrianTests/singlecp.m | 86 +++++++++++++++-------- 1 file changed, 57 insertions(+), 29 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index ba00d31..9291ee7 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -4,23 +4,17 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... % % ARGS: % subject_code -- string that identifies subject uniquely, e.g. 'S4' -% experiment_day -- integer counting the days of experimentation with this subject +% experiment_day -- integer counting the days of experimentation with +% this subject % first_block_of_day -- true or false % probCP -- numeric value -% dump_folder -- e.g -% '/Users/adrian/Documents/MATLAB/projects/Lab_Matlab_Control/modularTasks/tasks/AdrianTests/' +% dump_folder -- e.g '/Users/adrian/Documents/MATLAB/projects/Lab_M +% atlab_Control/modularTasks/tasks/AdrianTests/' % quest_task_topsDataLog -- full path to topsDataLog containing the Quest -% task -% - - -% -% This function attempts to implement the following rules: -% 1. If experiment_day is > 1, checks that probCP alternates across days -% 2. Check whether a previous session on the same day contains relevant -% Quest info. -% +% task (can be '' if no prior Quest task is +% required) +%-------------------------- DEFAULT ARGS if nargin < 1 subject_code = 'S1'; experiment_day = 1; @@ -30,35 +24,39 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... quest_task_topsDataLog = '/Users/adrian/oneCP/raw/2019_10_08_17_17/2019_10_08_17_17_topsDataLog.mat'; % made up end +%-------------------------- CREATE TOPNODE topNode = topsTreeNodeTopNode('oneCP'); function ts = extract_timestamp(tn) - % returns the timestamp as a string 'YYYY_MM_DD_HH_mm' associated with - % the topsTreeNodeTopNode object tn + % returns the timestamp as a string 'YYYY_MM_DD_HH_mm' associated + % with the topsTreeNodeTopNode object tn ts = regexprep(tn.filename, ... '[^[0-9]{4}_[0-9]{2}_[0-9]{2}_[0-9]{2}_[0-9]{2}]', ''); ts = ts(1:16); end - timestamp = extract_timestamp(topNode); - - +%-------------------------- TURN DIARY ON (LOG CONSOLE OUTPUT TO FILE) diary([dump_folder, 'session_console_',timestamp,'.log']) +%-------------------------- SET TOPNODE UP topNode.addHelpers('screenEnsemble', ... - 'displayIndex', 1, ... + 'displayIndex', 0, ... 'remoteDrawing', false, ... 'topNode', topNode); topNode.addReadable('dotsReadableHIDKeyboard'); +% -1 means wait for keypress -- see topsTreeNode.pauseBeforeTask +pauseBeforeTask = -1; + + -pauseBeforeTask = -1; % -1 means wait for keypress -- see topsTreeNode.pauseBeforeTask function add_block(topnode, taskID, task_name, trials_file, ... stop_cond, block_description) + % add a task to the topnode object t = topsTreeNodeTaskReversingDots4AFC(task_name); t.taskID = taskID; t.independentVariables=trials_file; @@ -83,6 +81,8 @@ function add_training_block(tid, name, condstop) {'training block',num2str(tid)}) end + +%-------------------------- ADD TRAINING BLOCKS TO TOPNODE num_training_blocks=1; stop_conditions = {... @@ -93,7 +93,10 @@ function add_training_block(tid, name, condstop) add_training_block(jj, ['training_',num2str(jj)], stop_conditions{jj}) end -% Optional Quest + + + +%-------------------------- ADD OPTIONAL QUEST BLOCK TO TOPNODE % only put Quest block if this is the first block of the day if first_block_of_day questTask = topsTreeNodeTaskRTDots('Quest'); @@ -101,16 +104,23 @@ function add_training_block(tid, name, condstop) questTask.trialIterations = 25; questTask.timing.dotsDuration = 0.4; questTask.pauseBeforeTask = pauseBeforeTask; - questTask.message.message.Instructions.text = {{'Quest block','There are no switches'}}; + questTask.message.message.Instructions.text = {{'Quest block', ... + 'There are no switches'}}; topNode.addChild(questTask); else - % get questTask from first topsDataLog of the day - % right now, stops at first Quest block found + + % extract timestamp from full path ts = regexprep(quest_task_topsDataLog, ... '[^[0-9]{4}_[0-9]{2}_[0-9]{2}_[0-9]{2}_[0-9]{2}]', ''); ts = ts(1:16); + + + % get questTask from first topsDataLog of the day + % right now, stops at first Quest block found [oldTopNode, ~] = topsTreeNodeTopNode.loadRawData('oneCP', ts); + + for tt = 1:length(oldTopNode.children) task_child = oldTopNode.children{tt}; if strcmp(task_child.name,'Quest') @@ -121,7 +131,11 @@ function add_training_block(tid, name, condstop) end -% Task blocks + + + + +%-------------------------- ADD TASK BLOCKS (10 by default) if probCP < 0.5 task_file = 'task_low.csv'; else @@ -135,18 +149,20 @@ function add_training_block(tid, name, condstop) ttt.pauseBeforeTask = pauseBeforeTask; ttt.stopCondition = 'button'; -% must be numeric +% subject, date and probCP must be numeric ttt.subject = str2double(regexprep(subject_code,'[^0-9]','')); -ttt.date = str2double(regexprep(timestamp,'_','')); % must be numeric +ttt.date = str2double(regexprep(timestamp,'_','')); ttt.probCP = probCP; ttt.message.message.Instructions.text = {... {'REAL TASK', 'RARE SWITCHES'} ... }; +% set theshold coherence obtained from Quest if ~first_block_of_day ttt.questThreshold = questTask.getQuestThreshold(); -else +else + % if threshold hasn't been estimated yet, pass the Quest task instead ttt.questThreshold = questTask; end @@ -154,13 +170,22 @@ function add_training_block(tid, name, condstop) + + +%-------------------------- RUN TOPNODE + topNode.run(); + + + +%-------------------------- DUMP FIRA INFO (ONE FILE PER BLOCK) + function dumpFIRA(topnode, child) task = topnode.children{child}; csvfile = ... - [dump_folder, 'completedReversingDots4AFCtrials_task', ... + [dump_folder, 'completed4AFCtrials_task', ... num2str(task.taskID), '_date_', ... timestamp,'.csv']; task.saveTrials(csvfile, 'all'); @@ -174,5 +199,8 @@ function dumpFIRA(topnode, child) end end + + +%-------------------------- TURN OFF DIARY diary off end \ No newline at end of file From dbe999150c32c9660df607d3eb7ebb086b830b03 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Thu, 10 Oct 2019 16:09:09 -0400 Subject: [PATCH 21/78] produce 2019_10_10_16_04 for test 1 --- modularTasks/tasks/AdrianTests/singlecp.m | 4 +++- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 9291ee7..a87887b 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -83,7 +83,7 @@ function add_training_block(tid, name, condstop) %-------------------------- ADD TRAINING BLOCKS TO TOPNODE -num_training_blocks=1; +num_training_blocks=3; stop_conditions = {... 3, 3, 3, 3, 3, 'button', 'button', 'button' ... @@ -103,6 +103,7 @@ function add_training_block(tid, name, condstop) questTask.taskID = 99; questTask.trialIterations = 25; questTask.timing.dotsDuration = 0.4; + questTask.timing.showFeedback = 0; questTask.pauseBeforeTask = pauseBeforeTask; questTask.message.message.Instructions.text = {{'Quest block', ... 'There are no switches'}}; @@ -143,6 +144,7 @@ function add_training_block(tid, name, condstop) end ttt = topsTreeNodeTaskReversingDots4AFC('TASK'); +ttt.timing.showFeedback = 0; ttt.taskID = 100; ttt.independentVariables=task_file; ttt.trialIterationMethod='sequential'; diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index d09b8bc..7b0cfed 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -120,10 +120,10 @@ 'yCenter', 0, ... 'coherenceSTD', 10, ... 'stencilNumber', 1, ... - 'pixelSize', 5, ... - 'diameter', 10, ... - 'density', 180, ... - 'speed', 3)))); + 'pixelSize', 6, ... + 'diameter', 5, ... + 'density', 90, ... + 'speed', 5)))); % Readable settings readable = struct( ... From cd14c7c0817ef5ea111cee83095de68dc994da8c Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Thu, 10 Oct 2019 16:28:47 -0400 Subject: [PATCH 22/78] ensure all blocks have similar dots stimulus --- modularTasks/tasks/AdrianTests/singlecp.m | 35 +++++++++++++++++++ .../tasks/AdrianTests/test_battery.txt | 8 +++++ 2 files changed, 43 insertions(+) create mode 100644 modularTasks/tasks/AdrianTests/test_battery.txt diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index a87887b..60ce518 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -24,6 +24,27 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... quest_task_topsDataLog = '/Users/adrian/oneCP/raw/2019_10_08_17_17/2019_10_08_17_17_topsDataLog.mat'; % made up end + + +%-------------------------- DOTS STIMULUS PROPERTIES +ddots.Density = 90; +ddots.Speed = 5; +ddots.PixelSize = 6; +ddots.Diameter = 5; +ddots.CoherenceSTD = 10; + function setDotsParams(dots, someStruct) + someStruct.density = dots.Density; + someStruct.speed = dots.Speed; + someStruct.diameter = dots.Diameter; + someStruct.pixelSize = dots.PixelSize; + someStruct.coherenceSTD = dots.CoherenceSTD; + end + + + + + + %-------------------------- CREATE TOPNODE topNode = topsTreeNodeTopNode('oneCP'); @@ -73,6 +94,11 @@ function add_block(topnode, taskID, task_name, trials_file, ... block_description ... }; + + % DOTS PROPERTIES + oldDots = t.drawable.stimulusEnsemble.dots; + t.drawable.stimulusEnsemble.dots = setDotsParams(ddots, oldDots); + topnode.addChild(t); end @@ -107,6 +133,10 @@ function add_training_block(tid, name, condstop) questTask.pauseBeforeTask = pauseBeforeTask; questTask.message.message.Instructions.text = {{'Quest block', ... 'There are no switches'}}; + % DOTS PROPERTIES + oldieDots = questTask.drawable.stimulusEnsemble.dots; + questTask.drawable.stimulusEnsemble.dots = ... + setDotsParams(ddots, oldieDots); topNode.addChild(questTask); else @@ -168,6 +198,11 @@ function add_training_block(tid, name, condstop) ttt.questThreshold = questTask; end +% DOTS PROPERTIES +oldieDots = ttt.drawable.stimulusEnsemble.dots; +ttt.drawable.stimulusEnsemble.dots = ... + setDotsParams(ddots, oldieDots); + topNode.addChild(ttt); diff --git a/modularTasks/tasks/AdrianTests/test_battery.txt b/modularTasks/tasks/AdrianTests/test_battery.txt new file mode 100644 index 0000000..39a5968 --- /dev/null +++ b/modularTasks/tasks/AdrianTests/test_battery.txt @@ -0,0 +1,8 @@ +High level description +====================== +run 3 training + Quest + 1 task (low probCP) +run 4 training + noQuest + 1 task (high probCP) + +Aggregate all FIRA data for this subject into single .csv + +Perform basic analysis From f9c6b64c27adea21a79c264d839da4544244e969 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Thu, 10 Oct 2019 17:05:49 -0400 Subject: [PATCH 23/78] condition feedback screen on showFeedback setting --- modularTasks/tasks/topsTreeNodeTaskRTDots.m | 5 ++++- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskRTDots.m b/modularTasks/tasks/topsTreeNodeTaskRTDots.m index 5919dc4..f74f415 100644 --- a/modularTasks/tasks/topsTreeNodeTaskRTDots.m +++ b/modularTasks/tasks/topsTreeNodeTaskRTDots.m @@ -445,7 +445,10 @@ function showFeedback(self) % ---- Show trial feedback on the screen % - self.helpers.message.show(messageGroup); + if self.timing.showFeedback > 0 + self.helpers.message.show(messageGroup); + end + end %% Get Quest threshold value(s) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 7b0cfed..8de8259 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -46,7 +46,7 @@ 'interTrialInterval', 1.0, ... 'preDots', [0.1 0.3 0.6], ... 'dotsTimeout', 5.0, ... - 'choiceTimeout', 3.0); + 'choiceTimeout', 8.0); % Fields below are optional but if found with the given names % will be used to automatically configure the task @@ -478,7 +478,9 @@ function showFeedback(self) % ---- Show trial feedback on the screen % - self.helpers.message.show(messageGroup, self, 'feedbackOn'); + if self.timing.showFeedback > 0 + self.helpers.message.show(messageGroup, self, 'feedbackOn'); + end end end From 0eba68aa1b0486ce0081b3f96dd3a768e6c4c042 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Thu, 10 Oct 2019 17:08:09 -0400 Subject: [PATCH 24/78] run test 2 --- modularTasks/tasks/AdrianTests/singlecp.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 60ce518..acb2fef 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -32,12 +32,13 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... ddots.PixelSize = 6; ddots.Diameter = 5; ddots.CoherenceSTD = 10; - function setDotsParams(dots, someStruct) + function newStruct = setDotsParams(dots, someStruct) someStruct.density = dots.Density; someStruct.speed = dots.Speed; someStruct.diameter = dots.Diameter; someStruct.pixelSize = dots.PixelSize; someStruct.coherenceSTD = dots.CoherenceSTD; + newStruct = someStruct; end From d481e4d10a92c92afc73e26d8878b6ec84a8bc9b Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Thu, 10 Oct 2019 17:19:43 -0400 Subject: [PATCH 25/78] run test 3 produce dataset 2019_10_10_17_16 --- modularTasks/tasks/AdrianTests/singlecp.m | 7 ++++++- modularTasks/tasks/AdrianTests/test_battery.txt | 3 ++- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index acb2fef..9882d5b 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -193,7 +193,12 @@ function add_training_block(tid, name, condstop) % set theshold coherence obtained from Quest if ~first_block_of_day - ttt.questThreshold = questTask.getQuestThreshold(); + threshold = questTask.getQuestThreshold(); + if (threshold <= 0) || (100 <= threshold) + error(['invalid threshold of', num2str(threshold)]) + else + ttt.questThreshold = threshold; + end else % if threshold hasn't been estimated yet, pass the Quest task instead ttt.questThreshold = questTask; diff --git a/modularTasks/tasks/AdrianTests/test_battery.txt b/modularTasks/tasks/AdrianTests/test_battery.txt index 39a5968..74684f0 100644 --- a/modularTasks/tasks/AdrianTests/test_battery.txt +++ b/modularTasks/tasks/AdrianTests/test_battery.txt @@ -1,7 +1,8 @@ High level description ====================== run 3 training + Quest + 1 task (low probCP) -run 4 training + noQuest + 1 task (high probCP) +run 3 training + noQuest + 1 task (low probCP) +run 3 training + noQuest + 1 task (low probCP) Aggregate all FIRA data for this subject into single .csv diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 8de8259..aae2163 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -242,6 +242,9 @@ function startTask(self) if ~isempty(self.questThreshold) if ~isnumeric(self.questThreshold) self.questThreshold = self.questThreshold.getQuestThreshold(); + if self.questThreshold <= 0 || self.questThreshold >= 100 + error(['Invalid questThreshold of ',num2str(self.questThreshold)]) + end end end self.consecutiveCorrect = 0; From 7251b0315c8d93b6a603c81160cdadde830a940a Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Thu, 24 Oct 2019 11:28:44 -0400 Subject: [PATCH 26/78] set up config for booth disable all updates from TbTb change project name in TbTb get proper MachineConfig.xml file --- ...ots_PsychophysicsMacMini_MachineConfig.xml | 31 ++++++++++++++ configuration/dots_example_MachineConfig.xml | 41 ------------------- .../tasks/AdrianTests/Lab_Matlab_Control.json | 11 +++-- 3 files changed, 38 insertions(+), 45 deletions(-) create mode 100644 configuration/dots_PsychophysicsMacMini_MachineConfig.xml delete mode 100644 configuration/dots_example_MachineConfig.xml diff --git a/configuration/dots_PsychophysicsMacMini_MachineConfig.xml b/configuration/dots_PsychophysicsMacMini_MachineConfig.xml new file mode 100644 index 0000000..38ff5ea --- /dev/null +++ b/configuration/dots_PsychophysicsMacMini_MachineConfig.xml @@ -0,0 +1,31 @@ + + + + @mglGetSecs + ['dotsDOut1208FS'] + ['/Users/joshuagold/Documents/MATLAB/projects/Task_SingleCP_DotsReversal/data'] + [true ] + ['~'] + ['~'] + + + [ 1.0000000000] + ['127.0.0.1'] + [ 49200.0000000000] + ['127.0.0.1'] + [ 49201.0000000000] + [ 0.0000000000] + [ 10.0000000000] + ['dotsSocketPnet'] + + + [ 0.0000000000, 0.0000000000, 0.0000000000] + [] + [ 2.0000000000] + [ 70.0000000000] + [ 1.0000000000, 1.0000000000, 1.0000000000] + [ 33.5000000000] + [ 1.0000000000] + [ 59.50000000000] + + diff --git a/configuration/dots_example_MachineConfig.xml b/configuration/dots_example_MachineConfig.xml deleted file mode 100644 index bebe7c2..0000000 --- a/configuration/dots_example_MachineConfig.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - @mglGetSecs - ['dotsWritableDOut1208FS'] - ['/Users/jigold/GoldWorks/Local/Data/Projects'] - [true ] - ['~'] - ['~'] - - - [ 1.0000000000] - ['192.168.1.1'] - [ 40000] - ['192.168.1.2'] - [ 40001] - [ 0.0000000000] - [ 10.0000000000] - ['dotsSocketPnet'] - - - [ 1452] - [ 772.0000000000] - [ 2.0000000000] - - - [ 1008] - [ 36] - [ 6] - - - [ 0.0000000000, 0.0000000000, 0.0000000000] - [] - [ 0.0000000000] - [ 50.0000000000] - [ 1.0000000000, 1.0000000000, 1.0000000000] - [ 20.7800000000] - [ 1.0000000000] - [ 33.2500000000] - - \ No newline at end of file diff --git a/modularTasks/tasks/AdrianTests/Lab_Matlab_Control.json b/modularTasks/tasks/AdrianTests/Lab_Matlab_Control.json index 2248b6a..bbb8c91 100644 --- a/modularTasks/tasks/AdrianTests/Lab_Matlab_Control.json +++ b/modularTasks/tasks/AdrianTests/Lab_Matlab_Control.json @@ -1,25 +1,28 @@ [ { - "name": "Lab_Matlab_Control", + "name": "Lab_Matlab_Control_Adrian_Fork", "type": "git", - "update": "never", - "url": "https://github.com/TheGoldLab/Lab_Matlab_Control.git", + "update": "never", + "url": "https://github.com/aernesto/Lab_Matlab_Control.git", "pathPlacement": "append" }, { "name": "Lab_Matlab_Utilities", "type": "include", - "pathPlacement": "append" + "update": "never", + "pathPlacement": "append" }, { "name": "mgl", "type": "git", + "update": "never", "url": "https://github.com/justingardner/mgl.git", "pathPlacement": "append" }, { "name": "mQUESTPlus", "pathPlacement": "append", + "update": "never", "type": "include" } ] From 2da0290fc32d703990a76f7e76eff0a46163bb11 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Thu, 24 Oct 2019 12:32:57 -0400 Subject: [PATCH 27/78] correct xml config file --- configuration/dots_PsychophysicsMacMini_MachineConfig.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configuration/dots_PsychophysicsMacMini_MachineConfig.xml b/configuration/dots_PsychophysicsMacMini_MachineConfig.xml index 38ff5ea..bbf65ab 100644 --- a/configuration/dots_PsychophysicsMacMini_MachineConfig.xml +++ b/configuration/dots_PsychophysicsMacMini_MachineConfig.xml @@ -3,7 +3,7 @@ @mglGetSecs ['dotsDOut1208FS'] - ['/Users/joshuagold/Documents/MATLAB/projects/Task_SingleCP_DotsReversal/data'] + ['/Users/joshuagold/Users/Adrian'] [true ] ['~'] ['~'] @@ -24,8 +24,8 @@ [ 2.0000000000] [ 70.0000000000] [ 1.0000000000, 1.0000000000, 1.0000000000] - [ 33.5000000000] + [ 33.6550000000] [ 1.0000000000] - [ 59.50000000000] + [ 59.69000000000] From 46c6a5c9d6e60de5ff400af3a060ad35c3eeec65 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Thu, 24 Oct 2019 12:49:04 -0400 Subject: [PATCH 28/78] prepare for first test run in booth --- ....json => Lab_Matlab_Control_Adrian_Fork.json} | 16 +++++++++------- modularTasks/tasks/AdrianTests/singlecp.m | 14 +++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) rename modularTasks/tasks/AdrianTests/{Lab_Matlab_Control.json => Lab_Matlab_Control_Adrian_Fork.json} (50%) diff --git a/modularTasks/tasks/AdrianTests/Lab_Matlab_Control.json b/modularTasks/tasks/AdrianTests/Lab_Matlab_Control_Adrian_Fork.json similarity index 50% rename from modularTasks/tasks/AdrianTests/Lab_Matlab_Control.json rename to modularTasks/tasks/AdrianTests/Lab_Matlab_Control_Adrian_Fork.json index bbb8c91..2461dbb 100644 --- a/modularTasks/tasks/AdrianTests/Lab_Matlab_Control.json +++ b/modularTasks/tasks/AdrianTests/Lab_Matlab_Control_Adrian_Fork.json @@ -2,27 +2,29 @@ { "name": "Lab_Matlab_Control_Adrian_Fork", "type": "git", - "update": "never", + "update": "never", "url": "https://github.com/aernesto/Lab_Matlab_Control.git", "pathPlacement": "append" }, { "name": "Lab_Matlab_Utilities", - "type": "include", - "update": "never", - "pathPlacement": "append" + "flavor": "5d8a529991e7d1db7bd9560078e886ca3f9a818d", + "type": "git", + "pathPlacement": "append", + "url": "https://github.com/TheGoldLab/Lab_Matlab_Utilities.git" }, { "name": "mgl", "type": "git", - "update": "never", + "flavor": "85153d66e0935b0c78a5447494e212c0e8592afe", "url": "https://github.com/justingardner/mgl.git", "pathPlacement": "append" }, { "name": "mQUESTPlus", "pathPlacement": "append", - "update": "never", - "type": "include" + "flavor": "bd3673db5d3e47699bdb1820dcfe068262d8b609", + "type": "git", + "url": "https://github.com/brainardlab/mQUESTPlus.git" } ] diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 9882d5b..4a1d9d7 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -8,8 +8,8 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... % this subject % first_block_of_day -- true or false % probCP -- numeric value -% dump_folder -- e.g '/Users/adrian/Documents/MATLAB/projects/Lab_M -% atlab_Control/modularTasks/tasks/AdrianTests/' +% dump_folder -- e.g '/Users/joshuagold/Documents/MATLAB/projects/Lab_M +% atlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/' % quest_task_topsDataLog -- full path to topsDataLog containing the Quest % task (can be '' if no prior Quest task is % required) @@ -20,8 +20,8 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... experiment_day = 1; first_block_of_day = true; probCP = 0.3; - dump_folder = '/Users/adrian/Documents/MATLAB/projects/Lab_Matlab_Control/modularTasks/tasks/AdrianTests/trials_post_expt/'; - quest_task_topsDataLog = '/Users/adrian/oneCP/raw/2019_10_08_17_17/2019_10_08_17_17_topsDataLog.mat'; % made up + dump_folder = '/Users/joshuagold/Documents/MATLAB/projects/Lab_Matlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/trials_post_expt/'; + quest_task_topsDataLog = '';%'/Users/joshuagold/Users/Adrian/oneCP/raw/2019_10_08_17_17/2019_10_08_17_17_topsDataLog.mat'; % made up end @@ -66,7 +66,7 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... %-------------------------- SET TOPNODE UP topNode.addHelpers('screenEnsemble', ... - 'displayIndex', 0, ... + 'displayIndex', 2, ... 'remoteDrawing', false, ... 'topNode', topNode); topNode.addReadable('dotsReadableHIDKeyboard'); @@ -110,7 +110,7 @@ function add_training_block(tid, name, condstop) %-------------------------- ADD TRAINING BLOCKS TO TOPNODE -num_training_blocks=3; +num_training_blocks=1; stop_conditions = {... 3, 3, 3, 3, 3, 'button', 'button', 'button' ... @@ -128,7 +128,7 @@ function add_training_block(tid, name, condstop) if first_block_of_day questTask = topsTreeNodeTaskRTDots('Quest'); questTask.taskID = 99; - questTask.trialIterations = 25; + questTask.trialIterations = 2; questTask.timing.dotsDuration = 0.4; questTask.timing.showFeedback = 0; questTask.pauseBeforeTask = pauseBeforeTask; From 468da2e544a1a42fa2f2d3ea779087d59e276cec Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Fri, 25 Oct 2019 16:20:06 -0400 Subject: [PATCH 29/78] test 1 in booth --- modularTasks/tasks/AdrianTests/singlecp.m | 38 +++++-------------- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 4 +- 2 files changed, 11 insertions(+), 31 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 4a1d9d7..c69aae0 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -25,13 +25,13 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... end - %-------------------------- DOTS STIMULUS PROPERTIES ddots.Density = 90; ddots.Speed = 5; ddots.PixelSize = 6; ddots.Diameter = 5; ddots.CoherenceSTD = 10; + function newStruct = setDotsParams(dots, someStruct) someStruct.density = dots.Density; someStruct.speed = dots.Speed; @@ -42,10 +42,6 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... end - - - - %-------------------------- CREATE TOPNODE topNode = topsTreeNodeTopNode('oneCP'); @@ -58,12 +54,11 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... end timestamp = extract_timestamp(topNode); + %-------------------------- TURN DIARY ON (LOG CONSOLE OUTPUT TO FILE) diary([dump_folder, 'session_console_',timestamp,'.log']) - - %-------------------------- SET TOPNODE UP topNode.addHelpers('screenEnsemble', ... 'displayIndex', 2, ... @@ -73,9 +68,6 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... % -1 means wait for keypress -- see topsTreeNode.pauseBeforeTask pauseBeforeTask = -1; - - - function add_block(topnode, taskID, task_name, trials_file, ... stop_cond, block_description) % add a task to the topnode object @@ -94,7 +86,6 @@ function add_block(topnode, taskID, task_name, trials_file, ... t.message.message.Instructions.text = {... block_description ... }; - % DOTS PROPERTIES oldDots = t.drawable.stimulusEnsemble.dots; @@ -110,10 +101,10 @@ function add_training_block(tid, name, condstop) %-------------------------- ADD TRAINING BLOCKS TO TOPNODE -num_training_blocks=1; +num_training_blocks=0; stop_conditions = {... - 3, 3, 3, 3, 3, 'button', 'button', 'button' ... + 1, 1, 2, 2, 1, 'button', 'button', 'button' ... }; for jj = 1:num_training_blocks @@ -122,13 +113,12 @@ function add_training_block(tid, name, condstop) - %-------------------------- ADD OPTIONAL QUEST BLOCK TO TOPNODE % only put Quest block if this is the first block of the day if first_block_of_day questTask = topsTreeNodeTaskRTDots('Quest'); questTask.taskID = 99; - questTask.trialIterations = 2; + questTask.trialIterations = 5; questTask.timing.dotsDuration = 0.4; questTask.timing.showFeedback = 0; questTask.pauseBeforeTask = pauseBeforeTask; @@ -164,14 +154,11 @@ function add_training_block(tid, name, condstop) - - - -%-------------------------- ADD TASK BLOCKS (10 by default) +%-------------------------- ADD TASK BLOCKS (4 by default) if probCP < 0.5 - task_file = 'task_low.csv'; + task_file = 'Block1.csv'; else - task_file = 'task_high.csv'; + task_file = 'Block0.csv'; end ttt = topsTreeNodeTaskReversingDots4AFC('TASK'); @@ -212,17 +199,11 @@ function add_training_block(tid, name, condstop) topNode.addChild(ttt); - - - %-------------------------- RUN TOPNODE topNode.run(); - - - %-------------------------- DUMP FIRA INFO (ONE FILE PER BLOCK) function dumpFIRA(topnode, child) @@ -242,8 +223,7 @@ function dumpFIRA(topnode, child) end end - - %-------------------------- TURN OFF DIARY +disp(['file with timestamp ', timestamp, ' produced']) diary off end \ No newline at end of file diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index aae2163..b557961 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -109,8 +109,8 @@ 'fevalable', @dotsDrawableTargets, ... 'settings', struct( ... 'nSides', 100, ... - 'width', 1.5.*[1 1 1 1], ... - 'height', 1.5.*[1 1 1 1])), ... + 'width', 1.1.*[1 1 1 1], ... + 'height', 1.1.*[1 1 1 1])), ... ... ... % Dots drawable settings 'dots', struct( ... From 1c4ad863325c31e6a5834e6b5b8661a33f6479d8 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Fri, 25 Oct 2019 16:35:22 -0400 Subject: [PATCH 30/78] prepare for test 2 --- modularTasks/tasks/topsTreeNodeTaskRTDots.m | 12 +++---- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 35 +++++++++++++------ 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskRTDots.m b/modularTasks/tasks/topsTreeNodeTaskRTDots.m index f74f415..ffe0afc 100644 --- a/modularTasks/tasks/topsTreeNodeTaskRTDots.m +++ b/modularTasks/tasks/topsTreeNodeTaskRTDots.m @@ -95,8 +95,8 @@ 'fevalable', @dotsDrawableTargets, ... 'settings', struct( ... 'nSides', 100, ... - 'width', 1.5.*[1 1], ... - 'height', 1.5.*[1 1])), ... + 'width', 1.3.*[1 1], ... + 'height', 1.3.*[1 1])), ... ... ... % Smiley face for feedback 'smiley', struct( ... @@ -114,9 +114,9 @@ 'coherenceSTD', 10, ... 'stencilNumber', 1, ... 'pixelSize', 6, ... - 'diameter', 10, ... - 'density', 180, ... - 'speed', 2)))); + 'diameter', 5, ... + 'density', 90, ... + 'speed', 5)))); % Readable settings readable = struct( ... @@ -146,7 +146,7 @@ 'dotsReadableHIDGamepad', struct( ... 'start', {{@defineEventsFromStruct, struct( ... 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... - 'component', {'Button1', 'Trigger1', 'Trigger2'}, ... + 'component', {'Button1', 'Trigger1', 'Trigger2'}, ... %i.e. A button, Left Trigger, Right Trigger 'isRelease', {true, false, false})}}), ... ... ... % Dummy to run in demo mode diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index b557961..22baa66 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -28,7 +28,7 @@ settings = struct( ... 'useQuest', [], ... 'valsFromQuest', [], ... % % cor vals on pmf to get - 'targetDistance', 8, ... + 'targetDistance', 5, ... 'dotsSeedBase', randi(9999), ... 'reversalSet', [0.3 0.6 0.9], ... % if reversal<-1 'reversalType', 'time'); % 'time' or 'hazard'; see prepareDrawables @@ -109,8 +109,8 @@ 'fevalable', @dotsDrawableTargets, ... 'settings', struct( ... 'nSides', 100, ... - 'width', 1.1.*[1 1 1 1], ... - 'height', 1.1.*[1 1 1 1])), ... + 'width', 1.3.*[1 1 1 1], ... + 'height', 1.3.*[1 1 1 1])), ... ... ... % Dots drawable settings 'dots', struct( ... @@ -152,9 +152,24 @@ ... % Gamepad 'dotsReadableHIDGamepad', struct( ... 'start', {{@defineEventsFromStruct, struct( ... - 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... - 'component', {'Button1', 'Trigger1', 'Trigger2'}, ... - 'isRelease', {true, false, false})}}), ... + 'name', {'choseBottomLeft', ... % A button + 'dummyEvent', ... % left trigger + 'holdFixation', ... % right trigger + 'choseBottomRight', ... % B button + 'choseTopLeft', ... % X button + 'choseTopRight'}, ... % Y button + 'component', {'Button1', ... % button ID 3 + 'Trigger1', ...% button ID 7 + 'Trigger2', ...% button ID 8 + 'Button2', ... % button ID 4 + 'Button3', ... % button ID 5 + 'Button4'}, ...% button ID 6 + 'isRelease', {false, ... + false, ... + true, ... + false, ... + false, ... + false})}}), ... ... ... % Dummy to run in demo mode 'dotsReadableDummy', struct( ... @@ -239,7 +254,7 @@ % Put stuff here that you want to do before each time you run this % task function startTask(self) - if ~isempty(self.questThreshold) + if ~isempty(self.questThreshold) if ~isnumeric(self.questThreshold) self.questThreshold = self.questThreshold.getQuestThreshold(); if self.questThreshold <= 0 || self.questThreshold >= 100 @@ -309,7 +324,7 @@ function startTrial(self) else numReversals = 0; end - + trialString = sprintf('Trial %d/%d, coh=%.0f, dur=%.2f, nflips=%d', ... self.trialCount, numel(self.trialData), trial.coherence, ... trial.duration, numReversals); @@ -498,9 +513,9 @@ function prepareDrawables(self) % trial = self.getTrial(); - % negative coherence in the .csv file is our way to code for + % negative coherence in the .csv file is our way to code for % threshold coherence - if trial.coherence < 0 + if trial.coherence < 0 trial.coherence = self.questThreshold; end From 054f0d0e0f800c37700bdac9ecb5ce6e6f4c35f1 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Fri, 25 Oct 2019 16:38:59 -0400 Subject: [PATCH 31/78] test 2 fails because of pb with keyboard and gamepad --- modularTasks/tasks/AdrianTests/singlecp.m | 1 + 1 file changed, 1 insertion(+) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index c69aae0..184158d 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -65,6 +65,7 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... 'remoteDrawing', false, ... 'topNode', topNode); topNode.addReadable('dotsReadableHIDKeyboard'); +topNode.addReadable('dotsReadableHIDGamepad');t qfq % -1 means wait for keypress -- see topsTreeNode.pauseBeforeTask pauseBeforeTask = -1; From a4903a9bfe3ca8d8a1deef412ebc2f42af4f897a Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Fri, 25 Oct 2019 16:41:31 -0400 Subject: [PATCH 32/78] gamepad interface + keyboard work --- modularTasks/tasks/AdrianTests/singlecp.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 184158d..58f78ee 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -64,8 +64,8 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... 'displayIndex', 2, ... 'remoteDrawing', false, ... 'topNode', topNode); -topNode.addReadable('dotsReadableHIDKeyboard'); -topNode.addReadable('dotsReadableHIDGamepad');t qfq +%topNode.addReadable('dotsReadableHIDKeyboard'); +topNode.addReadable('dotsReadableHIDGamepad'); % -1 means wait for keypress -- see topsTreeNode.pauseBeforeTask pauseBeforeTask = -1; From 2a49c7d1132b91924a02374a090727bca7191183 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Mon, 28 Oct 2019 10:23:03 -0400 Subject: [PATCH 33/78] new dots drawable settings --- modularTasks/tasks/AdrianTests/singlecp.m | 6 +++--- modularTasks/tasks/topsTreeNodeTaskRTDots.m | 10 +++++----- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 58f78ee..bea7092 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -26,10 +26,10 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... %-------------------------- DOTS STIMULUS PROPERTIES -ddots.Density = 90; +ddots.Density = 150; ddots.Speed = 5; ddots.PixelSize = 6; -ddots.Diameter = 5; +ddots.Diameter = 10; ddots.CoherenceSTD = 10; function newStruct = setDotsParams(dots, someStruct) @@ -119,7 +119,7 @@ function add_training_block(tid, name, condstop) if first_block_of_day questTask = topsTreeNodeTaskRTDots('Quest'); questTask.taskID = 99; - questTask.trialIterations = 5; + questTask.trialIterations = 2; questTask.timing.dotsDuration = 0.4; questTask.timing.showFeedback = 0; questTask.pauseBeforeTask = pauseBeforeTask; diff --git a/modularTasks/tasks/topsTreeNodeTaskRTDots.m b/modularTasks/tasks/topsTreeNodeTaskRTDots.m index ffe0afc..ac59cdd 100644 --- a/modularTasks/tasks/topsTreeNodeTaskRTDots.m +++ b/modularTasks/tasks/topsTreeNodeTaskRTDots.m @@ -86,8 +86,8 @@ 'xCenter', 0, ... 'yCenter', 0, ... 'nSides', 4, ... - 'width', 1.0.*[1.0 0.1], ... - 'height', 1.0.*[0.1 1.0], ... + 'width', 0.5.*[1.0 0.1], ... + 'height', 0.5.*[0.1 1.0], ... 'colors', [1 1 1])), ... ... ... % Targets drawable settings @@ -114,8 +114,8 @@ 'coherenceSTD', 10, ... 'stencilNumber', 1, ... 'pixelSize', 6, ... - 'diameter', 5, ... - 'density', 90, ... + 'diameter', 10, ... + 'density', 150, ... 'speed', 5)))); % Readable settings @@ -526,7 +526,7 @@ function prepareDrawables(self) % Now set the target x,y ensemble.setObjectProperty('xCenter', [fpX - td, fpX + td], 2); - ensemble.setObjectProperty('yCenter', [fpY fpY], 2); + ensemble.setObjectProperty('yCenter', [fpY - td, fpY - td], 2); end % ---- Set a new seed base for the dots random-number process diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 22baa66..489fd0e 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -28,7 +28,7 @@ settings = struct( ... 'useQuest', [], ... 'valsFromQuest', [], ... % % cor vals on pmf to get - 'targetDistance', 5, ... + 'targetDistance', 8, ... 'dotsSeedBase', randi(9999), ... 'reversalSet', [0.3 0.6 0.9], ... % if reversal<-1 'reversalType', 'time'); % 'time' or 'hazard'; see prepareDrawables @@ -100,8 +100,8 @@ 'xCenter', 0, ... 'yCenter', 0, ... 'nSides', 4, ... - 'width', 1.0.*[1.0 0.1], ... - 'height', 1.0.*[0.1 1.0], ... + 'width', 0.5.*[1.0 0.1], ... + 'height', 0.5.*[0.1 1.0], ... 'colors', [1 1 1])), ... ... ... % Targets drawable settings @@ -121,8 +121,8 @@ 'coherenceSTD', 10, ... 'stencilNumber', 1, ... 'pixelSize', 6, ... - 'diameter', 5, ... - 'density', 90, ... + 'diameter', 8, ... + 'density', 150, ... 'speed', 5)))); % Readable settings From 6f0f20171a16a3b35e32561f177e7b07d649667e Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Mon, 28 Oct 2019 14:23:58 -0400 Subject: [PATCH 34/78] task DOES NOT RUN current problem = I struggle to implement the wait screen after direction report. --- modularTasks/tasks/AdrianTests/singlecp.m | 4 +- modularTasks/tasks/topsTreeNodeTaskRTDots.m | 6 +- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 88 +++++++++---------- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index bea7092..a25dfe1 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -29,7 +29,7 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... ddots.Density = 150; ddots.Speed = 5; ddots.PixelSize = 6; -ddots.Diameter = 10; +ddots.Diameter = 8; ddots.CoherenceSTD = 10; function newStruct = setDotsParams(dots, someStruct) @@ -119,7 +119,7 @@ function add_training_block(tid, name, condstop) if first_block_of_day questTask = topsTreeNodeTaskRTDots('Quest'); questTask.taskID = 99; - questTask.trialIterations = 2; + questTask.trialIterations = 1; questTask.timing.dotsDuration = 0.4; questTask.timing.showFeedback = 0; questTask.pauseBeforeTask = pauseBeforeTask; diff --git a/modularTasks/tasks/topsTreeNodeTaskRTDots.m b/modularTasks/tasks/topsTreeNodeTaskRTDots.m index ac59cdd..5efa8e9 100644 --- a/modularTasks/tasks/topsTreeNodeTaskRTDots.m +++ b/modularTasks/tasks/topsTreeNodeTaskRTDots.m @@ -41,7 +41,7 @@ % Timing properties, referenced in statelist timing = struct( ... 'fixationTimeout', 5.0, ... - 'holdFixation', 0.5, ... + 'holdFixation', 0, ... 'minimumRT', 0.05, ... 'showSmileyFace', 0, ... 'showFeedback', 1.0, ... @@ -114,7 +114,7 @@ 'coherenceSTD', 10, ... 'stencilNumber', 1, ... 'pixelSize', 6, ... - 'diameter', 10, ... + 'diameter', 8, ... 'density', 150, ... 'speed', 5)))); @@ -526,7 +526,7 @@ function prepareDrawables(self) % Now set the target x,y ensemble.setObjectProperty('xCenter', [fpX - td, fpX + td], 2); - ensemble.setObjectProperty('yCenter', [fpY - td, fpY - td], 2); + ensemble.setObjectProperty('yCenter', [fpY, fpY], 2); end % ---- Set a new seed base for the dots random-number process diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 489fd0e..dd72d3b 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -36,7 +36,7 @@ % Timing properties, referenced in statelist timing = struct( ... 'fixationTimeout', 5.0, ... - 'holdFixation', 0.5, ... + 'holdFixation', 0, ... 'duration', [0.2 0.5 1.0], ... % min mean max 'finalEpochDuration', [], ... 'minEpochDuration', 0.1, ... @@ -78,14 +78,16 @@ 'fixationStart', ... 'targetOn', ... 'dotsOn', ... - 'finalCPTime', ... + 'finalCPTime', ... % actual CP time 'dotsOff', ... 'choiceTime', ... + 'cpChoiceTime', ... 'blankScreen', ... 'feedbackOn', ... 'subject', ... 'date', ... - 'probCP'}; + 'probCP', ... + 'cpScreenOn'}; % Drawables settings drawable = struct( ... @@ -109,8 +111,8 @@ 'fevalable', @dotsDrawableTargets, ... 'settings', struct( ... 'nSides', 100, ... - 'width', 1.3.*[1 1 1 1], ... - 'height', 1.3.*[1 1 1 1])), ... + 'width', 1.3.*[1 1], ... + 'height', 1.3.*[1 1])), ... ... ... % Dots drawable settings 'dots', struct( ... @@ -152,24 +154,9 @@ ... % Gamepad 'dotsReadableHIDGamepad', struct( ... 'start', {{@defineEventsFromStruct, struct( ... - 'name', {'choseBottomLeft', ... % A button - 'dummyEvent', ... % left trigger - 'holdFixation', ... % right trigger - 'choseBottomRight', ... % B button - 'choseTopLeft', ... % X button - 'choseTopRight'}, ... % Y button - 'component', {'Button1', ... % button ID 3 - 'Trigger1', ...% button ID 7 - 'Trigger2', ...% button ID 8 - 'Button2', ... % button ID 4 - 'Button3', ... % button ID 5 - 'Button4'}, ...% button ID 6 - 'isRelease', {false, ... - false, ... - true, ... - false, ... - false, ... - false})}}), ... + 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... + 'component', {'Button1', 'Trigger1', 'Trigger2'}, ... %i.e. A button, Left Trigger, Right Trigger + 'isRelease', {true, false, false})}}), ... ... ... % Dummy to run in demo mode 'dotsReadableDummy', struct( ... @@ -234,7 +221,6 @@ fpIndex; targetIndex; dotsIndex; - end methods @@ -278,6 +264,7 @@ function startTask(self) self.fpIndex = find(strcmp('fixation', fn)); self.targetIndex = find(strcmp('targets', fn)); self.dotsIndex = find(strcmp('dots', fn)); + self.cpscreenIndex = find(strcmp('cpScreen', fn)); % ---- Initialize the state machine % @@ -409,6 +396,7 @@ function finishTrial(self) % ---- Check for event % eventName = self.helpers.reader.readEvent(events, self, eventTag); + isCPchoice = strcmp(eventName, 'cpResponse') || strcmp(eventName, 'nocpResponse'); % Default return nextState = []; @@ -429,25 +417,29 @@ function finishTrial(self) % ---- Good choice! % - % Override completedTrial flag - self.completedTrial = true; + if isCPchoice + % Override completedTrial flag + self.completedTrial = true; + end % Jump to next state when done nextState = nextStateAfterChoice; % Save the choice - trial.dirChoice = double(strcmp(eventName, 'choseTopRight') || ... - strcmp(eventName, 'choseBottomRight')); - trial.cpChoice = double(strcmp(eventName, 'choseTopRight') || ... - strcmp(eventName, 'choseTopLeft')); - - % Mark as correct/error - trial.dirCorrect = double( ... - (trial.dirChoice==0 && cosd(trial.direction)<0) || ... - (trial.dirChoice==1 && cosd(trial.direction)>0)); - trial.cpCorrect = double( ... - (trial.cpChoice==0 && trial.reversal == 0) || ... - (trial.cpChoice==1 && trial.reversal ~= 0)); + if isCPchoice + trial.cpChoice = double(strcmp(eventName, 'cpResponse')); + trial.cpCorrect = double( ... + (trial.cpChoice==0 && trial.reversal == 0) || ... + (trial.cpChoice==1 && trial.reversal ~= 0)); + else + trial.dirChoice = double(strcmp(eventName, 'choseRight')); + % Mark as correct/error + trial.dirCorrect = double( ... + (trial.dirChoice==0 && cosd(trial.direction)<0) || ... + (trial.dirChoice==1 && cosd(trial.direction)>0)); + end + + % Save RT trial.RT = RT; @@ -500,6 +492,10 @@ function showFeedback(self) self.helpers.message.show(messageGroup, self, 'feedbackOn'); end end + +% function displayCPchoiceScreen(self) +% +% end end methods (Access = protected) @@ -604,8 +600,8 @@ function prepareDrawables(self) fpY = ensemble.getObjectProperty('yCenter', self.fpIndex); % Now set the targets x,y - ensemble.setObjectProperty('xCenter', [fpX + td, fpX - td, fpX - td, fpX + td], self.targetIndex); - ensemble.setObjectProperty('yCenter', [fpY + td, fpY + td, fpY - td, fpY - td], self.targetIndex); + ensemble.setObjectProperty('xCenter', [fpX + td, fpX - td], self.targetIndex); + ensemble.setObjectProperty('yCenter', [fpY, fpY], self.targetIndex); end % ---- Save dots properties @@ -613,7 +609,7 @@ function prepareDrawables(self) ensemble.setObjectProperty('randBase', trial.randSeedBase, self.dotsIndex); ensemble.setObjectProperty('coherence', trial.coherence, self.dotsIndex); ensemble.setObjectProperty('direction', startDirection, self.dotsIndex); - + % ---- Prepare to draw dots stimulus % ensemble.callObjectMethod(@prepareToDrawInWindow); @@ -631,10 +627,11 @@ function initializeStateMachine(self) % blanks = {@dotsTheScreen.blankScreen}; blanks = {@blankScreen, self, 'blankScreen'}; % chkuif = {@getNextEvent, self.helpers.reader.theObject, false, {'holdFixation'}}; - chkuif = {@readEvent, self.helpers.reader, {'holdFixation'}, self, 'fixationStart'}; + chkuif = {@getNextEvent, self.helpers.reader.theObject, false, {'holdFixation'}}; chkuib = {}; % {@getNextEvent, self.readables.theObject, false, {}}; % {'brokeFixation'} - chkuic = {@checkForChoice, self, {'choseTopLeft' 'choseTopRight' 'choseBottomLeft' 'choseBottomRight'}, 'choiceTime', 'blank'}; + chkuic = {@checkForChoice, self, {'choseLeft' 'choseRight'}, 'choiceTime', 'waitForCPchoice'}; + chkuicp = {@checkForChoice, self, {'cpResponse' 'nocpResponse'}, 'cpChoiceTime', 'blank'}; chkrev = {@checkForReversal, self}; showfx = {@draw, self.helpers.stimulusEnsemble, {self.fpIndex, [self.targetIndex self.dotsIndex]}, self, 'fixationOn'}; showt = {@draw, self.helpers.stimulusEnsemble, {self.targetIndex, []}, self, 'targetOn'}; @@ -642,6 +639,8 @@ function initializeStateMachine(self) showd = {@draw,self.helpers.stimulusEnsemble, {self.dotsIndex, []}, self, 'dotsOn'}; hided = {@draw,self.helpers.stimulusEnsemble, {[], [self.fpIndex self.dotsIndex]}, self, 'dotsOff'}; + cpscr = {}; + % Drift correction hfdc = {@reset, self.helpers.reader.theObject, true}; @@ -652,7 +651,7 @@ function initializeStateMachine(self) sea = @setEventsActiveFlag; gwfxw = {sea, self.helpers.reader.theObject, 'holdFixation', 'all'}; gwfxh = {}; - gwts = {sea, self.helpers.reader.theObject, {'choseTopLeft', 'choseBottomLeft', 'choseTopRight', 'choseBottomRight'}, 'holdFixation'}; + gwts = {sea, self.helpers.reader.theObject, {'choseLeft', 'choseRight'}, 'holdFixation'}; % ---- Timing variables, read directly from the timing property struct % @@ -670,6 +669,7 @@ function initializeStateMachine(self) 'preDots' {} {} 0 {} 'showDots' ; ... 'showDots' showd chkrev 0 hided 'waitForChoice' ; ... 'waitForChoice' {} chkuic t.choiceTimeout {} 'blank' ; ... + 'waitForCPchoice' cpscr chkuicp t.choiceTimeout {} 'blank' ; ... 'blank' {} {} 0.2 blanks 'showFeedback' ; ... 'showFeedback' showfb {} t.showFeedback blanks 'done' ; ... 'blankNoFeedback' {} {} 0 blanks 'done' ; ... From dc90d9fdc134eccafa30e78cf81cdf497ef9decb Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Mon, 28 Oct 2019 14:48:02 -0400 Subject: [PATCH 35/78] TASK DOES NOT RUN for last bug, see log file with time stamp approximately 14:47 PM on 28 Oct --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index dd72d3b..c1c7bbe 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -154,9 +154,9 @@ ... % Gamepad 'dotsReadableHIDGamepad', struct( ... 'start', {{@defineEventsFromStruct, struct( ... - 'name', {'holdFixation', 'choseLeft', 'choseRight'}, ... - 'component', {'Button1', 'Trigger1', 'Trigger2'}, ... %i.e. A button, Left Trigger, Right Trigger - 'isRelease', {true, false, false})}}), ... + 'name', {'holdFixation', 'choseLeft', 'choseRight', 'nocpResponse'}, ... + 'component', {'Button1', 'Trigger1', 'Trigger2', 'Button2'}, ... %i.e. A button, Left Trigger, Right Trigger, B button + 'isRelease', {true, false, false, false})}}), ... ... ... % Dummy to run in demo mode 'dotsReadableDummy', struct( ... @@ -264,7 +264,6 @@ function startTask(self) self.fpIndex = find(strcmp('fixation', fn)); self.targetIndex = find(strcmp('targets', fn)); self.dotsIndex = find(strcmp('dots', fn)); - self.cpscreenIndex = find(strcmp('cpScreen', fn)); % ---- Initialize the state machine % @@ -396,7 +395,7 @@ function finishTrial(self) % ---- Check for event % eventName = self.helpers.reader.readEvent(events, self, eventTag); - isCPchoice = strcmp(eventName, 'cpResponse') || strcmp(eventName, 'nocpResponse'); + % Default return nextState = []; @@ -405,6 +404,9 @@ function finishTrial(self) if isempty(eventName) return end + isCPchoice = strcmp(eventName, 'holdFixation') || strcmp(eventName, 'nocpResponse'); + disp('detected Event') + disp(eventName) % Get current task/trial trial = self.getTrial(); @@ -427,6 +429,7 @@ function finishTrial(self) % Save the choice if isCPchoice + disp('HEYYYYY THIS IS CP CHOICE') trial.cpChoice = double(strcmp(eventName, 'cpResponse')); trial.cpCorrect = double( ... (trial.cpChoice==0 && trial.reversal == 0) || ... @@ -493,9 +496,9 @@ function showFeedback(self) end end -% function displayCPchoiceScreen(self) -% -% end + function displayCPchoiceScreen(self) + topsTaskHelperMessage.showTextMessage('HHHHHHAAAAAAAA'); + end end methods (Access = protected) @@ -631,7 +634,7 @@ function initializeStateMachine(self) chkuib = {}; % {@getNextEvent, self.readables.theObject, false, {}}; % {'brokeFixation'} chkuic = {@checkForChoice, self, {'choseLeft' 'choseRight'}, 'choiceTime', 'waitForCPchoice'}; - chkuicp = {@checkForChoice, self, {'cpResponse' 'nocpResponse'}, 'cpChoiceTime', 'blank'}; + chkuicp = {@checkForChoice, self, {'holdFixation' 'nocpResponse'}, 'cpChoiceTime', 'blank'}; chkrev = {@checkForReversal, self}; showfx = {@draw, self.helpers.stimulusEnsemble, {self.fpIndex, [self.targetIndex self.dotsIndex]}, self, 'fixationOn'}; showt = {@draw, self.helpers.stimulusEnsemble, {self.targetIndex, []}, self, 'targetOn'}; @@ -639,7 +642,7 @@ function initializeStateMachine(self) showd = {@draw,self.helpers.stimulusEnsemble, {self.dotsIndex, []}, self, 'dotsOn'}; hided = {@draw,self.helpers.stimulusEnsemble, {[], [self.fpIndex self.dotsIndex]}, self, 'dotsOff'}; - cpscr = {}; + cpscr = {@displayCPchoiceScreen, self}; % Drift correction hfdc = {@reset, self.helpers.reader.theObject, true}; From 894942ee43620dd70a806dcae7519194ae9117d3 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 29 Oct 2019 11:07:08 -0400 Subject: [PATCH 36/78] TASK DOES NOT RUN --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index c1c7bbe..f801cf3 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -176,6 +176,12 @@ 'pauseDuration', 0.5, ... 'bgEnd', [0 0 0]), ... ... + ... CP choice instructions + 'cpInstructions', struct( ... + 'text', {{'PRESS A IF THERE WAS A SWITCH', 'PRESS B IF THERE WAS NOT'}}, ... + 'duration', 2, ... + 'pauseDuration', 0.5, ... + 'bgEnd', [0 0 0]), ... ... Correct 'Correct', struct( ... 'text', {{'Correct', 'y', 6}}, ... @@ -395,8 +401,7 @@ function finishTrial(self) % ---- Check for event % eventName = self.helpers.reader.readEvent(events, self, eventTag); - - + % Default return nextState = []; @@ -442,7 +447,6 @@ function finishTrial(self) (trial.dirChoice==1 && cosd(trial.direction)>0)); end - % Save RT trial.RT = RT; @@ -454,7 +458,6 @@ function finishTrial(self) % Store the reversal times topsDataLog.logDataInGroup(self.reversals, 'ReversingDotsReversals'); - % write metadata (same for all trials) trial.subject = self.subject; trial.date = self.date; @@ -497,7 +500,7 @@ function showFeedback(self) end function displayCPchoiceScreen(self) - topsTaskHelperMessage.showTextMessage('HHHHHHAAAAAAAA'); + self.helpers.message.show('cpInstructions', self, 'cpScreenOn'); end end From 3143992dcd77c85fdc16f0fcb785e44e684c7611 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 29 Oct 2019 11:20:46 -0400 Subject: [PATCH 37/78] Quest task runs, but on 4AFC task cp choice state never entered --- modularTasks/tasks/topsTreeNodeTaskRTDots.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskRTDots.m b/modularTasks/tasks/topsTreeNodeTaskRTDots.m index 5efa8e9..967c40c 100644 --- a/modularTasks/tasks/topsTreeNodeTaskRTDots.m +++ b/modularTasks/tasks/topsTreeNodeTaskRTDots.m @@ -41,7 +41,7 @@ % Timing properties, referenced in statelist timing = struct( ... 'fixationTimeout', 5.0, ... - 'holdFixation', 0, ... + 'holdFixation', 0.1, ... 'minimumRT', 0.05, ... 'showSmileyFace', 0, ... 'showFeedback', 1.0, ... From 5b160800601d06034ed46db38b501ba680d93019 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 29 Oct 2019 11:28:27 -0400 Subject: [PATCH 38/78] FAIL TO RUN TASK What I trying to do here is to have a screen after the choice on dots direction is made, that instructs subject to press A for reporting a CP, and B for reporting no CP. And catch that report. I tried to use the topsTaskHelperMessage class to display that instruction screen with an entry function in the state machine. Since I did not want to clear the screen after displaying the instructions, I added the method shownoclear to the topsTaskHelperMessage class, but this generates a bug (see console log from 29 Oct 11:29 (rouhgly) --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 4 +- .../helpers/topsTaskHelperMessage.m | 90 +++++++++++++++++++ 2 files changed, 92 insertions(+), 2 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index f801cf3..6e8c45b 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -179,7 +179,7 @@ ... CP choice instructions 'cpInstructions', struct( ... 'text', {{'PRESS A IF THERE WAS A SWITCH', 'PRESS B IF THERE WAS NOT'}}, ... - 'duration', 2, ... + 'duration', .2, ... 'pauseDuration', 0.5, ... 'bgEnd', [0 0 0]), ... ... Correct @@ -500,7 +500,7 @@ function showFeedback(self) end function displayCPchoiceScreen(self) - self.helpers.message.show('cpInstructions', self, 'cpScreenOn'); + self.helpers.message.shownoclear('cpInstructions', self, 'cpScreenOn'); end end diff --git a/tower-of-psych/foundation/helpers/topsTaskHelperMessage.m b/tower-of-psych/foundation/helpers/topsTaskHelperMessage.m index e473003..bf1a289 100644 --- a/tower-of-psych/foundation/helpers/topsTaskHelperMessage.m +++ b/tower-of-psych/foundation/helpers/topsTaskHelperMessage.m @@ -331,6 +331,96 @@ function show(self, groupName, task, eventTag) % Always store the specs in the data log topsDataLog.logDataInGroup(groupName, 'showMessage'); end + + + % Set and show messages with text, images, and sounds + % + % Arguments + % groupName ... string + % task ... the topsTreeNode task caller + % eventTag ... string used to store timing information in trial + % struct. Assumes that the current trialData + % struct has an entry called time_. + function shownoclear(self, groupName, task, eventTag) + + % Get the message group + theGroup = self.messageGroups.(groupName); + + % Draw the drawable(s) + if self.showDrawables && ~isempty(theGroup.drawableEnsemble) + + % Set background + if ~isempty(theGroup.bgStart) + dotsTheScreen.blankScreen(theGroup.bgStart); + end + + % Possibly prepare to draw + if ~theGroup.isPrepared + theGroup.drawableEnsemble.setObjectProperty('isVisible', true); + theGroup.drawableEnsemble.callObjectMethod(@prepareToDrawInWindow); + self.messageGroups.(groupName).isPrepared = true; + end + + % Draw + frameInfo = theGroup.drawableEnsemble.callObjectMethod(... + @dotsDrawable.drawFrame, {}, [], false); + end + + % Possibly show/speak the text + for ii = theGroup.textIndices + + % Get the text + text = theGroup.drawableEnsemble.getObjectProperty('string', ii); + + if ~isempty(text) && ~all(isspace(text)) + + % Possibly show the text in the command window if it was not + % shown on the screen + if ~self.showDrawables + disp(text) + end + + % Possibly speak the text + if theGroup.speakText + system(['say ' text]); + end + end + end + + % Play the playable + if ~isempty(theGroup.playable) + theGroup.playable.play(); + end + + % End drawing + if self.showDrawables && ~isempty(theGroup.drawableEnsemble) && ... + isfinite(theGroup.duration) && theGroup.duration > 0 + + % Wait + pause(theGroup.duration); + + % Clear screen and possibly re-set background + dotsTheScreen.blankScreen(theGroup.bgEnd); + + % Conditionally store the synchronized timing data + if nargin >= 5 && ~isempty(task) && ~isempty(eventTag) + self.saveSyncronizedTime(frameInfo.onsetTime, true, task, eventTag) + end + + else + + % Conditionally store the timing data + if nargin >= 5 && ~isempty(task) && ~isempty(eventTag) + task.setTrialData([], eventTag, feval(self.clockFunction)); + end + end + + % Possibly wait again + pause(theGroup.pauseDuration); + + % Always store the specs in the data log + topsDataLog.logDataInGroup(groupName, 'showMessage'); + end end methods (Access = protected) From 1e51817499a99e79d04a1046718bd7dc06cee3ca Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 29 Oct 2019 11:31:57 -0400 Subject: [PATCH 39/78] Revert "FAIL TO RUN TASK" This reverts commit 5b160800601d06034ed46db38b501ba680d93019. --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 4 +- .../helpers/topsTaskHelperMessage.m | 90 ------------------- 2 files changed, 2 insertions(+), 92 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 6e8c45b..f801cf3 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -179,7 +179,7 @@ ... CP choice instructions 'cpInstructions', struct( ... 'text', {{'PRESS A IF THERE WAS A SWITCH', 'PRESS B IF THERE WAS NOT'}}, ... - 'duration', .2, ... + 'duration', 2, ... 'pauseDuration', 0.5, ... 'bgEnd', [0 0 0]), ... ... Correct @@ -500,7 +500,7 @@ function showFeedback(self) end function displayCPchoiceScreen(self) - self.helpers.message.shownoclear('cpInstructions', self, 'cpScreenOn'); + self.helpers.message.show('cpInstructions', self, 'cpScreenOn'); end end diff --git a/tower-of-psych/foundation/helpers/topsTaskHelperMessage.m b/tower-of-psych/foundation/helpers/topsTaskHelperMessage.m index bf1a289..e473003 100644 --- a/tower-of-psych/foundation/helpers/topsTaskHelperMessage.m +++ b/tower-of-psych/foundation/helpers/topsTaskHelperMessage.m @@ -331,96 +331,6 @@ function show(self, groupName, task, eventTag) % Always store the specs in the data log topsDataLog.logDataInGroup(groupName, 'showMessage'); end - - - % Set and show messages with text, images, and sounds - % - % Arguments - % groupName ... string - % task ... the topsTreeNode task caller - % eventTag ... string used to store timing information in trial - % struct. Assumes that the current trialData - % struct has an entry called time_. - function shownoclear(self, groupName, task, eventTag) - - % Get the message group - theGroup = self.messageGroups.(groupName); - - % Draw the drawable(s) - if self.showDrawables && ~isempty(theGroup.drawableEnsemble) - - % Set background - if ~isempty(theGroup.bgStart) - dotsTheScreen.blankScreen(theGroup.bgStart); - end - - % Possibly prepare to draw - if ~theGroup.isPrepared - theGroup.drawableEnsemble.setObjectProperty('isVisible', true); - theGroup.drawableEnsemble.callObjectMethod(@prepareToDrawInWindow); - self.messageGroups.(groupName).isPrepared = true; - end - - % Draw - frameInfo = theGroup.drawableEnsemble.callObjectMethod(... - @dotsDrawable.drawFrame, {}, [], false); - end - - % Possibly show/speak the text - for ii = theGroup.textIndices - - % Get the text - text = theGroup.drawableEnsemble.getObjectProperty('string', ii); - - if ~isempty(text) && ~all(isspace(text)) - - % Possibly show the text in the command window if it was not - % shown on the screen - if ~self.showDrawables - disp(text) - end - - % Possibly speak the text - if theGroup.speakText - system(['say ' text]); - end - end - end - - % Play the playable - if ~isempty(theGroup.playable) - theGroup.playable.play(); - end - - % End drawing - if self.showDrawables && ~isempty(theGroup.drawableEnsemble) && ... - isfinite(theGroup.duration) && theGroup.duration > 0 - - % Wait - pause(theGroup.duration); - - % Clear screen and possibly re-set background - dotsTheScreen.blankScreen(theGroup.bgEnd); - - % Conditionally store the synchronized timing data - if nargin >= 5 && ~isempty(task) && ~isempty(eventTag) - self.saveSyncronizedTime(frameInfo.onsetTime, true, task, eventTag) - end - - else - - % Conditionally store the timing data - if nargin >= 5 && ~isempty(task) && ~isempty(eventTag) - task.setTrialData([], eventTag, feval(self.clockFunction)); - end - end - - % Possibly wait again - pause(theGroup.pauseDuration); - - % Always store the specs in the data log - topsDataLog.logDataInGroup(groupName, 'showMessage'); - end end methods (Access = protected) From 024c17620dc60cf7e3c9587804fff40267374ced Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 29 Oct 2019 11:35:42 -0400 Subject: [PATCH 40/78] cp choice never recorded --- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index f801cf3..2ccaf99 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -500,7 +500,7 @@ function showFeedback(self) end function displayCPchoiceScreen(self) - self.helpers.message.show('cpInstructions', self, 'cpScreenOn'); + % do nothing on purpose end end From 5790389d846d36d04dc4c14d9dfeb9d7aa982179 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 29 Oct 2019 11:53:55 -0400 Subject: [PATCH 41/78] holdFixation and nocpResponse events are NOT READ --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 2ccaf99..3951367 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -397,6 +397,9 @@ function finishTrial(self) % % Save choice/RT information and set up feedback for the dots task function nextState = checkForChoice(self, events, eventTag, nextStateAfterChoice) + disp('JUST ENTERED CHECK FOR CHOICE') + disp('events are') + disp(events) % ---- Check for event % @@ -416,17 +419,18 @@ function finishTrial(self) % Get current task/trial trial = self.getTrial(); - % Check for minimum RT, wrt dotsOn for RT, dotsOff for non-RT - RT = trial.choiceTime - trial.dotsOff; - if RT < self.timing.minimumRT - return - end - % ---- Good choice! % if isCPchoice % Override completedTrial flag self.completedTrial = true; + else + % Check for minimum RT, wrt dotsOn for RT, dotsOff for non-RT + RT = trial.choiceTime - trial.dotsOff; + if RT < self.timing.minimumRT + disp('NEG RT FOUND') + return + end end % Jump to next state when done @@ -675,7 +679,7 @@ function initializeStateMachine(self) 'preDots' {} {} 0 {} 'showDots' ; ... 'showDots' showd chkrev 0 hided 'waitForChoice' ; ... 'waitForChoice' {} chkuic t.choiceTimeout {} 'blank' ; ... - 'waitForCPchoice' cpscr chkuicp t.choiceTimeout {} 'blank' ; ... + 'waitForCPchoice' {} chkuicp t.choiceTimeout {} 'blank' ; ... 'blank' {} {} 0.2 blanks 'showFeedback' ; ... 'showFeedback' showfb {} t.showFeedback blanks 'done' ; ... 'blankNoFeedback' {} {} 0 blanks 'done' ; ... From 9f90036a41db74370f756c86164ad50e29520253 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 29 Oct 2019 12:05:32 -0400 Subject: [PATCH 42/78] getting better. Last bug look at 10_29_12_04 roughly --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 3951367..d69284b 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -658,10 +658,22 @@ function initializeStateMachine(self) % tdhf = {@setTrialDataValue, self, 'holdFixation', value, trialIndex}; % Activate/deactivate readable events + % See dotsReadable.setEventsActiveFlag for function signature sea = @setEventsActiveFlag; - gwfxw = {sea, self.helpers.reader.theObject, 'holdFixation', 'all'}; + + % this activates holdFixation and deactivates everything else + gwfxw = {sea, self.helpers.reader.theObject, 'holdFixation', 'all'}; + + % nothing gwfxh = {}; - gwts = {sea, self.helpers.reader.theObject, {'choseLeft', 'choseRight'}, 'holdFixation'}; + + % this activates choseLeft and choseRight but deactivates + % everything else + gwts = {sea, self.helpers.reader.theObject, {'choseLeft', 'choseRight'}, 'all'}; + + % this activates holdFixation (to report CP) and nocpResponse but deactivates + % everything else + gwcp = {sea, self.helpers.reader.theObject, {'holdFixation', 'nocpResponse'}, 'all'}; % ---- Timing variables, read directly from the timing property struct % @@ -675,11 +687,11 @@ function initializeStateMachine(self) 'showFixation' showfx {} 0 {} 'waitForFixation' ; ... 'waitForFixation' gwfxw chkuif t.fixationTimeout {} 'blankNoFeedback' ; ... 'holdFixation' gwfxh chkuib t.holdFixation hfdc 'showTargets' ; ... - 'showTargets' showt chkuib t.preDots gwts 'preDots' ; ... + 'showTargets' showt chkuib t.preDots {} 'preDots' ; ... 'preDots' {} {} 0 {} 'showDots' ; ... 'showDots' showd chkrev 0 hided 'waitForChoice' ; ... - 'waitForChoice' {} chkuic t.choiceTimeout {} 'blank' ; ... - 'waitForCPchoice' {} chkuicp t.choiceTimeout {} 'blank' ; ... + 'waitForChoice' gwts chkuic t.choiceTimeout cpscr 'blank' ; ... + 'waitForCPchoice' gwcp chkuicp t.choiceTimeout {} 'blank' ; ... 'blank' {} {} 0.2 blanks 'showFeedback' ; ... 'showFeedback' showfb {} t.showFeedback blanks 'done' ; ... 'blankNoFeedback' {} {} 0 blanks 'done' ; ... From 72c6ab4e659c7218990df750817cb14e7c1d81b4 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 29 Oct 2019 12:24:37 -0400 Subject: [PATCH 43/78] TASK RUNS -- CP instructions missing --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index d69284b..4bf71f1 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -67,6 +67,7 @@ % dataFieldNames are used to set up the trialData structure trialDataFields = { ... 'RT', ... + 'cpRT', ... 'dirChoice', ... 'cpChoice', ... 'dirCorrect', ... @@ -397,10 +398,10 @@ function finishTrial(self) % % Save choice/RT information and set up feedback for the dots task function nextState = checkForChoice(self, events, eventTag, nextStateAfterChoice) - disp('JUST ENTERED CHECK FOR CHOICE') - disp('events are') - disp(events) - +% disp('JUST ENTERED CHECK FOR CHOICE') +% disp('events are') +% disp(events) +% % ---- Check for event % eventName = self.helpers.reader.readEvent(events, self, eventTag); @@ -424,11 +425,18 @@ function finishTrial(self) if isCPchoice % Override completedTrial flag self.completedTrial = true; + trial.cpRT = trial.cpChoiceTime - trial.choiceTime; else % Check for minimum RT, wrt dotsOn for RT, dotsOff for non-RT RT = trial.choiceTime - trial.dotsOff; + % Save RT + trial.RT = RT; if RT < self.timing.minimumRT - disp('NEG RT FOUND') + % write metadata (same for all trials) + trial.subject = self.subject; + trial.date = self.date; + trial.probCP = self.probCP; + self.setTrial(trial); return end end @@ -439,8 +447,8 @@ function finishTrial(self) % Save the choice if isCPchoice disp('HEYYYYY THIS IS CP CHOICE') - trial.cpChoice = double(strcmp(eventName, 'cpResponse')); - trial.cpCorrect = double( ... + trial.cpChoice = double(strcmp(eventName, 'holdFixation')); + trial.cpCorrect = double(... (trial.cpChoice==0 && trial.reversal == 0) || ... (trial.cpChoice==1 && trial.reversal ~= 0)); else @@ -450,10 +458,7 @@ function finishTrial(self) (trial.dirChoice==0 && cosd(trial.direction)<0) || ... (trial.dirChoice==1 && cosd(trial.direction)>0)); end - - % Save RT - trial.RT = RT; - + % Save the final reversal time if ~isempty(self.reversals) trial.finalCPTime = self.reversals.actualTimes(end); From aeb012f3b18f457acd813feab401dd9075d2a4d1 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 29 Oct 2019 12:45:24 -0400 Subject: [PATCH 44/78] text for CP instructions does not show up 2019_10_29_12_43 --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 180 +++++++++++------- 1 file changed, 114 insertions(+), 66 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 4bf71f1..6a83b89 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -88,7 +88,8 @@ 'subject', ... 'date', ... 'probCP', ... - 'cpScreenOn'}; + 'cpScreenOn', ... + 'dummyBlank'}; % Drawables settings drawable = struct( ... @@ -126,7 +127,13 @@ 'pixelSize', 6, ... 'diameter', 8, ... 'density', 150, ... - 'speed', 5)))); + 'speed', 5)), ... + ... % CP Targets drawable settings + 'cpScreen', struct( ... + 'fevalable', @dotsDrawableText, ... + 'settings', struct( ... + 'x', 0, ... + 'y', 0)))); % Readable settings readable = struct( ... @@ -136,15 +143,6 @@ ... 'copySpecs', struct( ... ... - ... % The gaze windows - 'dotsReadableEye', struct( ... - 'bindingNames', 'stimulusEnsemble', ... - 'prepare', {{@updateGazeWindows}}, ... - 'start', {{@defineEventsFromStruct, struct( ... - 'name', {'holdFixation', 'breakFixation', 'choseLeft', 'choseRight'}, ... - 'ensemble', {'stimulusEnsemble', 'stimulusEnsemble', 'stimulusEnsemble', 'stimulusEnsemble'}, ... % ensemble object to bind to - 'ensembleIndices', {[1 1], [1 1], [2 1], [2 2]})}}), ... - ... ... % The keyboard events .. 'uiType' is used to conditionally use these depending on the theObject type 'dotsReadableHIDKeyboard', struct( ... 'start', {{@defineEventsFromStruct, struct( ... @@ -177,12 +175,6 @@ 'pauseDuration', 0.5, ... 'bgEnd', [0 0 0]), ... ... - ... CP choice instructions - 'cpInstructions', struct( ... - 'text', {{'PRESS A IF THERE WAS A SWITCH', 'PRESS B IF THERE WAS NOT'}}, ... - 'duration', 2, ... - 'pauseDuration', 0.5, ... - 'bgEnd', [0 0 0]), ... ... Correct 'Correct', struct( ... 'text', {{'Correct', 'y', 6}}, ... @@ -219,7 +211,8 @@ targetDistance; % Reversal directions/times -- precomputed for each trial and then executed. - reversals = struct('directions', [], 'plannedTimes', [], 'actualTimes', []); + reversals = struct('directions', [], 'plannedTimes', [], ... + 'actualTimes', []); % Keep track of reversals nextReversal; @@ -228,6 +221,7 @@ fpIndex; targetIndex; dotsIndex; + cpScreenIndex; end methods @@ -249,9 +243,12 @@ function startTask(self) if ~isempty(self.questThreshold) if ~isnumeric(self.questThreshold) - self.questThreshold = self.questThreshold.getQuestThreshold(); - if self.questThreshold <= 0 || self.questThreshold >= 100 - error(['Invalid questThreshold of ',num2str(self.questThreshold)]) + self.questThreshold = ... + self.questThreshold.getQuestThreshold(); + if self.questThreshold <= 0 || ... + self.questThreshold >= 100 + error(['Invalid questThreshold of ', ... + num2str(self.questThreshold)]) end end end @@ -271,6 +268,7 @@ function startTask(self) self.fpIndex = find(strcmp('fixation', fn)); self.targetIndex = find(strcmp('targets', fn)); self.dotsIndex = find(strcmp('dots', fn)); + self.cpScreenIndex = find(strcmp('cpScreen', fn)); % ---- Initialize the state machine % @@ -306,8 +304,10 @@ function startTrial(self) % Task information taskString = sprintf('%s (task %d/%d): %d dirCorrect, %d cpCorrect, %d dirError, %d cpError, mean RT=%.2f', ... self.name, self.taskID, length(self.caller.children), ... - sum([self.trialData.dirCorrect]==1), sum([self.trialData.cpCorrect]==1), ... - sum([self.trialData.dirCorrect]==0), sum([self.trialData.cpCorrect]==0), ... + sum([self.trialData.dirCorrect]==1), ... + sum([self.trialData.cpCorrect]==1), ... + sum([self.trialData.dirCorrect]==0), ... + sum([self.trialData.cpCorrect]==0), ... nanmean([self.trialData.RT])); % Trial information @@ -337,7 +337,8 @@ function finishTrial(self) if ~isnan(ccorr) && ~isnan(dcorr) if dcorr && ccorr self.consecutiveCorrect = self.consecutiveCorrect + 1; - if isnumeric(self.stopCondition) && self.consecutiveCorrect == self.stopCondition + if isnumeric(self.stopCondition) && ... + self.consecutiveCorrect == self.stopCondition self.abort() end else @@ -370,15 +371,18 @@ function finishTrial(self) % % Set the direction eh = self.helpers.stimulusEnsemble; - eh.theObject.setObjectProperty('direction', self.reversals.directions(self.nextReversal), ... + eh.theObject.setObjectProperty('direction', ... + self.reversals.directions(self.nextReversal), ... self.dotsIndex); % Explicitly flip here so we can get the timestamp - frameInfo = eh.theObject.callObjectMethod(@dotsDrawable.drawFrame, {}, [], true); + frameInfo = eh.theObject.callObjectMethod(... + @dotsDrawable.drawFrame, {}, [], true); % Save the time in SCREEN time self.reversals.actualTimes(self.nextReversal) = ... - eh.getSynchronizedTime(frameInfo.onsetTime, true) - trial.dotsOn; + eh.getSynchronizedTime(frameInfo.onsetTime, true) - ... + trial.dotsOn; % For debugging fprintf('FLIPPED to %d at time: %.2f planned, %.2f actual\n', ... @@ -397,14 +401,16 @@ function finishTrial(self) %% Check for choice % % Save choice/RT information and set up feedback for the dots task - function nextState = checkForChoice(self, events, eventTag, nextStateAfterChoice) + function nextState = checkForChoice(self, events, eventTag, ... + nextStateAfterChoice) % disp('JUST ENTERED CHECK FOR CHOICE') % disp('events are') % disp(events) % % ---- Check for event % - eventName = self.helpers.reader.readEvent(events, self, eventTag); + eventName = self.helpers.reader.readEvent(events, self, ... + eventTag); % Default return nextState = []; @@ -413,10 +419,11 @@ function finishTrial(self) if isempty(eventName) return end - isCPchoice = strcmp(eventName, 'holdFixation') || strcmp(eventName, 'nocpResponse'); - disp('detected Event') - disp(eventName) - + isCPchoice = strcmp(eventName, 'holdFixation') || ... + strcmp(eventName, 'nocpResponse'); +% disp('detected Event') +% disp(eventName) +% % Get current task/trial trial = self.getTrial(); @@ -446,7 +453,6 @@ function finishTrial(self) % Save the choice if isCPchoice - disp('HEYYYYY THIS IS CP CHOICE') trial.cpChoice = double(strcmp(eventName, 'holdFixation')); trial.cpCorrect = double(... (trial.cpChoice==0 && trial.reversal == 0) || ... @@ -465,7 +471,8 @@ function finishTrial(self) end % Store the reversal times - topsDataLog.logDataInGroup(self.reversals, 'ReversingDotsReversals'); + topsDataLog.logDataInGroup(self.reversals, ... + 'ReversingDotsReversals'); % write metadata (same for all trials) trial.subject = self.subject; @@ -504,13 +511,14 @@ function showFeedback(self) % ---- Show trial feedback on the screen % if self.timing.showFeedback > 0 - self.helpers.message.show(messageGroup, self, 'feedbackOn'); + self.helpers.message.show(messageGroup, self, ... + 'feedbackOn'); end end - function displayCPchoiceScreen(self) - % do nothing on purpose - end +% function displayCPchoiceScreen(self) +% % do nothing on purpose +% end end methods (Access = protected) @@ -577,7 +585,8 @@ function prepareDrawables(self) end % Strip unnecessary values - plannedTimes = plannedTimes(plannedTimes PRESS A', ... + 'WAS THERE A SWITCH IN DIRECTION? --> PRESS B'}, ... + self.cpScreenIndex); + + % ---- Prepare to draw dots stimulus % ensemble.callObjectMethod(@prepareToDrawInWindow); @@ -645,16 +674,34 @@ function initializeStateMachine(self) chkuif = {@getNextEvent, self.helpers.reader.theObject, false, {'holdFixation'}}; chkuib = {}; % {@getNextEvent, self.readables.theObject, false, {}}; % {'brokeFixation'} - chkuic = {@checkForChoice, self, {'choseLeft' 'choseRight'}, 'choiceTime', 'waitForCPchoice'}; - chkuicp = {@checkForChoice, self, {'holdFixation' 'nocpResponse'}, 'cpChoiceTime', 'blank'}; + chkuic = {@checkForChoice, self, {'choseLeft' 'choseRight'}, ... + 'choiceTime', 'waitForCPchoice'}; + chkuicp = {@checkForChoice, self, ... + {'holdFixation' 'nocpResponse'}, 'cpChoiceTime', 'blank'}; chkrev = {@checkForReversal, self}; - showfx = {@draw, self.helpers.stimulusEnsemble, {self.fpIndex, [self.targetIndex self.dotsIndex]}, self, 'fixationOn'}; - showt = {@draw, self.helpers.stimulusEnsemble, {self.targetIndex, []}, self, 'targetOn'}; + showfx = {@draw, self.helpers.stimulusEnsemble, ... + {self.fpIndex, [self.targetIndex self.dotsIndex]}, ... + self, 'fixationOn'}; + showt = {@draw, self.helpers.stimulusEnsemble, ... + {self.targetIndex, []}, self, 'targetOn'}; showfb = {@showFeedback, self}; - showd = {@draw,self.helpers.stimulusEnsemble, {self.dotsIndex, []}, self, 'dotsOn'}; - hided = {@draw,self.helpers.stimulusEnsemble, {[], [self.fpIndex self.dotsIndex]}, self, 'dotsOff'}; - - cpscr = {@displayCPchoiceScreen, self}; + showd = {@draw,self.helpers.stimulusEnsemble, ... + {self.dotsIndex, []}, self, 'dotsOn'}; + hided = {@draw,self.helpers.stimulusEnsemble, {[], ... + [self.fpIndex self.dotsIndex]}, self, 'dotsOff'}; + + cpscr = {@draw,self.helpers.stimulusEnsemble, ... + {[self.cpScreenIndex], ... + [self.fpIndex self.dotsIndex self.targetIndex]}, self, ... + 'cpScreenOn'}; + + blank = {@draw,self.helpers.stimulusEnsemble, ... + {[], [... + self.fpIndex ... + self.dotsIndex ... + self.targetIndex ... + self.cpScreenIndex]}, self, ... + 'dummyBlank'}; % Drift correction hfdc = {@reset, self.helpers.reader.theObject, true}; @@ -667,18 +714,21 @@ function initializeStateMachine(self) sea = @setEventsActiveFlag; % this activates holdFixation and deactivates everything else - gwfxw = {sea, self.helpers.reader.theObject, 'holdFixation', 'all'}; + gwfxw = {sea, self.helpers.reader.theObject, ... + 'holdFixation', 'all'}; % nothing gwfxh = {}; % this activates choseLeft and choseRight but deactivates % everything else - gwts = {sea, self.helpers.reader.theObject, {'choseLeft', 'choseRight'}, 'all'}; + gwts = {sea, self.helpers.reader.theObject, ... + {'choseLeft', 'choseRight'}, 'all'}; % this activates holdFixation (to report CP) and nocpResponse but deactivates % everything else - gwcp = {sea, self.helpers.reader.theObject, {'holdFixation', 'nocpResponse'}, 'all'}; + gwcp = {sea, self.helpers.reader.theObject, ... + {'holdFixation', 'nocpResponse'}, 'all'}; % ---- Timing variables, read directly from the timing property struct % @@ -696,7 +746,7 @@ function initializeStateMachine(self) 'preDots' {} {} 0 {} 'showDots' ; ... 'showDots' showd chkrev 0 hided 'waitForChoice' ; ... 'waitForChoice' gwts chkuic t.choiceTimeout cpscr 'blank' ; ... - 'waitForCPchoice' gwcp chkuicp t.choiceTimeout {} 'blank' ; ... + 'waitForCPchoice' gwcp chkuicp t.choiceTimeout blank 'blank' ; ... 'blank' {} {} 0.2 blanks 'showFeedback' ; ... 'showFeedback' showfb {} t.showFeedback blanks 'done' ; ... 'blankNoFeedback' {} {} 0 blanks 'done' ; ... @@ -708,8 +758,6 @@ function initializeStateMachine(self) self.addStateMachineWithDrawing(states, ... 'stimulusEnsemble', {'preDots' 'showDots'}); - % Turn on state debug flag - % self.debugStates(); end end From 536f5aef8fd90017a65944d5b4c8c1d5cc719a0d Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 29 Oct 2019 12:58:59 -0400 Subject: [PATCH 45/78] cp screen instructions still invisible --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 6a83b89..df8054b 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -670,23 +670,32 @@ function initializeStateMachine(self) % % blanks = {@dotsTheScreen.blankScreen}; blanks = {@blankScreen, self, 'blankScreen'}; + % chkuif = {@getNextEvent, self.helpers.reader.theObject, false, {'holdFixation'}}; chkuif = {@getNextEvent, self.helpers.reader.theObject, false, {'holdFixation'}}; chkuib = {}; % {@getNextEvent, self.readables.theObject, false, {}}; % {'brokeFixation'} + chkuic = {@checkForChoice, self, {'choseLeft' 'choseRight'}, ... 'choiceTime', 'waitForCPchoice'}; + chkuicp = {@checkForChoice, self, ... {'holdFixation' 'nocpResponse'}, 'cpChoiceTime', 'blank'}; + chkrev = {@checkForReversal, self}; + showfx = {@draw, self.helpers.stimulusEnsemble, ... {self.fpIndex, [self.targetIndex self.dotsIndex]}, ... self, 'fixationOn'}; + showt = {@draw, self.helpers.stimulusEnsemble, ... {self.targetIndex, []}, self, 'targetOn'}; + showfb = {@showFeedback, self}; + showd = {@draw,self.helpers.stimulusEnsemble, ... {self.dotsIndex, []}, self, 'dotsOn'}; + hided = {@draw,self.helpers.stimulusEnsemble, {[], ... [self.fpIndex self.dotsIndex]}, self, 'dotsOff'}; @@ -695,6 +704,10 @@ function initializeStateMachine(self) [self.fpIndex self.dotsIndex self.targetIndex]}, self, ... 'cpScreenOn'}; + cpopts = {@draw, self.helpers.stimulusEnsemble, {{'colors', ... + [1 1 1], 1}, {'isVisible', true, [4]}, ... + {'isVisible', false, [1 2 3]}}, self, 'cpScreenOn'}; + blank = {@draw,self.helpers.stimulusEnsemble, ... {[], [... self.fpIndex ... @@ -745,7 +758,7 @@ function initializeStateMachine(self) 'showTargets' showt chkuib t.preDots {} 'preDots' ; ... 'preDots' {} {} 0 {} 'showDots' ; ... 'showDots' showd chkrev 0 hided 'waitForChoice' ; ... - 'waitForChoice' gwts chkuic t.choiceTimeout cpscr 'blank' ; ... + 'waitForChoice' gwts chkuic t.choiceTimeout cpopts 'blank' ; ... 'waitForCPchoice' gwcp chkuicp t.choiceTimeout blank 'blank' ; ... 'blank' {} {} 0.2 blanks 'showFeedback' ; ... 'showFeedback' showfb {} t.showFeedback blanks 'done' ; ... From 769964c4f8199d940eeaf3d2f62b93f30f1fe844 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 29 Oct 2019 13:05:40 -0400 Subject: [PATCH 46/78] TASK RUNS -- 2019_10_29_13_04 --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index df8054b..e69f804 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -648,9 +648,9 @@ function prepareDrawables(self) % ---- Set CP screen instructions % +% ensemble.setObjectProperty('string', 'switch', 5); ensemble.setObjectProperty('string', ... - {'WAS THERE A SWITCH IN DIRECTION? --> PRESS A', ... - 'WAS THERE A SWITCH IN DIRECTION? --> PRESS B'}, ... + 'WAS THERE A SWITCH? (YES=A / NO=B)', ... self.cpScreenIndex); @@ -685,7 +685,8 @@ function initializeStateMachine(self) chkrev = {@checkForReversal, self}; showfx = {@draw, self.helpers.stimulusEnsemble, ... - {self.fpIndex, [self.targetIndex self.dotsIndex]}, ... + {self.fpIndex, ... + [self.targetIndex self.dotsIndex self.cpScreenIndex]}, ... self, 'fixationOn'}; showt = {@draw, self.helpers.stimulusEnsemble, ... @@ -704,9 +705,9 @@ function initializeStateMachine(self) [self.fpIndex self.dotsIndex self.targetIndex]}, self, ... 'cpScreenOn'}; - cpopts = {@draw, self.helpers.stimulusEnsemble, {{'colors', ... - [1 1 1], 1}, {'isVisible', true, [4]}, ... - {'isVisible', false, [1 2 3]}}, self, 'cpScreenOn'}; +% cpopts = {@draw, self.helpers.stimulusEnsemble, {{'colors', ... +% [1 1 1], 1}, {'isVisible', true, [4]}, ... +% {'isVisible', false, [1 2 3]}}, self, 'cpScreenOn'}; blank = {@draw,self.helpers.stimulusEnsemble, ... {[], [... @@ -758,7 +759,7 @@ function initializeStateMachine(self) 'showTargets' showt chkuib t.preDots {} 'preDots' ; ... 'preDots' {} {} 0 {} 'showDots' ; ... 'showDots' showd chkrev 0 hided 'waitForChoice' ; ... - 'waitForChoice' gwts chkuic t.choiceTimeout cpopts 'blank' ; ... + 'waitForChoice' gwts chkuic t.choiceTimeout cpscr 'blank' ; ... 'waitForCPchoice' gwcp chkuicp t.choiceTimeout blank 'blank' ; ... 'blank' {} {} 0.2 blanks 'showFeedback' ; ... 'showFeedback' showfb {} t.showFeedback blanks 'done' ; ... From 2bfed4bc9df484cef27c277d525b1da5c03c1d88 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 5 Nov 2019 10:25:21 -0500 Subject: [PATCH 47/78] simplify singlecp --- modularTasks/tasks/AdrianTests/singlecp.m | 28 +++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index a25dfe1..568f9fe 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -1,11 +1,8 @@ -function singlecp(subject_code, experiment_day, first_block_of_day, ... - probCP, dump_folder, quest_task_topsDataLog) +function singlecp(subject_code, probCP) % function to launch single CP Reversing Dots task % % ARGS: % subject_code -- string that identifies subject uniquely, e.g. 'S4' -% experiment_day -- integer counting the days of experimentation with -% this subject % first_block_of_day -- true or false % probCP -- numeric value % dump_folder -- e.g '/Users/joshuagold/Documents/MATLAB/projects/Lab_M @@ -15,14 +12,15 @@ function singlecp(subject_code, experiment_day, first_block_of_day, ... % required) %-------------------------- DEFAULT ARGS -if nargin < 1 - subject_code = 'S1'; - experiment_day = 1; - first_block_of_day = true; - probCP = 0.3; - dump_folder = '/Users/joshuagold/Documents/MATLAB/projects/Lab_Matlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/trials_post_expt/'; - quest_task_topsDataLog = '';%'/Users/joshuagold/Users/Adrian/oneCP/raw/2019_10_08_17_17/2019_10_08_17_17_topsDataLog.mat'; % made up -end +dump_folder = '/Users/joshuagold/Documents/MATLAB/projects/Lab_Matlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/trials_post_expt/'; +first_block_of_day = true; % if true, Quest block is added + + +% the following variable should hold the full path to a topsDataLog.mat +% file where a valid Quest block was run. This is when one wants to skip +% the Quest block presently, and thus use the threshold estimated from a +% prior Quest block. +quest_task_topsDataLog = '';%'/Users/joshuagold/Users/Adrian/oneCP/raw/2019_10_08_17_17/2019_10_08_17_17_topsDataLog.mat'; % made up %-------------------------- DOTS STIMULUS PROPERTIES @@ -75,7 +73,8 @@ function add_block(topnode, taskID, task_name, trials_file, ... t = topsTreeNodeTaskReversingDots4AFC(task_name); t.taskID = taskID; t.independentVariables=trials_file; - t.trialIterationMethod='sequential'; +% t.trialIterationMethod='sequential'; + t.randomizeWhenRepeating = false; t.pauseBeforeTask = pauseBeforeTask; t.stopCondition = stop_cond; @@ -119,7 +118,7 @@ function add_training_block(tid, name, condstop) if first_block_of_day questTask = topsTreeNodeTaskRTDots('Quest'); questTask.taskID = 99; - questTask.trialIterations = 1; + questTask.trialIterations = 10; questTask.timing.dotsDuration = 0.4; questTask.timing.showFeedback = 0; questTask.pauseBeforeTask = pauseBeforeTask; @@ -132,7 +131,6 @@ function add_training_block(tid, name, condstop) topNode.addChild(questTask); else - % extract timestamp from full path ts = regexprep(quest_task_topsDataLog, ... '[^[0-9]{4}_[0-9]{2}_[0-9]{2}_[0-9]{2}_[0-9]{2}]', ''); From a5c9e87197706599f506f07c499ec033d834406a Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 5 Nov 2019 11:22:58 -0500 Subject: [PATCH 48/78] add true task blocks first iteration of conditional training block exit --- modularTasks/tasks/AdrianTests/singlecp.m | 6 +- .../AdrianTests/trials_pre_expt/Block0.csv | 821 ++++++++++++++++++ .../trials_pre_expt/Block0_metadata.json | 55 ++ .../AdrianTests/trials_pre_expt/Block1.csv | 821 ++++++++++++++++++ .../trials_pre_expt/Block1_metadata.json | 55 ++ 5 files changed, 1755 insertions(+), 3 deletions(-) create mode 100644 modularTasks/tasks/AdrianTests/trials_pre_expt/Block0.csv create mode 100755 modularTasks/tasks/AdrianTests/trials_pre_expt/Block0_metadata.json create mode 100644 modularTasks/tasks/AdrianTests/trials_pre_expt/Block1.csv create mode 100755 modularTasks/tasks/AdrianTests/trials_pre_expt/Block1_metadata.json diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 568f9fe..6b050a5 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -101,10 +101,10 @@ function add_training_block(tid, name, condstop) %-------------------------- ADD TRAINING BLOCKS TO TOPNODE -num_training_blocks=0; +num_training_blocks=8; stop_conditions = {... - 1, 1, 2, 2, 1, 'button', 'button', 'button' ... + 7, 7, 7, 15, 25, 'button', 'button', 'button' ... }; for jj = 1:num_training_blocks @@ -225,4 +225,4 @@ function dumpFIRA(topnode, child) %-------------------------- TURN OFF DIARY disp(['file with timestamp ', timestamp, ' produced']) diary off -end \ No newline at end of file +end diff --git a/modularTasks/tasks/AdrianTests/trials_pre_expt/Block0.csv b/modularTasks/tasks/AdrianTests/trials_pre_expt/Block0.csv new file mode 100644 index 0000000..aaf119e --- /dev/null +++ b/modularTasks/tasks/AdrianTests/trials_pre_expt/Block0.csv @@ -0,0 +1,821 @@ +direction,coherence,reversal,duration,finalDuration +180,-1,0.0,0.4,NaN +0,0,0.2,0.25,NaN +0,0,0.0,0.2,NaN +180,0,0.0,0.4,NaN +0,0,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +0,0,0.0,0.2,NaN +0,-1,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +0,-1,0.0,0.4,NaN +180,0,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,0,0.2,0.3,NaN +0,-1,0.2,0.25,NaN +180,0,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +180,-1,0.2,0.6,NaN +0,0,0.0,0.1,NaN +0,-1,0.2,0.4,NaN +0,0,0.0,0.2,NaN +180,0,0.0,0.2,NaN +180,0,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +0,0,0.2,0.25,NaN +0,-1,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,0,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +180,0,0.0,0.1,NaN +0,-1,0.0,0.2,NaN +180,-1,0.2,0.6,NaN +180,0,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +180,0,0.0,0.3,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +0,0,0.2,0.25,NaN +180,0,0.2,0.3,NaN +180,0,0.2,0.3,NaN +0,0,0.2,0.4,NaN +0,0,0.2,0.6,NaN +0,-1,0.2,0.6,NaN +180,-1,0.2,0.3,NaN +0,0,0.2,0.6,NaN +180,-1,0.2,0.4,NaN +0,-1,0.0,0.1,NaN +180,100,0.2,0.3,NaN +0,0,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +180,0,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.25,NaN +0,0,0.0,0.3,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.6,NaN +0,-1,0.2,0.6,NaN +180,-1,0.0,0.2,NaN +0,0,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +180,0,0.2,0.4,NaN +0,0,0.0,0.4,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.2,NaN +180,0,0.2,0.6,NaN +0,0,0.2,0.6,NaN +0,-1,0.0,0.3,NaN +180,-1,0.2,0.25,NaN +0,0,0.0,0.25,NaN +180,0,0.2,0.25,NaN +0,0,0.2,0.25,NaN +180,0,0.2,0.25,NaN +180,0,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,-1,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +180,-1,0.0,0.2,NaN +0,0,0.0,0.2,NaN +180,-1,0.2,0.3,NaN +180,0,0.2,0.3,NaN +180,0,0.2,0.3,NaN +0,0,0.2,0.25,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +0,-1,0.0,0.1,NaN +0,-1,0.0,0.2,NaN +180,0,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +180,-1,0.2,0.6,NaN +180,0,0.2,0.25,NaN +0,0,0.0,0.1,NaN +0,0,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +0,0,0.0,0.1,NaN +180,0,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.1,NaN +0,-1,0.0,0.1,NaN +180,100,0.2,0.25,NaN +0,0,0.2,0.25,NaN +180,-1,0.2,0.6,NaN +0,-1,0.2,0.3,NaN +0,0,0.2,0.25,NaN +0,0,0.2,0.4,NaN +0,-1,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +180,0,0.0,0.1,NaN +180,0,0.0,0.1,NaN +0,0,0.2,0.3,NaN +180,0,0.2,0.4,NaN +0,-1,0.0,0.1,NaN +0,-1,0.2,0.25,NaN +0,0,0.2,0.3,NaN +0,0,0.2,0.25,NaN +180,0,0.0,0.3,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.4,NaN +180,0,0.0,0.1,NaN +180,-1,0.2,0.3,NaN +0,-1,0.0,0.1,NaN +180,-1,0.2,0.3,NaN +0,-1,0.0,0.1,NaN +180,0,0.0,0.1,NaN +180,-1,0.0,0.3,NaN +0,0,0.2,0.6,NaN +0,0,0.2,0.6,NaN +180,0,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.1,NaN +180,0,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +0,-1,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,-1,0.0,0.1,NaN +0,-1,0.0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.6,NaN +0,-1,0.2,0.25,NaN +0,0,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +0,0,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +180,0,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +0,0,0.2,0.25,NaN +0,-1,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.25,NaN +180,-1,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,-1,0.0,0.3,NaN +0,-1,0.2,0.3,NaN +180,0,0.0,0.4,NaN +180,-1,0.2,0.3,NaN +180,-1,0.0,0.4,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.3,NaN +0,-1,0.2,0.6,NaN +0,-1,0.0,0.2,NaN +180,-1,0.2,0.6,NaN +180,0,0.2,0.4,NaN +0,0,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.6,NaN +180,0,0.2,0.4,NaN +0,0,0.0,0.2,NaN +0,0,0.0,0.1,NaN +0,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +180,-1,0.0,0.1,NaN +0,-1,0.0,0.3,NaN +180,0,0.2,0.25,NaN +180,0,0.2,0.6,NaN +180,-1,0.0,0.3,NaN +180,0,0.2,0.3,NaN +0,0,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.6,NaN +180,0,0.0,0.25,NaN +180,100,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +180,0,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +180,-1,0.0,0.25,NaN +180,-1,0.2,0.4,NaN +0,0,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +180,-1,0.0,0.1,NaN +0,0,0.2,0.25,NaN +0,0,0.2,0.4,NaN +0,0,0.2,0.3,NaN +180,-1,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.25,NaN +0,-1,0.0,0.25,NaN +0,0,0.2,0.3,NaN +0,100,0.0,0.4,NaN +0,-1,0.2,0.3,NaN +180,0,0.2,0.25,NaN +0,-1,0.0,0.2,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +0,0,0.2,0.3,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.1,NaN +0,-1,0.2,0.4,NaN +180,0,0.2,0.3,NaN +180,0,0.2,0.3,NaN +0,-1,0.0,0.2,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +180,-1,0.0,0.2,NaN +180,-1,0.2,0.4,NaN +0,0,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.1,NaN +0,-1,0.0,0.1,NaN +0,-1,0.0,0.25,NaN +0,0,0.2,0.3,NaN +180,0,0.0,0.1,NaN +180,0,0.0,0.2,NaN +0,0,0.2,0.3,NaN +0,100,0.2,0.6,NaN +0,-1,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +0,0,0.0,0.2,NaN +180,-1,0.0,0.1,NaN +0,-1,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +0,-1,0.2,0.3,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.4,NaN +180,-1,0.0,0.2,NaN +0,-1,0.0,0.2,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.3,NaN +0,0,0.0,0.4,NaN +180,0,0.0,0.25,NaN +0,-1,0.2,0.25,NaN +180,0,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,0,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +180,0,0.0,0.1,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +0,0,0.2,0.25,NaN +180,-1,0.0,0.3,NaN +180,0,0.2,0.3,NaN +180,-1,0.0,0.2,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.25,NaN +0,-1,0.2,0.6,NaN +180,100,0.2,0.4,NaN +0,0,0.0,0.3,NaN +0,-1,0.2,0.3,NaN +180,0,0.0,0.2,NaN +180,-1,0.2,0.25,NaN +0,0,0.2,0.4,NaN +180,0,0.0,0.3,NaN +180,0,0.0,0.25,NaN +180,-1,0.0,0.4,NaN +180,100,0.0,0.4,NaN +0,-1,0.2,0.4,NaN +180,0,0.2,0.25,NaN +0,0,0.0,0.2,NaN +0,-1,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +180,0,0.2,0.25,NaN +180,100,0.0,0.2,NaN +180,-1,0.0,0.1,NaN +0,0,0.2,0.4,NaN +180,0,0.2,0.4,NaN +0,0,0.0,0.1,NaN +0,-1,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +0,-1,0.2,0.6,NaN +0,0,0.2,0.4,NaN +0,-1,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.2,NaN +0,-1,0.2,0.3,NaN +180,0,0.0,0.2,NaN +180,0,0.2,0.4,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +180,0,0.0,0.25,NaN +180,0,0.2,0.3,NaN +0,-1,0.2,0.4,NaN +0,100,0.0,0.25,NaN +180,0,0.2,0.6,NaN +180,0,0.0,0.1,NaN +0,0,0.2,0.3,NaN +0,-1,0.0,0.25,NaN +0,-1,0.0,0.25,NaN +0,-1,0.2,0.3,NaN +0,0,0.2,0.3,NaN +0,-1,0.0,0.4,NaN +0,100,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +180,0,0.0,0.2,NaN +0,0,0.0,0.25,NaN +0,0,0.0,0.2,NaN +0,-1,0.2,0.6,NaN +180,100,0.2,0.6,NaN +0,0,0.0,0.2,NaN +180,-1,0.2,0.25,NaN +180,0,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +0,-1,0.0,0.2,NaN +180,0,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +0,0,0.2,0.6,NaN +0,0,0.2,0.3,NaN +0,0,0.2,0.4,NaN +180,0,0.0,0.2,NaN +180,0,0.2,0.25,NaN +0,0,0.2,0.25,NaN +180,0,0.2,0.6,NaN +180,-1,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.25,NaN +0,0,0.2,0.3,NaN +0,-1,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +180,0,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +0,-1,0.0,0.1,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.3,NaN +0,-1,0.2,0.3,NaN +0,0,0.2,0.25,NaN +0,-1,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +180,0,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +0,0,0.2,0.3,NaN +0,-1,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.6,NaN +180,-1,0.2,0.25,NaN +180,0,0.2,0.3,NaN +180,0,0.0,0.25,NaN +180,0,0.2,0.25,NaN +0,-1,0.0,0.1,NaN +180,-1,0.2,0.6,NaN +180,-1,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +0,-1,0.2,0.3,NaN +0,-1,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.3,NaN +180,0,0.0,0.2,NaN +180,-1,0.0,0.1,NaN +180,0,0.2,0.4,NaN +0,0,0.2,0.25,NaN +0,0,0.2,0.3,NaN +0,0,0.0,0.4,NaN +180,-1,0.2,0.6,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +180,0,0.2,0.4,NaN +180,0,0.0,0.25,NaN +180,-1,0.2,0.25,NaN +0,-1,0.0,0.1,NaN +0,-1,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +0,0,0.0,0.1,NaN +180,0,0.0,0.3,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.4,NaN +180,-1,0.0,0.3,NaN +0,0,0.2,0.3,NaN +0,-1,0.2,0.4,NaN +180,-1,0.0,0.2,NaN +180,-1,0.2,0.4,NaN +180,0,0.0,0.2,NaN +0,-1,0.2,0.6,NaN +0,0,0.0,0.1,NaN +0,0,0.2,0.3,NaN +0,0,0.0,0.2,NaN +180,0,0.2,0.25,NaN +180,-1,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +0,0,0.2,0.6,NaN +180,0,0.0,0.4,NaN +0,-1,0.2,0.25,NaN +180,0,0.2,0.3,NaN +180,0,0.2,0.3,NaN +180,0,0.2,0.25,NaN +180,-1,0.0,0.25,NaN +180,0,0.2,0.6,NaN +0,-1,0.2,0.3,NaN +180,0,0.0,0.2,NaN +180,0,0.2,0.25,NaN +0,-1,0.0,0.25,NaN +0,0,0.2,0.3,NaN +0,0,0.0,0.25,NaN +180,100,0.0,0.4,NaN +0,-1,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +180,0,0.0,0.25,NaN +0,-1,0.0,0.2,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.3,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.25,NaN +0,100,0.0,0.4,NaN +180,-1,0.0,0.2,NaN +0,0,0.0,0.25,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.3,NaN +0,0,0.0,0.2,NaN +0,0,0.2,0.25,NaN +180,0,0.2,0.4,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.1,NaN +0,-1,0.2,0.4,NaN +180,100,0.0,0.1,NaN +180,-1,0.2,0.3,NaN +0,0,0.2,0.4,NaN +0,-1,0.0,0.1,NaN +0,-1,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +0,0,0.2,0.3,NaN +180,0,0.2,0.3,NaN +180,0,0.0,0.2,NaN +180,-1,0.0,0.25,NaN +0,-1,0.2,0.4,NaN +0,-1,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +180,-1,0.0,0.2,NaN +180,-1,0.0,0.3,NaN +0,-1,0.2,0.25,NaN +180,0,0.2,0.3,NaN +0,0,0.2,0.4,NaN +0,0,0.2,0.25,NaN +0,-1,0.2,0.6,NaN +180,-1,0.2,0.4,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.1,NaN +0,-1,0.2,0.25,NaN +0,-1,0.0,0.4,NaN +0,-1,0.2,0.3,NaN +0,0,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +180,0,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +0,0,0.0,0.1,NaN +180,-1,0.0,0.1,NaN +0,0,0.2,0.4,NaN +0,0,0.2,0.4,NaN +180,0,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +0,-1,0.2,0.4,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.1,NaN +0,0,0.2,0.3,NaN +0,-1,0.0,0.3,NaN +180,-1,0.2,0.3,NaN +0,-1,0.0,0.1,NaN +180,0,0.0,0.1,NaN +180,0,0.2,0.3,NaN +0,-1,0.2,0.4,NaN +180,0,0.0,0.1,NaN +180,0,0.0,0.2,NaN +180,-1,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +0,-1,0.2,0.4,NaN +180,-1,0.0,0.3,NaN +180,0,0.0,0.1,NaN +0,0,0.2,0.3,NaN +180,-1,0.0,0.2,NaN +0,100,0.2,0.25,NaN +0,-1,0.0,0.2,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.2,NaN +180,0,0.2,0.4,NaN +0,0,0.0,0.2,NaN +0,0,0.2,0.25,NaN +0,-1,0.0,0.1,NaN +180,0,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +0,0,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,0,0.2,0.4,NaN +180,0,0.0,0.2,NaN +180,-1,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +0,-1,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +0,100,0.0,0.3,NaN +180,-1,0.2,0.25,NaN +0,0,0.0,0.4,NaN +180,-1,0.2,0.3,NaN +0,-1,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,-1,0.0,0.2,NaN +0,100,0.0,0.25,NaN +0,0,0.0,0.2,NaN +180,-1,0.0,0.2,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.25,NaN +180,-1,0.0,0.1,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.6,NaN +0,0,0.2,0.3,NaN +180,0,0.0,0.2,NaN +0,0,0.2,0.4,NaN +0,0,0.0,0.3,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.4,NaN +180,-1,0.0,0.1,NaN +0,0,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +0,-1,0.0,0.1,NaN +180,-1,0.2,0.3,NaN +180,-1,0.0,0.1,NaN +0,0,0.0,0.1,NaN +180,0,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,0,0.2,0.3,NaN +180,100,0.0,0.3,NaN +180,0,0.0,0.3,NaN +180,-1,0.0,0.1,NaN +0,0,0.0,0.1,NaN +180,0,0.2,0.4,NaN +0,-1,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +180,0,0.0,0.1,NaN +180,-1,0.2,0.4,NaN +180,-1,0.0,0.1,NaN +180,100,0.2,0.25,NaN +0,-1,0.2,0.6,NaN +0,100,0.0,0.1,NaN +0,-1,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.0,0.4,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +180,0,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.4,NaN +0,-1,0.0,0.25,NaN +0,-1,0.2,0.3,NaN +180,0,0.2,0.6,NaN +0,-1,0.2,0.25,NaN +180,0,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +0,-1,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +0,0,0.2,0.3,NaN +180,0,0.2,0.4,NaN +0,0,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,0,0.0,0.3,NaN +0,-1,0.0,0.1,NaN +180,0,0.2,0.4,NaN +180,0,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,-1,0.0,0.1,NaN +0,-1,0.2,0.3,NaN +0,0,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.3,NaN +180,0,0.0,0.2,NaN +180,0,0.0,0.2,NaN +180,-1,0.0,0.2,NaN +180,-1,0.2,0.3,NaN +180,0,0.0,0.1,NaN +0,-1,0.2,0.25,NaN +180,-1,0.0,0.4,NaN +180,0,0.2,0.4,NaN +0,0,0.0,0.2,NaN +180,0,0.2,0.4,NaN +0,0,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,0,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +180,-1,0.0,0.2,NaN +0,100,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +180,100,0.0,0.2,NaN +180,0,0.2,0.4,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +180,-1,0.2,0.6,NaN +180,0,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +0,0,0.0,0.1,NaN +180,-1,0.0,0.1,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.2,NaN +0,0,0.2,0.4,NaN +180,0,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +0,0,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +0,0,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +0,-1,0.0,0.1,NaN +0,0,0.2,0.3,NaN +180,0,0.0,0.2,NaN +0,-1,0.2,0.3,NaN +180,0,0.2,0.4,NaN +180,0,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +180,-1,0.0,0.2,NaN +0,0,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,-1,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +180,0,0.2,0.25,NaN +0,-1,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,-1,0.0,0.1,NaN +180,-1,0.0,0.25,NaN +0,-1,0.2,0.3,NaN +0,-1,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +0,0,0.0,0.4,NaN +0,0,0.0,0.1,NaN +0,0,0.2,0.3,NaN +0,-1,0.0,0.4,NaN +180,0,0.2,0.25,NaN +0,0,0.0,0.2,NaN +180,-1,0.2,0.25,NaN +180,0,0.0,0.25,NaN +180,-1,0.2,0.4,NaN +0,0,0.2,0.25,NaN +180,0,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +180,0,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.6,NaN +180,0,0.2,0.25,NaN +180,0,0.2,0.3,NaN +0,-1,0.2,0.25,NaN +0,0,0.2,0.4,NaN +0,-1,0.2,0.6,NaN +180,0,0.2,0.3,NaN +180,-1,0.0,0.3,NaN +0,0,0.0,0.1,NaN +180,0,0.2,0.4,NaN +0,0,0.2,0.3,NaN +0,-1,0.2,0.3,NaN +180,-1,0.0,0.2,NaN +0,-1,0.2,0.3,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +180,-1,0.0,0.2,NaN +180,-1,0.0,0.1,NaN +0,0,0.2,0.4,NaN +0,0,0.0,0.2,NaN +0,-1,0.0,0.4,NaN +0,-1,0.0,0.2,NaN +180,0,0.2,0.4,NaN +180,0,0.2,0.3,NaN +0,0,0.0,0.2,NaN +180,0,0.2,0.25,NaN +180,-1,0.0,0.4,NaN +0,0,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +0,-1,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +0,0,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +180,-1,0.0,0.1,NaN +0,-1,0.2,0.25,NaN +180,-1,0.2,0.4,NaN +180,0,0.0,0.25,NaN +0,-1,0.2,0.6,NaN +180,-1,0.0,0.2,NaN +180,0,0.2,0.6,NaN +180,-1,0.2,0.25,NaN +180,0,0.0,0.1,NaN +0,-1,0.2,0.3,NaN +180,0,0.0,0.1,NaN +0,-1,0.0,0.25,NaN +0,0,0.2,0.3,NaN +0,-1,0.2,0.25,NaN +0,-1,0.0,0.2,NaN +180,-1,0.2,0.6,NaN +0,-1,0.2,0.3,NaN +0,-1,0.2,0.3,NaN +0,-1,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.4,NaN +180,0,0.2,0.3,NaN +0,100,0.2,0.3,NaN +0,0,0.2,0.25,NaN +180,-1,0.0,0.2,NaN +0,0,0.2,0.4,NaN +0,-1,0.0,0.1,NaN +180,0,0.2,0.4,NaN +0,-1,0.2,0.25,NaN +180,-1,0.0,0.1,NaN +180,0,0.2,0.3,NaN +0,-1,0.2,0.25,NaN +0,-1,0.0,0.1,NaN +180,-1,0.0,0.1,NaN +180,100,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.4,NaN +0,-1,0.0,0.2,NaN +180,-1,0.2,0.3,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.3,NaN +0,-1,0.2,0.25,NaN +0,-1,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +180,100,0.2,0.25,NaN +0,0,0.2,0.6,NaN +180,-1,0.0,0.1,NaN +180,0,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +180,0,0.2,0.25,NaN +0,0,0.0,0.1,NaN +180,-1,0.2,0.3,NaN +180,0,0.2,0.3,NaN +0,0,0.2,0.3,NaN +0,0,0.2,0.4,NaN +180,0,0.0,0.2,NaN +0,0,0.0,0.2,NaN +180,0,0.0,0.2,NaN +0,-1,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN diff --git a/modularTasks/tasks/AdrianTests/trials_pre_expt/Block0_metadata.json b/modularTasks/tasks/AdrianTests/trials_pre_expt/Block0_metadata.json new file mode 100755 index 0000000..986c1ef --- /dev/null +++ b/modularTasks/tasks/AdrianTests/trials_pre_expt/Block0_metadata.json @@ -0,0 +1,55 @@ +{ + "seed": 1, + "num_trials": 820, + "prob_cp": 0.7, + "cond_prob_cp": 0.8749999999999999, + "theoretical_marginals": { + "coh": { + "0": 0.4, + "th": 0.55, + "100": 0.05 + }, + "vd": { + "100": 0.1, + "200": 0.1, + "250": 0.25, + "300": 0.25, + "400": 0.25, + "600": 0.05 + }, + "dir": { + "left": 0.5, + "right": 0.5 + }, + "cp": { + "false": 0.30000000000000004, + "true": 0.7 + } + }, + "empirical_marginals": { + "coh": { + "0": 0.3902439024390244, + "th": 0.5597560975609757, + "100": 0.05 + }, + "vd": { + "100": 0.1, + "200": 0.10365853658536585, + "250": 0.2451219512195122, + "300": 0.24024390243902438, + "400": 0.2573170731707317, + "600": 0.05365853658536585 + }, + "dir": { + "left": 0.48902439024390243, + "right": 0.5109756097560976 + }, + "cp": { + "true": 0.698780487804878, + "false": 0.30121951219512194 + } + }, + "marginal_tolerance": 0.02, + "csv_filename": "Block0.csv", + "csv_md5": "cf31feec5a3537a2cbe4de24877672bc" +} \ No newline at end of file diff --git a/modularTasks/tasks/AdrianTests/trials_pre_expt/Block1.csv b/modularTasks/tasks/AdrianTests/trials_pre_expt/Block1.csv new file mode 100644 index 0000000..6197bc0 --- /dev/null +++ b/modularTasks/tasks/AdrianTests/trials_pre_expt/Block1.csv @@ -0,0 +1,821 @@ +direction,coherence,reversal,duration,finalDuration +0,0,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +0,-1,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +180,0,0.0,0.25,NaN +180,-1,0.2,0.3,NaN +180,0,0.0,0.4,NaN +0,-1,0.0,0.4,NaN +0,-1,0.0,0.3,NaN +180,-1,0.0,0.3,NaN +0,-1,0.0,0.4,NaN +180,-1,0.0,0.4,NaN +180,-1,0.2,0.25,NaN +0,-1,0.0,0.1,NaN +180,0,0.2,0.3,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +180,0,0.2,0.25,NaN +180,0,0.0,0.1,NaN +0,-1,0.2,0.25,NaN +180,0,0.0,0.3,NaN +0,0,0.0,0.1,NaN +0,-1,0.0,0.25,NaN +0,100,0.0,0.4,NaN +0,0,0.2,0.25,NaN +180,-1,0.0,0.4,NaN +0,-1,0.2,0.25,NaN +0,0,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +0,0,0.0,0.4,NaN +0,100,0.2,0.4,NaN +0,0,0.2,0.3,NaN +0,0,0.2,0.3,NaN +0,100,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +180,0,0.0,0.1,NaN +180,-1,0.2,0.6,NaN +180,-1,0.0,0.4,NaN +180,0,0.0,0.6,NaN +0,0,0.0,0.2,NaN +180,-1,0.0,0.4,NaN +180,-1,0.0,0.2,NaN +180,-1,0.0,0.4,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.2,NaN +180,0,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +180,0,0.0,0.3,NaN +0,0,0.0,0.4,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.3,NaN +0,-1,0.0,0.2,NaN +180,-1,0.2,0.3,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.25,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.4,NaN +0,-1,0.0,0.2,NaN +0,0,0.2,0.4,NaN +0,-1,0.0,0.25,NaN +180,-1,0.0,0.3,NaN +0,-1,0.0,0.4,NaN +180,-1,0.0,0.1,NaN +180,-1,0.0,0.25,NaN +0,0,0.2,0.3,NaN +0,0,0.0,0.25,NaN +0,0,0.0,0.25,NaN +0,0,0.2,0.3,NaN +180,0,0.0,0.3,NaN +0,100,0.0,0.6,NaN +0,100,0.2,0.3,NaN +0,0,0.2,0.25,NaN +180,-1,0.0,0.1,NaN +180,-1,0.0,0.25,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.1,NaN +0,100,0.2,0.3,NaN +180,0,0.2,0.3,NaN +180,0,0.0,0.1,NaN +0,-1,0.0,0.1,NaN +180,-1,0.0,0.4,NaN +180,0,0.0,0.4,NaN +0,-1,0.0,0.4,NaN +0,0,0.0,0.2,NaN +0,0,0.2,0.3,NaN +0,-1,0.2,0.3,NaN +180,-1,0.0,0.25,NaN +180,0,0.2,0.3,NaN +0,0,0.0,0.3,NaN +180,0,0.0,0.2,NaN +0,0,0.2,0.25,NaN +180,0,0.0,0.25,NaN +180,-1,0.0,0.4,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +180,-1,0.0,0.3,NaN +180,-1,0.0,0.4,NaN +180,-1,0.0,0.6,NaN +180,-1,0.0,0.25,NaN +0,0,0.2,0.25,NaN +180,0,0.0,0.25,NaN +0,-1,0.0,0.4,NaN +0,-1,0.0,0.4,NaN +180,-1,0.2,0.4,NaN +180,0,0.0,0.2,NaN +0,-1,0.0,0.6,NaN +0,0,0.0,0.1,NaN +180,-1,0.0,0.3,NaN +180,0,0.0,0.2,NaN +180,0,0.0,0.25,NaN +0,-1,0.2,0.25,NaN +0,0,0.0,0.1,NaN +0,-1,0.0,0.3,NaN +180,0,0.0,0.4,NaN +0,0,0.0,0.1,NaN +0,0,0.2,0.4,NaN +0,0,0.0,0.2,NaN +0,-1,0.0,0.1,NaN +180,-1,0.0,0.2,NaN +180,0,0.0,0.4,NaN +0,-1,0.0,0.25,NaN +180,0,0.0,0.25,NaN +180,-1,0.2,0.4,NaN +0,0,0.0,0.25,NaN +180,0,0.0,0.4,NaN +180,-1,0.0,0.2,NaN +0,0,0.2,0.4,NaN +0,0,0.0,0.1,NaN +180,-1,0.2,0.3,NaN +180,0,0.0,0.1,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.2,NaN +0,0,0.0,0.2,NaN +0,-1,0.0,0.1,NaN +0,-1,0.0,0.4,NaN +0,-1,0.0,0.1,NaN +180,-1,0.0,0.3,NaN +180,0,0.2,0.25,NaN +0,-1,0.0,0.1,NaN +0,-1,0.2,0.4,NaN +180,-1,0.0,0.2,NaN +180,0,0.0,0.1,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.2,NaN +180,-1,0.0,0.4,NaN +0,-1,0.2,0.6,NaN +0,-1,0.0,0.3,NaN +180,-1,0.2,0.4,NaN +0,-1,0.0,0.3,NaN +0,0,0.0,0.1,NaN +180,-1,0.0,0.3,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.25,NaN +0,-1,0.0,0.3,NaN +180,-1,0.2,0.6,NaN +0,0,0.0,0.2,NaN +0,-1,0.0,0.2,NaN +180,0,0.2,0.4,NaN +0,-1,0.0,0.2,NaN +180,0,0.2,0.25,NaN +180,-1,0.0,0.1,NaN +0,0,0.0,0.2,NaN +0,-1,0.0,0.2,NaN +180,0,0.0,0.4,NaN +180,0,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.2,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.25,NaN +0,-1,0.0,0.4,NaN +0,-1,0.0,0.25,NaN +180,-1,0.2,0.4,NaN +0,-1,0.0,0.25,NaN +0,-1,0.0,0.1,NaN +0,-1,0.0,0.25,NaN +0,-1,0.2,0.3,NaN +180,0,0.0,0.3,NaN +180,0,0.0,0.4,NaN +0,0,0.0,0.25,NaN +180,0,0.0,0.2,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +180,-1,0.0,0.25,NaN +180,-1,0.0,0.25,NaN +180,-1,0.2,0.3,NaN +180,-1,0.0,0.3,NaN +0,-1,0.0,0.3,NaN +0,0,0.2,0.3,NaN +180,0,0.0,0.3,NaN +0,0,0.2,0.25,NaN +180,-1,0.0,0.25,NaN +180,0,0.0,0.1,NaN +180,0,0.0,0.4,NaN +0,-1,0.0,0.2,NaN +180,-1,0.0,0.25,NaN +180,-1,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +180,0,0.0,0.3,NaN +180,-1,0.2,0.6,NaN +180,0,0.2,0.25,NaN +180,0,0.0,0.1,NaN +0,0,0.0,0.1,NaN +0,-1,0.0,0.2,NaN +180,100,0.0,0.25,NaN +0,0,0.2,0.25,NaN +180,-1,0.0,0.25,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.4,NaN +0,0,0.0,0.4,NaN +180,-1,0.0,0.2,NaN +180,0,0.0,0.4,NaN +0,-1,0.0,0.4,NaN +0,-1,0.0,0.1,NaN +180,-1,0.0,0.2,NaN +180,-1,0.0,0.3,NaN +0,-1,0.2,0.4,NaN +180,-1,0.0,0.2,NaN +0,0,0.0,0.25,NaN +0,-1,0.0,0.4,NaN +180,0,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +0,-1,0.0,0.25,NaN +0,-1,0.0,0.25,NaN +180,-1,0.0,0.4,NaN +0,0,0.0,0.4,NaN +180,-1,0.0,0.4,NaN +0,0,0.0,0.3,NaN +180,-1,0.0,0.1,NaN +180,-1,0.0,0.4,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +180,0,0.0,0.1,NaN +0,0,0.0,0.2,NaN +0,0,0.0,0.3,NaN +0,-1,0.0,0.1,NaN +0,-1,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +0,0,0.2,0.3,NaN +180,-1,0.2,0.6,NaN +180,0,0.0,0.3,NaN +0,-1,0.0,0.6,NaN +180,0,0.0,0.4,NaN +0,0,0.0,0.2,NaN +0,0,0.0,0.4,NaN +0,0,0.2,0.4,NaN +0,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +0,-1,0.0,0.1,NaN +180,-1,0.0,0.25,NaN +0,-1,0.0,0.1,NaN +0,-1,0.0,0.25,NaN +180,0,0.2,0.3,NaN +180,0,0.2,0.25,NaN +0,-1,0.2,0.25,NaN +0,0,0.0,0.25,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.25,NaN +0,0,0.0,0.25,NaN +180,0,0.2,0.3,NaN +0,-1,0.0,0.25,NaN +0,0,0.0,0.25,NaN +180,-1,0.0,0.3,NaN +0,100,0.2,0.3,NaN +180,0,0.0,0.3,NaN +0,-1,0.0,0.2,NaN +180,0,0.0,0.4,NaN +180,-1,0.0,0.4,NaN +180,100,0.0,0.3,NaN +180,0,0.0,0.4,NaN +180,-1,0.0,0.2,NaN +0,-1,0.0,0.4,NaN +180,0,0.0,0.4,NaN +180,0,0.2,0.3,NaN +180,0,0.0,0.4,NaN +180,0,0.0,0.4,NaN +0,0,0.0,0.25,NaN +0,-1,0.0,0.1,NaN +0,-1,0.0,0.25,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.4,NaN +180,-1,0.0,0.4,NaN +180,-1,0.0,0.25,NaN +180,0,0.2,0.25,NaN +0,-1,0.0,0.1,NaN +0,0,0.0,0.1,NaN +0,0,0.0,0.3,NaN +0,0,0.0,0.25,NaN +0,-1,0.0,0.25,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.1,NaN +180,-1,0.0,0.25,NaN +180,0,0.0,0.2,NaN +0,-1,0.0,0.25,NaN +180,-1,0.0,0.3,NaN +180,-1,0.0,0.4,NaN +0,100,0.2,0.25,NaN +0,0,0.2,0.4,NaN +0,0,0.0,0.3,NaN +180,0,0.0,0.4,NaN +180,-1,0.0,0.25,NaN +180,-1,0.0,0.2,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.3,NaN +180,0,0.0,0.1,NaN +180,0,0.0,0.2,NaN +180,-1,0.0,0.3,NaN +180,-1,0.0,0.4,NaN +0,0,0.0,0.25,NaN +180,-1,0.0,0.1,NaN +0,-1,0.2,0.25,NaN +180,0,0.0,0.3,NaN +0,-1,0.0,0.3,NaN +0,0,0.0,0.2,NaN +0,0,0.0,0.4,NaN +0,-1,0.2,0.4,NaN +180,0,0.0,0.4,NaN +0,0,0.0,0.1,NaN +180,-1,0.0,0.3,NaN +180,0,0.2,0.25,NaN +180,-1,0.0,0.4,NaN +180,-1,0.0,0.3,NaN +0,-1,0.0,0.4,NaN +0,100,0.2,0.3,NaN +180,0,0.2,0.3,NaN +0,-1,0.0,0.4,NaN +180,0,0.0,0.3,NaN +0,0,0.2,0.4,NaN +180,0,0.0,0.25,NaN +180,0,0.0,0.3,NaN +0,-1,0.2,0.3,NaN +0,0,0.0,0.1,NaN +180,0,0.0,0.1,NaN +180,-1,0.2,0.4,NaN +0,-1,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +180,0,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +180,0,0.0,0.4,NaN +180,-1,0.0,0.1,NaN +180,0,0.0,0.1,NaN +0,0,0.0,0.4,NaN +180,0,0.0,0.25,NaN +0,0,0.2,0.4,NaN +180,-1,0.0,0.25,NaN +180,-1,0.2,0.3,NaN +180,0,0.0,0.3,NaN +0,0,0.2,0.3,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.25,NaN +180,-1,0.0,0.3,NaN +180,-1,0.0,0.3,NaN +180,-1,0.0,0.3,NaN +180,-1,0.0,0.4,NaN +180,0,0.0,0.4,NaN +0,-1,0.0,0.3,NaN +180,0,0.0,0.1,NaN +0,0,0.2,0.6,NaN +0,-1,0.0,0.6,NaN +180,-1,0.0,0.25,NaN +180,-1,0.2,0.3,NaN +0,-1,0.2,0.25,NaN +0,-1,0.0,0.4,NaN +0,0,0.0,0.2,NaN +180,0,0.2,0.25,NaN +0,0,0.2,0.3,NaN +180,-1,0.0,0.1,NaN +180,100,0.0,0.3,NaN +180,0,0.2,0.3,NaN +0,-1,0.0,0.4,NaN +0,0,0.0,0.4,NaN +0,0,0.0,0.3,NaN +0,-1,0.0,0.3,NaN +180,-1,0.0,0.4,NaN +180,0,0.0,0.2,NaN +180,-1,0.2,0.25,NaN +0,-1,0.0,0.4,NaN +180,-1,0.2,0.4,NaN +180,0,0.0,0.1,NaN +0,0,0.2,0.4,NaN +180,-1,0.0,0.3,NaN +0,-1,0.0,0.4,NaN +180,-1,0.0,0.3,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.1,NaN +180,-1,0.0,0.2,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.25,NaN +0,0,0.2,0.4,NaN +180,0,0.2,0.6,NaN +0,-1,0.2,0.3,NaN +0,0,0.0,0.3,NaN +0,0,0.0,0.25,NaN +0,0,0.0,0.25,NaN +0,0,0.0,0.25,NaN +180,100,0.0,0.4,NaN +0,0,0.0,0.25,NaN +180,-1,0.0,0.6,NaN +0,0,0.2,0.25,NaN +0,-1,0.0,0.1,NaN +0,-1,0.0,0.4,NaN +0,-1,0.0,0.4,NaN +180,-1,0.0,0.4,NaN +0,-1,0.2,0.25,NaN +180,0,0.0,0.3,NaN +180,-1,0.0,0.3,NaN +0,0,0.2,0.4,NaN +180,0,0.0,0.3,NaN +0,-1,0.0,0.3,NaN +0,-1,0.0,0.25,NaN +180,0,0.0,0.3,NaN +0,-1,0.2,0.3,NaN +180,-1,0.0,0.4,NaN +180,-1,0.0,0.4,NaN +0,0,0.0,0.2,NaN +0,-1,0.0,0.3,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.1,NaN +0,-1,0.0,0.2,NaN +180,0,0.0,0.3,NaN +180,-1,0.2,0.3,NaN +180,0,0.0,0.3,NaN +0,-1,0.2,0.25,NaN +180,0,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,0,0.0,0.3,NaN +0,-1,0.0,0.4,NaN +180,0,0.2,0.25,NaN +0,0,0.2,0.6,NaN +180,-1,0.0,0.1,NaN +0,-1,0.2,0.3,NaN +180,0,0.2,0.4,NaN +180,0,0.2,0.4,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.25,NaN +0,-1,0.2,0.25,NaN +180,0,0.0,0.2,NaN +0,0,0.2,0.25,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.2,NaN +180,0,0.0,0.2,NaN +0,-1,0.0,0.3,NaN +180,-1,0.0,0.1,NaN +0,0,0.0,0.4,NaN +0,-1,0.2,0.25,NaN +180,0,0.2,0.3,NaN +0,0,0.2,0.25,NaN +180,0,0.0,0.4,NaN +0,-1,0.0,0.3,NaN +0,0,0.0,0.4,NaN +0,-1,0.0,0.25,NaN +0,-1,0.0,0.3,NaN +180,0,0.2,0.4,NaN +0,0,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +180,100,0.0,0.25,NaN +180,-1,0.0,0.3,NaN +180,-1,0.2,0.3,NaN +180,0,0.0,0.1,NaN +180,0,0.0,0.4,NaN +180,-1,0.2,0.3,NaN +180,-1,0.2,0.3,NaN +180,0,0.0,0.4,NaN +180,0,0.0,0.3,NaN +180,-1,0.2,0.3,NaN +0,-1,0.0,0.2,NaN +180,0,0.2,0.25,NaN +180,0,0.0,0.25,NaN +180,0,0.0,0.2,NaN +0,-1,0.2,0.6,NaN +180,-1,0.0,0.4,NaN +180,0,0.0,0.2,NaN +0,0,0.0,0.25,NaN +180,-1,0.0,0.2,NaN +180,0,0.2,0.6,NaN +180,-1,0.0,0.4,NaN +180,-1,0.0,0.3,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.4,NaN +180,0,0.2,0.4,NaN +0,-1,0.2,0.4,NaN +0,0,0.0,0.2,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.4,NaN +0,0,0.2,0.25,NaN +0,0,0.0,0.2,NaN +180,-1,0.0,0.3,NaN +180,-1,0.0,0.3,NaN +180,0,0.2,0.3,NaN +0,0,0.0,0.6,NaN +0,-1,0.0,0.4,NaN +180,0,0.0,0.3,NaN +180,-1,0.0,0.25,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.4,NaN +180,0,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +0,-1,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.25,NaN +0,100,0.0,0.25,NaN +180,-1,0.0,0.4,NaN +180,-1,0.0,0.25,NaN +180,0,0.2,0.25,NaN +180,0,0.0,0.3,NaN +0,0,0.0,0.2,NaN +0,0,0.0,0.2,NaN +180,-1,0.0,0.4,NaN +180,0,0.0,0.25,NaN +180,-1,0.0,0.3,NaN +180,-1,0.0,0.3,NaN +0,0,0.0,0.4,NaN +0,-1,0.0,0.4,NaN +0,0,0.0,0.4,NaN +0,0,0.2,0.3,NaN +0,-1,0.0,0.4,NaN +180,100,0.0,0.1,NaN +180,0,0.2,0.3,NaN +0,-1,0.0,0.3,NaN +180,-1,0.0,0.25,NaN +180,-1,0.0,0.4,NaN +180,0,0.0,0.3,NaN +0,-1,0.0,0.2,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.1,NaN +0,0,0.2,0.4,NaN +0,-1,0.0,0.3,NaN +0,0,0.0,0.25,NaN +180,-1,0.0,0.1,NaN +0,0,0.0,0.3,NaN +180,-1,0.0,0.2,NaN +0,-1,0.2,0.4,NaN +0,-1,0.0,0.25,NaN +180,-1,0.0,0.3,NaN +180,0,0.0,0.3,NaN +180,-1,0.0,0.6,NaN +0,-1,0.0,0.2,NaN +0,0,0.0,0.6,NaN +180,0,0.0,0.25,NaN +180,0,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +0,0,0.2,0.3,NaN +0,-1,0.2,0.25,NaN +180,-1,0.0,0.3,NaN +180,-1,0.2,0.4,NaN +180,-1,0.0,0.1,NaN +0,-1,0.2,0.4,NaN +180,-1,0.0,0.3,NaN +0,0,0.0,0.25,NaN +0,0,0.2,0.25,NaN +0,0,0.0,0.2,NaN +180,-1,0.0,0.3,NaN +180,0,0.0,0.25,NaN +0,0,0.0,0.25,NaN +180,-1,0.2,0.3,NaN +180,0,0.0,0.1,NaN +180,-1,0.2,0.6,NaN +180,0,0.0,0.1,NaN +0,0,0.0,0.3,NaN +180,-1,0.0,0.3,NaN +180,-1,0.0,0.3,NaN +180,-1,0.0,0.3,NaN +180,0,0.0,0.2,NaN +180,-1,0.0,0.3,NaN +0,-1,0.0,0.4,NaN +0,100,0.0,0.4,NaN +180,-1,0.2,0.4,NaN +180,0,0.0,0.6,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.2,NaN +0,0,0.2,0.25,NaN +180,0,0.0,0.6,NaN +180,0,0.2,0.4,NaN +0,-1,0.0,0.3,NaN +0,-1,0.0,0.3,NaN +180,0,0.2,0.3,NaN +180,0,0.0,0.2,NaN +0,-1,0.0,0.25,NaN +0,-1,0.0,0.1,NaN +180,0,0.0,0.4,NaN +0,0,0.0,0.2,NaN +0,0,0.0,0.3,NaN +180,0,0.2,0.25,NaN +0,-1,0.0,0.25,NaN +0,0,0.0,0.4,NaN +0,-1,0.0,0.2,NaN +180,0,0.0,0.6,NaN +0,0,0.0,0.6,NaN +180,-1,0.0,0.25,NaN +0,-1,0.0,0.4,NaN +180,100,0.0,0.25,NaN +180,0,0.2,0.4,NaN +180,0,0.0,0.2,NaN +0,-1,0.0,0.1,NaN +0,-1,0.2,0.25,NaN +0,0,0.0,0.1,NaN +0,-1,0.0,0.2,NaN +180,0,0.2,0.25,NaN +0,-1,0.0,0.25,NaN +0,-1,0.0,0.3,NaN +180,-1,0.2,0.3,NaN +0,0,0.0,0.25,NaN +180,0,0.2,0.4,NaN +0,-1,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +180,0,0.0,0.25,NaN +0,0,0.0,0.2,NaN +180,0,0.2,0.3,NaN +0,-1,0.0,0.3,NaN +180,0,0.2,0.3,NaN +180,-1,0.0,0.3,NaN +0,-1,0.0,0.2,NaN +180,0,0.0,0.2,NaN +0,0,0.2,0.3,NaN +0,0,0.0,0.25,NaN +0,-1,0.0,0.4,NaN +0,-1,0.0,0.25,NaN +180,0,0.2,0.25,NaN +180,-1,0.2,0.3,NaN +0,-1,0.0,0.25,NaN +0,0,0.2,0.3,NaN +180,-1,0.0,0.25,NaN +0,-1,0.0,0.1,NaN +0,-1,0.2,0.3,NaN +0,-1,0.2,0.3,NaN +0,0,0.0,0.4,NaN +0,-1,0.0,0.1,NaN +180,-1,0.0,0.2,NaN +180,-1,0.2,0.25,NaN +0,-1,0.0,0.2,NaN +180,-1,0.2,0.25,NaN +0,0,0.2,0.25,NaN +0,-1,0.0,0.3,NaN +0,-1,0.2,0.25,NaN +180,0,0.2,0.4,NaN +0,0,0.0,0.3,NaN +180,0,0.2,0.3,NaN +180,-1,0.0,0.4,NaN +0,0,0.0,0.2,NaN +0,0,0.0,0.3,NaN +180,-1,0.2,0.25,NaN +180,0,0.0,0.25,NaN +0,-1,0.0,0.25,NaN +0,0,0.0,0.3,NaN +0,-1,0.0,0.1,NaN +0,-1,0.0,0.1,NaN +180,0,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,-1,0.0,0.4,NaN +180,-1,0.0,0.2,NaN +180,-1,0.0,0.4,NaN +180,-1,0.0,0.1,NaN +180,0,0.0,0.4,NaN +0,-1,0.0,0.2,NaN +180,0,0.0,0.4,NaN +180,-1,0.2,0.25,NaN +0,0,0.0,0.2,NaN +180,-1,0.0,0.2,NaN +0,-1,0.0,0.4,NaN +0,0,0.0,0.25,NaN +0,-1,0.0,0.4,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.25,NaN +0,-1,0.0,0.3,NaN +180,-1,0.2,0.25,NaN +180,-1,0.2,0.25,NaN +180,0,0.0,0.2,NaN +0,0,0.0,0.25,NaN +0,-1,0.0,0.2,NaN +0,0,0.0,0.3,NaN +0,-1,0.0,0.4,NaN +180,-1,0.2,0.25,NaN +0,0,0.0,0.6,NaN +0,0,0.0,0.25,NaN +180,0,0.0,0.2,NaN +0,0,0.2,0.4,NaN +180,0,0.0,0.4,NaN +0,-1,0.0,0.2,NaN +180,0,0.0,0.4,NaN +0,-1,0.0,0.1,NaN +180,-1,0.2,0.4,NaN +180,0,0.0,0.1,NaN +180,0,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,-1,0.0,0.1,NaN +180,0,0.0,0.2,NaN +0,-1,0.0,0.25,NaN +0,0,0.2,0.4,NaN +0,100,0.0,0.4,NaN +180,0,0.0,0.6,NaN +180,0,0.0,0.4,NaN +180,0,0.0,0.25,NaN +0,-1,0.0,0.3,NaN +180,0,0.0,0.4,NaN +180,-1,0.0,0.25,NaN +180,0,0.2,0.3,NaN +0,-1,0.2,0.6,NaN +180,0,0.0,0.4,NaN +180,-1,0.0,0.6,NaN +0,-1,0.0,0.25,NaN +0,-1,0.0,0.3,NaN +180,-1,0.0,0.2,NaN +180,-1,0.2,0.4,NaN +180,0,0.0,0.1,NaN +180,-1,0.0,0.4,NaN +180,-1,0.0,0.25,NaN +180,0,0.2,0.3,NaN +180,-1,0.0,0.1,NaN +180,-1,0.2,0.25,NaN +0,0,0.2,0.25,NaN +180,-1,0.0,0.1,NaN +180,-1,0.0,0.25,NaN +180,0,0.0,0.1,NaN +0,-1,0.2,0.25,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.25,NaN +0,0,0.0,0.3,NaN +180,0,0.2,0.3,NaN +180,-1,0.0,0.4,NaN +0,0,0.2,0.3,NaN +0,-1,0.0,0.2,NaN +0,-1,0.0,0.4,NaN +180,-1,0.0,0.1,NaN +0,-1,0.0,0.3,NaN +0,0,0.2,0.3,NaN +180,-1,0.0,0.4,NaN +0,-1,0.0,0.3,NaN +180,100,0.0,0.1,NaN +180,-1,0.0,0.3,NaN +0,0,0.0,0.1,NaN +0,0,0.2,0.3,NaN +0,0,0.0,0.6,NaN +180,-1,0.2,0.4,NaN +0,-1,0.0,0.4,NaN +0,0,0.0,0.25,NaN +0,-1,0.2,0.4,NaN +180,0,0.0,0.4,NaN +0,0,0.0,0.3,NaN +0,0,0.2,0.4,NaN +0,-1,0.0,0.2,NaN +0,-1,0.2,0.25,NaN +0,-1,0.0,0.4,NaN +180,-1,0.0,0.25,NaN +0,-1,0.2,0.25,NaN +0,-1,0.2,0.3,NaN +180,0,0.0,0.3,NaN +0,-1,0.2,0.4,NaN +0,0,0.2,0.3,NaN +0,0,0.0,0.3,NaN +0,-1,0.0,0.4,NaN +180,0,0.0,0.3,NaN +180,-1,0.0,0.1,NaN +0,0,0.2,0.3,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.3,NaN +0,-1,0.0,0.3,NaN +0,-1,0.0,0.3,NaN +180,-1,0.0,0.4,NaN +0,-1,0.2,0.25,NaN +0,0,0.2,0.4,NaN +180,-1,0.2,0.3,NaN +0,-1,0.0,0.25,NaN +0,-1,0.2,0.3,NaN +0,-1,0.0,0.25,NaN +0,-1,0.0,0.1,NaN +0,0,0.0,0.1,NaN +180,0,0.0,0.3,NaN +180,-1,0.2,0.25,NaN +180,-1,0.0,0.25,NaN +0,-1,0.0,0.3,NaN +180,0,0.0,0.25,NaN +0,0,0.0,0.1,NaN +180,0,0.0,0.3,NaN +0,0,0.0,0.4,NaN +0,-1,0.0,0.25,NaN +180,-1,0.2,0.4,NaN +180,-1,0.0,0.1,NaN +0,0,0.0,0.25,NaN +180,0,0.0,0.4,NaN +0,-1,0.2,0.25,NaN +180,0,0.2,0.25,NaN +180,-1,0.0,0.2,NaN +0,-1,0.2,0.3,NaN +180,0,0.2,0.4,NaN +180,-1,0.2,0.25,NaN +0,-1,0.0,0.3,NaN +0,-1,0.0,0.6,NaN +0,-1,0.0,0.3,NaN +0,100,0.0,0.25,NaN +180,0,0.2,0.3,NaN +0,0,0.0,0.4,NaN +0,0,0.2,0.25,NaN +0,100,0.0,0.4,NaN +0,-1,0.2,0.25,NaN +180,-1,0.0,0.1,NaN +0,0,0.2,0.3,NaN +0,100,0.0,0.1,NaN +0,-1,0.0,0.3,NaN +180,0,0.0,0.4,NaN +0,0,0.0,0.25,NaN +180,-1,0.0,0.6,NaN +180,0,0.0,0.2,NaN +180,-1,0.0,0.1,NaN +180,0,0.2,0.6,NaN +180,0,0.2,0.4,NaN +0,-1,0.0,0.1,NaN +180,0,0.2,0.3,NaN +180,-1,0.0,0.1,NaN +180,0,0.0,0.3,NaN +180,-1,0.0,0.3,NaN +0,-1,0.0,0.25,NaN +0,0,0.0,0.1,NaN diff --git a/modularTasks/tasks/AdrianTests/trials_pre_expt/Block1_metadata.json b/modularTasks/tasks/AdrianTests/trials_pre_expt/Block1_metadata.json new file mode 100755 index 0000000..bf0633d --- /dev/null +++ b/modularTasks/tasks/AdrianTests/trials_pre_expt/Block1_metadata.json @@ -0,0 +1,55 @@ +{ + "seed": 2, + "num_trials": 820, + "prob_cp": 0.3, + "cond_prob_cp": 0.37499999999999994, + "theoretical_marginals": { + "coh": { + "0": 0.4, + "th": 0.55, + "100": 0.05 + }, + "vd": { + "100": 0.1, + "200": 0.1, + "250": 0.25, + "300": 0.25, + "400": 0.25, + "600": 0.05 + }, + "dir": { + "left": 0.5, + "right": 0.5 + }, + "cp": { + "false": 0.7, + "true": 0.3 + } + }, + "empirical_marginals": { + "coh": { + "0": 0.4073170731707317, + "th": 0.5621951219512196, + "100": 0.03048780487804878 + }, + "vd": { + "100": 0.11097560975609756, + "200": 0.11585365853658537, + "250": 0.23780487804878048, + "300": 0.24634146341463414, + "400": 0.24878048780487805, + "600": 0.04024390243902439 + }, + "dir": { + "left": 0.5085365853658537, + "right": 0.49146341463414633 + }, + "cp": { + "true": 0.3097560975609756, + "false": 0.6902439024390243 + } + }, + "marginal_tolerance": 0.02, + "csv_filename": "Block1.csv", + "csv_md5": "3e2e6baf7d4e2acc320cc317d55d3c4b" +} \ No newline at end of file From 79b04799058965086e8a61b4dfbf75770de12d65 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 5 Nov 2019 12:57:54 -0500 Subject: [PATCH 49/78] tweak feedback --- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index e69f804..656e43d 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -42,7 +42,7 @@ 'minEpochDuration', 0.1, ... 'maxEpochDuration', 5.0, ... 'minimumRT', 0.05, ... - 'showFeedback', 1.0, ... + 'showFeedback', 0.5, ... 'interTrialInterval', 1.0, ... 'preDots', [0.1 0.3 0.6], ... 'dotsTimeout', 5.0, ... @@ -177,17 +177,16 @@ ... ... Correct 'Correct', struct( ... - 'text', {{'Correct', 'y', 6}}, ... - 'images', {{'thumbsUp.jpg', 'y', -6}}, ... + 'text', 'Correct', ... ...%'playable', 'cashRegister.wav', ... - 'bgStart', [0 0.6 0], ... + 'bgStart', [0 0.25 0], ... 'bgEnd', [0 0 0]), ... ... ... Error 'Error', struct( ... 'text', 'Error', ... ...%'playable', 'buzzer.wav', ... - 'bgStart', [0.6 0 0], ... + 'bgStart', [0.25 0 0], ... 'bgEnd', [0 0 0]), ... ... ... No choice From c80ca5f423db83d07210cbaa53367b4ae32371d5 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 5 Nov 2019 13:17:06 -0500 Subject: [PATCH 50/78] prepare test run with S10 --- modularTasks/tasks/AdrianTests/singlecp.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 6b050a5..ede5761 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -101,10 +101,10 @@ function add_training_block(tid, name, condstop) %-------------------------- ADD TRAINING BLOCKS TO TOPNODE -num_training_blocks=8; +num_training_blocks=2; stop_conditions = {... - 7, 7, 7, 15, 25, 'button', 'button', 'button' ... + 7, 'button' ... }; for jj = 1:num_training_blocks @@ -118,7 +118,7 @@ function add_training_block(tid, name, condstop) if first_block_of_day questTask = topsTreeNodeTaskRTDots('Quest'); questTask.taskID = 99; - questTask.trialIterations = 10; + questTask.trialIterations = 50; questTask.timing.dotsDuration = 0.4; questTask.timing.showFeedback = 0; questTask.pauseBeforeTask = pauseBeforeTask; From a4a646084978dff4b5d294d68884c4670bbf858d Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Tue, 5 Nov 2019 17:26:17 -0500 Subject: [PATCH 51/78] session 1 S11 --- modularTasks/tasks/AdrianTests/singlecp.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index ede5761..8b0fdd8 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -108,7 +108,15 @@ function add_training_block(tid, name, condstop) }; for jj = 1:num_training_blocks - add_training_block(jj, ['training_',num2str(jj)], stop_conditions{jj}) + if jj == 2 + if probCP < .5 + add_training_block(jj, 'training_2_lowprob', stop_conditions{jj}) + else + add_training_block(jj, 'training_2_highprob', stop_conditions{jj}) + end + else + add_training_block(jj, ['training_',num2str(jj)], stop_conditions{jj}) + end end From 6e8fbb1073ebea110755021f1e5b5bf3ed2657e5 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Wed, 6 Nov 2019 11:38:39 -0500 Subject: [PATCH 52/78] randomize trial order in task also set instruction message according to probCP --- modularTasks/tasks/AdrianTests/singlecp.m | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 8b0fdd8..2b648cc 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -162,17 +162,27 @@ function add_training_block(tid, name, condstop) %-------------------------- ADD TASK BLOCKS (4 by default) + + +ttt = topsTreeNodeTaskReversingDots4AFC('TASK'); +ttt.timing.showFeedback = 0; +ttt.taskID = 100; + if probCP < 0.5 task_file = 'Block1.csv'; + ttt.message.message.Instructions.text = {... + {'REAL TASK', 'RARE SWITCHES'} ... + }; else task_file = 'Block0.csv'; + ttt.message.message.Instructions.text = {... + {'REAL TASK', 'FREQUENT SWITCHES'} ... + }; end -ttt = topsTreeNodeTaskReversingDots4AFC('TASK'); -ttt.timing.showFeedback = 0; -ttt.taskID = 100; ttt.independentVariables=task_file; -ttt.trialIterationMethod='sequential'; +% ttt.trialIterationMethod='sequential'; +ttt.randomizeWhenRepeating = false; ttt.pauseBeforeTask = pauseBeforeTask; ttt.stopCondition = 'button'; @@ -181,10 +191,6 @@ function add_training_block(tid, name, condstop) ttt.date = str2double(regexprep(timestamp,'_','')); ttt.probCP = probCP; -ttt.message.message.Instructions.text = {... - {'REAL TASK', 'RARE SWITCHES'} ... - }; - % set theshold coherence obtained from Quest if ~first_block_of_day threshold = questTask.getQuestThreshold(); From 155899d769f80de2bea6c757a2edc1e188ec3528 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Wed, 6 Nov 2019 12:39:12 -0500 Subject: [PATCH 53/78] lengthen training_1.csv --- .../AdrianTests/trials_pre_expt/training_1.csv | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modularTasks/tasks/AdrianTests/trials_pre_expt/training_1.csv b/modularTasks/tasks/AdrianTests/trials_pre_expt/training_1.csv index af62e93..7f79a5f 100644 --- a/modularTasks/tasks/AdrianTests/trials_pre_expt/training_1.csv +++ b/modularTasks/tasks/AdrianTests/trials_pre_expt/training_1.csv @@ -15,3 +15,19 @@ direction,coherence,reversal,duration,finalDuration 0,100,0.2,.4,NaN 0,100,0.2,.4,NaN 0,100,0.2,.4,NaN +180,100,0,.4,NaN +180,100,0,.4,NaN +180,100,0,.4,NaN +180,100,0,.4,NaN +180,100,0.2,.4,NaN +180,100,0.2,.4,NaN +180,100,0.2,.4,NaN +180,100,0.2,.4,NaN +0,100,0,.4,NaN +0,100,0,.4,NaN +0,100,0,.4,NaN +0,100,0,.4,NaN +0,100,0.2,.4,NaN +0,100,0.2,.4,NaN +0,100,0.2,.4,NaN +0,100,0.2,.4,NaN From df668d216c90892124d402f83df4eb90be75f134 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Thu, 7 Nov 2019 11:30:58 -0500 Subject: [PATCH 54/78] I tried a quick fix for the gamepad eventDefinitions bug For some reason, the first ID returned by the gamepad upon pressing the A button was 10 instead of 3. Therefore, I force the ID to be 3 whenever 10 is returned (see dotsReadable.m) Hopefully this fixes it... --- snow-dots/classes/readable/dotsReadable.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/snow-dots/classes/readable/dotsReadable.m b/snow-dots/classes/readable/dotsReadable.m index 1688b1c..112aca6 100755 --- a/snow-dots/classes/readable/dotsReadable.m +++ b/snow-dots/classes/readable/dotsReadable.m @@ -784,7 +784,13 @@ function setEventsActiveFlag(self, activateList, deactivateList) %> look up the event name for convenience data = self.history(historyIndex, :); ID = data(1); + if ID > length(self.eventDefinitions) + if strcmp(acceptedEvents, 'holdFixation') + ID = 3; + end + end name = self.eventDefinitions(ID).name; + % check release flag if self.eventDefinitions(ID).isRelease && ... From 67fd605250b4a8b71b65041f69cb473dc594c647 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Mon, 11 Nov 2019 11:45:14 -0500 Subject: [PATCH 55/78] add function to compute extra pay rate --- modularTasks/tasks/AdrianTests/payrate.m | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 modularTasks/tasks/AdrianTests/payrate.m diff --git a/modularTasks/tasks/AdrianTests/payrate.m b/modularTasks/tasks/AdrianTests/payrate.m new file mode 100644 index 0000000..6e2c5e7 --- /dev/null +++ b/modularTasks/tasks/AdrianTests/payrate.m @@ -0,0 +1,24 @@ +function payrate(timestamp) +% compute extra pay for subject +% ARGS: +% timestamp - string like '2019_11_06_12_43' + +% max_rate - integer. maximum rate a subject can get. E.g. 10 $/hour +max_rate=10; + +% th_perf - percent correct above which max pay rate is reached. +% Between 0 and 1 +th_perf=0.75; + +pre= 'completed4AFCtrials_task100_date_'; +post='.csv'; +filename = which([pre, timestamp, post]); +t1=readtable(filename); +coh1 = t1(t1.coherence==100,:); +refdim = size(coh1); +dims=size(coh1(coh1.dirCorrect & coh1.cpCorrect, :)); +perf = dims(1) / refdim(1); +%th_perf = .75; +payrate = min(perf/th_perf, 1); % dollars per hour +disp(['additional payrate: ', num2str( ceil(payrate * max_rate)), '$/hour']) +end \ No newline at end of file From 89dd2b19505655989841b567577e7e077f553ba5 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Wed, 13 Nov 2019 09:53:44 -0500 Subject: [PATCH 56/78] Extend Quest block to 120 trials --- modularTasks/tasks/AdrianTests/singlecp.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 2b648cc..b949ef9 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -126,7 +126,7 @@ function add_training_block(tid, name, condstop) if first_block_of_day questTask = topsTreeNodeTaskRTDots('Quest'); questTask.taskID = 99; - questTask.trialIterations = 50; + questTask.trialIterations = 60; questTask.timing.dotsDuration = 0.4; questTask.timing.showFeedback = 0; questTask.pauseBeforeTask = pauseBeforeTask; From aa02c70dce08d13be6504323fdd2890460251339 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Mon, 25 Nov 2019 15:42:49 -0500 Subject: [PATCH 57/78] fix reproducibility bug in dots --- snow-dots/classes/drawable/dotsDrawableDotKinetogram.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m index a2849eb..42f9b77 100755 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m @@ -210,7 +210,8 @@ function computeNextFrame(self) if self.coherenceSTD==0 cohCoinToss = 100*self.thisRandStream.rand(1, nFrameDots) < self.coherence; else - coh = normrnd(self.coherence, self.coherenceSTD); +% coh = normrnd(self.coherence, self.coherenceSTD); + coh = self.coherence + self.coherenceSTD .* self.thisRandStream.randn(); if coh < 0 if self.flipDir degreeOffset = 180; From 4c73138421cffd62b03fa52260b8d83aa6bcd531 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Mon, 25 Nov 2019 16:32:31 -0500 Subject: [PATCH 58/78] reproduce_dots() crashes --- .../drawable/dotsDrawableDotKinetogramDebug.m | 98 ++++++++++++++++++- 1 file changed, 94 insertions(+), 4 deletions(-) diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m index 6f4e5c7..681d5e4 100644 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m @@ -99,8 +99,12 @@ dotsPositions = []; % Flag controlling whether to record dots positions or not - % Note, this doesn't record any time stamp. + % Note, this doesn't record any time stamp. recordDotsPositions = false; + + reversal = 0; % theoretical CP time + duration = 0; % theoretical duration of stimulus (sec) + finalDuration = 0; % precise duration of last epoch end properties (SetAccess = protected) @@ -143,10 +147,24 @@ end methods - % Constructor takes no arguments. - function self = dotsDrawableDotKinetogramDebug() + function self = dotsDrawableDotKinetogramDebug(dots_params) self = self@dotsDrawableVertices(); - + fields = fieldnames(dots_params); + num_fields = length(fields); + disp('====== constructor dotsDrawableDotKinetogramDebug') + for ix = 1:num_fields + f = fields{ix}; + if strcmp(f, 'randSeedBase') + newf = 'randBase'; + else + newf = f; + end + + disp(['setting property ', newf]) + + self.(newf) = dots_params.(f); + end + disp('----- done') % draw as points self.primitive = 0; end @@ -222,6 +240,78 @@ function prepareToDrawInWindow(self) end end + + % Compute some parameters and create a circular aperture texture. + function prepare_to_virtually_draw(self, frameRate) + disp('ENTERING prepare_to_virtually_draw') + % Get the frame rate -- rounding to nearest 10 to avoid + % problems with keeping track of random positions when there + % are slight differences in frame rate + + %frameRate = 10*round(screen.windowFrameRate/10); + + % Check for random number seed + if isnan(self.randBase) + % no seed given, use the clock + self.thisRandStream = RandStream('mt19937ar', ... + 'Seed', round(sum(clock*10))); + disp(' somehow self.randBase is NaN') + else + % use the given seed + initseed=abs(round(self.randBase + self.coherence + 100*self.direction(1) + 50000)); + fprintf(' initial seed line171: %d\n', initseed) + self.thisRandStream = RandStream('mt19937ar', ... + 'Seed', initseed); + end + + % gross accounting for the underlying dot field + self.fieldWidth = self.diameter*self.fieldScale; + self.nDots = ceil(self.density * self.fieldWidth^2 / frameRate); + self.frameSelector = false(1, self.nDots); + self.dotLifetimes = zeros(1, self.nDots); + + % treat speed as step-per-interleaved-frame + self.deltaR = self.speed / self.fieldWidth ... + * (self.interleaving / frameRate); + + % draw into an OpenGL stencil to make the circular aperture + mglStencilCreateBegin(self.stencilNumber); + sizeStencil = self.diameter*[1 1]; + mglFillOval(self.xCenter, self.yCenter, sizeStencil); + mglStencilCreateEnd(); + mglClearScreen(); + + % build a lookup table to pick weighted directions + % based on a uniform random variable. + if ~isequal( ... + numel(self.directionWeights), numel(self.direction)) + self.directionWeights = ones(1, length(self.direction)); + end + + directionCDF = cumsum(self.directionWeights) ... + / sum(self.directionWeights); + self.directionCDFInverse = ones(1, self.directionCDFSize); + probs = linspace(0, 1, self.directionCDFSize); + for ii = 1:self.directionCDFSize + nearest = find(directionCDF >= probs(ii), 1, 'first'); + self.directionCDFInverse(ii) = self.direction(nearest); + end + + % pick random start positions for all dots + self.normalizedXY = self.thisRandStream.rand(2, self.nDots); + % fprintf(' start positions: %0.6f\n', self.normalizedXY) + fprintf(' position %d: %0.6f\n', length(self.normalizedXY), self.normalizedXY(end)) + + % Re-set the frame number to 0 + self.frameNumber = 0; + + % pre-allocate size of first 2 dimensions of dotsPositions + % the third dimension is unknown (I believe) + if self.recordDotsPositions + self.dotsPositions = zeros(4,self.nDots,0); + end + end + % Compute dot positions for the next frame of animation. function computeNextFrame(self) From 3e60f4d78b7456b3d7d49fa263676528e04f8b86 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Mon, 25 Nov 2019 16:49:02 -0500 Subject: [PATCH 59/78] reproduce_dots() does not crash anymore --- .../classes/drawable/dotsDrawableDotKinetogramDebug.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m index 681d5e4..7ed0299 100644 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m @@ -275,11 +275,11 @@ function prepare_to_virtually_draw(self, frameRate) * (self.interleaving / frameRate); % draw into an OpenGL stencil to make the circular aperture - mglStencilCreateBegin(self.stencilNumber); +% mglStencilCreateBegin(self.stencilNumber); sizeStencil = self.diameter*[1 1]; - mglFillOval(self.xCenter, self.yCenter, sizeStencil); - mglStencilCreateEnd(); - mglClearScreen(); +% mglFillOval(self.xCenter, self.yCenter, sizeStencil); +% mglStencilCreateEnd(); +% mglClearScreen(); % build a lookup table to pick weighted directions % based on a uniform random variable. From 3b2ae870443f1798035449686a5af3f268fc11d9 Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Mon, 25 Nov 2019 17:04:13 -0500 Subject: [PATCH 60/78] add finalCPTime property --- snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m | 1 + 1 file changed, 1 insertion(+) diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m index 7ed0299..48d8c5c 100644 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m @@ -105,6 +105,7 @@ reversal = 0; % theoretical CP time duration = 0; % theoretical duration of stimulus (sec) finalDuration = 0; % precise duration of last epoch + finalCPTime = 0; % real flip time end properties (SetAccess = protected) From 33565baf4e2e18263f43e0cfa245f6df4cc6e8dd Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Fri, 29 Nov 2019 10:09:38 -0500 Subject: [PATCH 61/78] comment out console prints in dotsDrawableDotKinetogramDebug --- .../drawable/dotsDrawableDotKinetogramDebug.m | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m index 48d8c5c..6d7ff4f 100644 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m @@ -152,7 +152,7 @@ self = self@dotsDrawableVertices(); fields = fieldnames(dots_params); num_fields = length(fields); - disp('====== constructor dotsDrawableDotKinetogramDebug') + %disp('====== constructor dotsDrawableDotKinetogramDebug') for ix = 1:num_fields f = fields{ix}; if strcmp(f, 'randSeedBase') @@ -161,18 +161,18 @@ newf = f; end - disp(['setting property ', newf]) + %disp(['setting property ', newf]) self.(newf) = dots_params.(f); end - disp('----- done') + %disp('----- done') % draw as points self.primitive = 0; end % Compute some parameters and create a circular aperture texture. function prepareToDrawInWindow(self) - disp('ENTERING prepareToDrawInWindow ') + %disp('ENTERING prepareToDrawInWindow ') % Get the frame rate -- rounding to nearest 10 to avoid % problems with keeping track of random positions when there % are slight differences in frame rate @@ -184,11 +184,11 @@ function prepareToDrawInWindow(self) % no seed given, use the clock self.thisRandStream = RandStream('mt19937ar', ... 'Seed', round(sum(clock*10))); - disp(' somehow self.randBase is NaN') + %disp(' somehow self.randBase is NaN') else % use the given seed initseed=abs(round(self.randBase + self.coherence + 100*self.direction(1) + 50000)); - fprintf(' initial seed line171: %d\n', initseed) + %fprintf(' initial seed line171: %d\n', initseed) self.thisRandStream = RandStream('mt19937ar', ... 'Seed', initseed); end @@ -229,7 +229,7 @@ function prepareToDrawInWindow(self) % pick random start positions for all dots self.normalizedXY = self.thisRandStream.rand(2, self.nDots); % fprintf(' start positions: %0.6f\n', self.normalizedXY) - fprintf(' position %d: %0.6f\n', length(self.normalizedXY), self.normalizedXY(end)) + %fprintf(' position %d: %0.6f\n', length(self.normalizedXY), self.normalizedXY(end)) % Re-set the frame number to 0 self.frameNumber = 0; @@ -244,7 +244,7 @@ function prepareToDrawInWindow(self) % Compute some parameters and create a circular aperture texture. function prepare_to_virtually_draw(self, frameRate) - disp('ENTERING prepare_to_virtually_draw') + %disp('ENTERING prepare_to_virtually_draw') % Get the frame rate -- rounding to nearest 10 to avoid % problems with keeping track of random positions when there % are slight differences in frame rate @@ -256,11 +256,11 @@ function prepare_to_virtually_draw(self, frameRate) % no seed given, use the clock self.thisRandStream = RandStream('mt19937ar', ... 'Seed', round(sum(clock*10))); - disp(' somehow self.randBase is NaN') + %disp(' somehow self.randBase is NaN') else % use the given seed initseed=abs(round(self.randBase + self.coherence + 100*self.direction(1) + 50000)); - fprintf(' initial seed line171: %d\n', initseed) + %fprintf(' initial seed line171: %d\n', initseed) self.thisRandStream = RandStream('mt19937ar', ... 'Seed', initseed); end @@ -301,7 +301,7 @@ function prepare_to_virtually_draw(self, frameRate) % pick random start positions for all dots self.normalizedXY = self.thisRandStream.rand(2, self.nDots); % fprintf(' start positions: %0.6f\n', self.normalizedXY) - fprintf(' position %d: %0.6f\n', length(self.normalizedXY), self.normalizedXY(end)) + %fprintf(' position %d: %0.6f\n', length(self.normalizedXY), self.normalizedXY(end)) % Re-set the frame number to 0 self.frameNumber = 0; @@ -445,7 +445,7 @@ function computeNextFrame(self) self.x = (XY(1, thisFrame)-0.5)*self.fieldWidth + self.xCenter; self.y = (XY(2, thisFrame)-0.5)*self.fieldWidth + self.yCenter; - disp([self.x(end) self.y(end)]) + %disp([self.x(end) self.y(end)]) % fill out dotsPositions if self.recordDotsPositions self.dotsPositions(:,:,end+1) = [... From 7be90ea3f6268f6ef17d942379e3b56827423279 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Wed, 11 Dec 2019 10:47:34 -0500 Subject: [PATCH 62/78] render randSeedBase unique to every trial --- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 4 ++-- snow-dots/classes/drawable/dotsDrawableDotKinetogram.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 656e43d..37c863e 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -29,7 +29,7 @@ 'useQuest', [], ... 'valsFromQuest', [], ... % % cor vals on pmf to get 'targetDistance', 8, ... - 'dotsSeedBase', randi(9999), ... + 'dotsSeedBase', 1, ... 'reversalSet', [0.3 0.6 0.9], ... % if reversal<-1 'reversalType', 'time'); % 'time' or 'hazard'; see prepareDrawables @@ -538,7 +538,7 @@ function prepareDrawables(self) end % Set the seed base for the random number generator - trial.randSeedBase = self.settings.dotsSeedBase; + trial.randSeedBase = sum(clock*10); % Set the dots duration if not already given in trial struct if ~isfinite(trial.duration) diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m index 42f9b77..a797b97 100755 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m @@ -147,7 +147,7 @@ function prepareToDrawInWindow(self) else % use the given seed self.thisRandStream = RandStream('mt19937ar', ... - 'Seed', abs(round(self.randBase + self.coherence + 100*self.direction(1) + 50000))); + 'Seed', abs(round(self.randBase))); end % gross accounting for the underlying dot field From 23e74c3648c16fae5f47052f0b53c8211a17fb3e Mon Sep 17 00:00:00 2001 From: Adrian Ernesto Radillo Date: Thu, 12 Dec 2019 10:16:42 -0500 Subject: [PATCH 63/78] fix seed in dotsDrawableDotKinetogramDebug The goal is to match the seeding here with the one in dotsDrawableDotKinetogram used during the task --- snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m index 6d7ff4f..54df742 100644 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m @@ -187,7 +187,7 @@ function prepareToDrawInWindow(self) %disp(' somehow self.randBase is NaN') else % use the given seed - initseed=abs(round(self.randBase + self.coherence + 100*self.direction(1) + 50000)); + initseed=abs(round(self.randBase)); %fprintf(' initial seed line171: %d\n', initseed) self.thisRandStream = RandStream('mt19937ar', ... 'Seed', initseed); From 93fdc461590a16637e34dce95e5067772b3d4f2b Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Fri, 13 Dec 2019 13:32:25 -0500 Subject: [PATCH 64/78] set flipDir to true by default --- snow-dots/classes/drawable/dotsDrawableDotKinetogram.m | 2 +- snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m index a797b97..f378866 100755 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m @@ -21,7 +21,7 @@ coherenceSTD = 0; % if flip when random coherence < 0 - flipDir = false; + flipDir = true; % density of dots in the kinetogram (dots per degree-visual-angle^2 % per second) diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m index 54df742..1733af7 100644 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m @@ -21,7 +21,7 @@ coherenceSTD = 0; % if flip when random coherence < 0 - flipDir = false; + flipDir = true; % density of dots in the kinetogram (dots per degree-visual-angle^2 % per second) From ecd459dcb218b19e4e7b95dbce9bd5636f9fe3fd Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Wed, 18 Dec 2019 12:06:31 -0500 Subject: [PATCH 65/78] store more timestamps from dots in task + dDDK --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 40 +++++++++++++++++- .../drawable/dotsDrawableDotKinetogram.m | 42 +++++++++++++++++++ 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 37c863e..bcf0127 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -89,7 +89,13 @@ 'date', ... 'probCP', ... 'cpScreenOn', ... - 'dummyBlank'}; + 'dummyBlank', ... + 'cpTimeDotsClock', ... + 'firstDraw', ... + 'lastDraw', ... + 'firstDrawPostCP', ... + 'numberDrawPreCP', ... + 'numberDrawPostCP'}; % Drawables settings drawable = struct( ... @@ -333,6 +339,30 @@ function finishTrial(self) trial = self.getTrial(); dcorr = trial.dirCorrect; ccorr = trial.cpCorrect; + + % fetch important properties from the dotsDrawableDotKinetogram + % in order to be able to reproduce the dots at a later stage + dDDK = self.helpers.stimulusEnsemble.theObject; + trial.firstDraw = dDDK.getObjectProperty( ... + 'firstDraw', ... + self.dotsIndex); + trial.firstDrawPostCP = dDDK.getObjectProperty( ... + 'firstDrawPostCP', ... + self.dotsIndex); + trial.lastDraw = dDDK.getObjectProperty( ... + 'lastDraw', ... + self.dotsIndex); + trial.numberDrawPreCP = dDDK.getObjectProperty( ... + 'numberDrawPreCP', ... + self.dotsIndex); + trial.numberDrawPostCP = dDDK.getObjectProperty( ... + 'numberDrawPostCP', ... + self.dotsIndex); + trial.cpTimeDotsClock = dDDK.getObjectProperty( ... + 'cpTimeDotsClock', ... + self.dotsIndex); + self.setTrial(trial); + if ~isnan(ccorr) && ~isnan(dcorr) if dcorr && ccorr self.consecutiveCorrect = self.consecutiveCorrect + 1; @@ -373,6 +403,10 @@ function finishTrial(self) eh.theObject.setObjectProperty('direction', ... self.reversals.directions(self.nextReversal), ... self.dotsIndex); + eh.theObject.setObjectProperty('passedCP', true, ... + self.dotsIndex); + eh.theObject.setObjectProperty('cpTimeDotsClock', ... + clock, self.dotsIndex); % Explicitly flip here so we can get the timestamp frameInfo = eh.theObject.callObjectMethod(... @@ -605,8 +639,10 @@ function prepareDrawables(self) self.nextReversal = 2; startDirection = ... self.reversals.directions(1); + % note how trial.direction represents the direction of + % motion in the last epoch of the trial trial.direction = ... - self.reversals.directions(end); + self.reversals.directions(end); end end diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m index f378866..26c1b42 100755 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m @@ -79,6 +79,27 @@ % and direction (assuming all other properties are constant). % Seed is computed as randBase+coherence+100*direction; randBase = sum(clock*10); + + % timestamp for CP time + cpTimeDotsClock = nan; + + % timestamp of first call to draw + firstDraw = nan; + + % timestamp of first call to draw after direction has been swapped + firstDrawPostCP = nan; + + % timestamp of last call to draw + lastDraw = nan; + + % number of calls to draw before CP + numberDrawPreCP = 0; + + % number of calls to draw after CP + numberDrawPostCP = 0; + + % bool: whether CP has been passed or not + passedCP = false; end properties (SetAccess = protected) @@ -319,6 +340,27 @@ function draw(self) self.computeNextFrame; mglStencilSelect(self.stencilNumber); self.draw@dotsDrawableVertices; + + % the whole if block below stores timestamps used to reproduce + % dots later + if self.passedCP + if isnan(self.firstDrawPostCP) + self.firstDrawPostCP = clock; + self.lastDraw = self.firstDrawPostCP; + else + self.lastDraw = clock; + end + self.numberDrawPostCP = self.numberDrawPostCP + 1; + else + if isnan(self.firstDraw) + self.firstDraw = clock; + self.lastDraw = self.firstDraw; + else + self.lastDraw = clock; + end + self.numberDrawPreCP = self.numberDrawPreCP + 1; + end + mglStencilSelect(0); end end From 746a5b12818592be8bec934c35a19a724201bcd2 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Wed, 18 Dec 2019 12:20:36 -0500 Subject: [PATCH 66/78] prepare for test run dDDK --- modularTasks/tasks/AdrianTests/singlecp.m | 4 ++-- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index b949ef9..889683f 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -13,14 +13,14 @@ function singlecp(subject_code, probCP) %-------------------------- DEFAULT ARGS dump_folder = '/Users/joshuagold/Documents/MATLAB/projects/Lab_Matlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/trials_post_expt/'; -first_block_of_day = true; % if true, Quest block is added +first_block_of_day = false; % if true, Quest block is added % the following variable should hold the full path to a topsDataLog.mat % file where a valid Quest block was run. This is when one wants to skip % the Quest block presently, and thus use the threshold estimated from a % prior Quest block. -quest_task_topsDataLog = '';%'/Users/joshuagold/Users/Adrian/oneCP/raw/2019_10_08_17_17/2019_10_08_17_17_topsDataLog.mat'; % made up +quest_task_topsDataLog = '/Users/joshuagold/Users/Adrian/oneCP/raw/2019_12_13_13_37/2019_12_13_13_37_topsDataLog.mat'; %-------------------------- DOTS STIMULUS PROPERTIES diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index bcf0127..3b86fa8 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -572,7 +572,7 @@ function prepareDrawables(self) end % Set the seed base for the random number generator - trial.randSeedBase = sum(clock*10); + trial.randSeedBase = trial.trialIndex; %sum(clock*10); % Set the dots duration if not already given in trial struct if ~isfinite(trial.duration) From c9bdbe95d117550193a20c1cff40bee1b1a341ac Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Wed, 18 Dec 2019 13:37:40 -0500 Subject: [PATCH 67/78] use now instead of clock --- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 2 +- snow-dots/classes/drawable/dotsDrawableDotKinetogram.m | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 3b86fa8..7aa88d3 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -406,7 +406,7 @@ function finishTrial(self) eh.theObject.setObjectProperty('passedCP', true, ... self.dotsIndex); eh.theObject.setObjectProperty('cpTimeDotsClock', ... - clock, self.dotsIndex); + now, self.dotsIndex); % Explicitly flip here so we can get the timestamp frameInfo = eh.theObject.callObjectMethod(... diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m index 26c1b42..1d77620 100755 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogram.m @@ -345,18 +345,18 @@ function draw(self) % dots later if self.passedCP if isnan(self.firstDrawPostCP) - self.firstDrawPostCP = clock; + self.firstDrawPostCP = now; self.lastDraw = self.firstDrawPostCP; else - self.lastDraw = clock; + self.lastDraw = now; end self.numberDrawPostCP = self.numberDrawPostCP + 1; else if isnan(self.firstDraw) - self.firstDraw = clock; + self.firstDraw = now; self.lastDraw = self.firstDraw; else - self.lastDraw = clock; + self.lastDraw = now; end self.numberDrawPreCP = self.numberDrawPreCP + 1; end From 87dca8352d05c8d1bf4778173b5480a8f140e922 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Wed, 18 Dec 2019 13:57:42 -0500 Subject: [PATCH 68/78] reset dDDK counters at trialStart --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 7aa88d3..d2ecfdf 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -680,6 +680,20 @@ function prepareDrawables(self) ensemble.setObjectProperty('direction', startDirection, ... self.dotsIndex); + % reset the timestamps and draw counters for current trial + ensemble.setObjectProperty('firstDraw', nan, self.dotsIndex); + ensemble.setObjectProperty('firstDrawPostCP', nan, ... + self.dotsIndex); + ensemble.setObjectProperty('lastDraw', nan, self.dotsIndex); + ensemble.setObjectProperty('numberDrawPreCP', 0, ... + self.dotsIndex); + ensemble.setObjectProperty('numberDrawPostCP', 0, ... + self.dotsIndex); + ensemble.setObjectProperty('cpTimeDotsClock', nan, ... + self.dotsIndex); + ensemble.setObjectProperty('passedCP', false, self.dotsIndex); + + self.setTrial(trial); % ---- Set CP screen instructions % From ecf81f755ed1714921bc861c69ab7a7dafaf8a88 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Wed, 18 Dec 2019 13:59:50 -0500 Subject: [PATCH 69/78] enforce sequential trial order for test --- modularTasks/tasks/AdrianTests/singlecp.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 889683f..f5fb74f 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -181,7 +181,7 @@ function add_training_block(tid, name, condstop) end ttt.independentVariables=task_file; -% ttt.trialIterationMethod='sequential'; +ttt.trialIterationMethod='sequential'; ttt.randomizeWhenRepeating = false; ttt.pauseBeforeTask = pauseBeforeTask; ttt.stopCondition = 'button'; From 61c6864bd0a0a44066a7cf472354fba0457d4711 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Wed, 18 Dec 2019 17:03:23 -0500 Subject: [PATCH 70/78] re-run test with dDDKDebug --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 2 +- .../drawable/dotsDrawableDotKinetogramDebug.m | 42 +++++++++++++++++++ .../sdotsDrawableDotKinetogramDebug.m | 4 ++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 snow-dots/classes/drawable/sdotsDrawableDotKinetogramDebug.m diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index d2ecfdf..729269a 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -124,7 +124,7 @@ ... ... % Dots drawable settings 'dots', struct( ... - 'fevalable', @dotsDrawableDotKinetogram, ... + 'fevalable', @sdotsDrawableDotKinetogramDebug, ... 'settings', struct( ... 'xCenter', 0, ... 'yCenter', 0, ... diff --git a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m index 1733af7..dd1c3b7 100644 --- a/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m +++ b/snow-dots/classes/drawable/dotsDrawableDotKinetogramDebug.m @@ -80,6 +80,27 @@ % Seed is computed as randBase+coherence+100*direction; randBase = sum(clock*10); + % timestamp for CP time + cpTimeDotsClock = nan; + + % timestamp of first call to draw + firstDraw = nan; + + % timestamp of first call to draw after direction has been swapped + firstDrawPostCP = nan; + + % timestamp of last call to draw + lastDraw = nan; + + % number of calls to draw before CP + numberDrawPreCP = 0; + + % number of calls to draw after CP + numberDrawPostCP = 0; + + % bool: whether CP has been passed or not + passedCP = false; + % dot positions, active and coherence states, all gathered in a % single x-by-y-by-z 3D-matrix. % @@ -461,6 +482,27 @@ function draw(self) self.computeNextFrame; mglStencilSelect(self.stencilNumber); self.draw@dotsDrawableVertices; + + % the whole if block below stores timestamps used to reproduce + % dots later + if self.passedCP + if isnan(self.firstDrawPostCP) + self.firstDrawPostCP = now; + self.lastDraw = self.firstDrawPostCP; + else + self.lastDraw = now; + end + self.numberDrawPostCP = self.numberDrawPostCP + 1; + else + if isnan(self.firstDraw) + self.firstDraw = now; + self.lastDraw = self.firstDraw; + else + self.lastDraw = now; + end + self.numberDrawPreCP = self.numberDrawPreCP + 1; + end + mglStencilSelect(0); end end diff --git a/snow-dots/classes/drawable/sdotsDrawableDotKinetogramDebug.m b/snow-dots/classes/drawable/sdotsDrawableDotKinetogramDebug.m new file mode 100644 index 0000000..8549e1d --- /dev/null +++ b/snow-dots/classes/drawable/sdotsDrawableDotKinetogramDebug.m @@ -0,0 +1,4 @@ +function s=sdotsDrawableDotKinetogramDebug() + s=dotsDrawableDotKinetogramDebug(struct()); +end + From 032f71429bb1dcb32c14410c75ba5357d1121cc5 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Thu, 19 Dec 2019 10:06:09 -0500 Subject: [PATCH 71/78] re-run test second time with dDDK --- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 729269a..d2ecfdf 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -124,7 +124,7 @@ ... ... % Dots drawable settings 'dots', struct( ... - 'fevalable', @sdotsDrawableDotKinetogramDebug, ... + 'fevalable', @dotsDrawableDotKinetogram, ... 'settings', struct( ... 'xCenter', 0, ... 'yCenter', 0, ... From 20aa8a46bfc9df9f917f41e9f4c1278e3eea3bbd Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Mon, 30 Dec 2019 13:26:52 -0500 Subject: [PATCH 72/78] Revert "re-run test second time with dDDK" This reverts commit 032f71429bb1dcb32c14410c75ba5357d1121cc5. --- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index d2ecfdf..729269a 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -124,7 +124,7 @@ ... ... % Dots drawable settings 'dots', struct( ... - 'fevalable', @dotsDrawableDotKinetogram, ... + 'fevalable', @sdotsDrawableDotKinetogramDebug, ... 'settings', struct( ... 'xCenter', 0, ... 'yCenter', 0, ... From 29aaee97ff8dd3cbf5e3aa2459f946c4806dae3f Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Mon, 30 Dec 2019 13:44:39 -0500 Subject: [PATCH 73/78] preparing for another dots reproducibility test dDDKDebug The issue with the previous dDDKDebug reproducibility tests was that I was not saving the dotsPositions as a property in the task object. Hopefully, with the present modifications to topsTreeNodeTaskReversingDots4AFC.m things will work... --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index 729269a..f75c19d 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -30,6 +30,7 @@ 'valsFromQuest', [], ... % % cor vals on pmf to get 'targetDistance', 8, ... 'dotsSeedBase', 1, ... + 'recordDotsPositions', true, ... 'reversalSet', [0.3 0.6 0.9], ... % if reversal<-1 'reversalType', 'time'); % 'time' or 'hazard'; see prepareDrawables @@ -97,6 +98,23 @@ 'numberDrawPreCP', ... 'numberDrawPostCP'}; + % empty struct that will later be filled, only if + % self.settings.recordDotsPositions is true. + %%%%%%%%%%%%%%%%%%%%%%%% + % Description of fields: + % dotsPositions is a 1-by-JJ cell, where JJ is the number of + % trials run in the experiment. Each entry of the + % cell will contain matrix equal to + % dotsDrawableDotKinetogram.dotsPositions + % dumpTime is a cell array of times, each computed as + % feval(self.clockFunction). + % The times are computed by the dumpDots() method, + % once at the end of every trial. They should be + % compared to the 'trialStart' time stamp in order + % to assign a sequence of dots frames to a + % particular trial. + dotsInfo = struct('dotsPositions', [], 'dumpTime', []); + % Drawables settings drawable = struct( ... ... @@ -133,6 +151,7 @@ 'pixelSize', 6, ... 'diameter', 8, ... 'density', 150, ... + 'recordDotsPositions', true, ... 'speed', 5)), ... ... % CP Targets drawable settings 'cpScreen', struct( ... @@ -335,6 +354,25 @@ function startTrial(self) % % Could add stuff here function finishTrial(self) + %% dump dots positions and states + % by state I mean whether each dot is active or not on a particular + % frame, and whether it is coherent or not, on a particular frame + if self.settings.recordDotsPositions + + % Pre-allocate cells + if isempty(self.dotsInfo.dotsPositions) + self.dotsInfo.dotsPositions = cell(1, length(self.trialIndices)); + self.dotsInfo.dumpTime = nans(1, length(self.trialIndices)); + end + + % Save the info + self.dotsInfo.dotsPositions{self.trialCount} = ... + self.helpers.stimulusEnsemble.theObject.getObjectProperty(... + 'dotsPositions', self.dotsIndex); + self.dotsInfo.dumpTime(self.trialCount) = feval(self.clockFunction); + end + + % update running count of consecutive correct trials trial = self.getTrial(); dcorr = trial.dirCorrect; From 7df832078e9325c90c99f36b4d886fc83e89e8d4 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Thu, 2 Jan 2020 10:57:10 -0500 Subject: [PATCH 74/78] cleanup --- .gitignore | 8 + .../trials_pre_expt/training_2_highprob.csv | 821 ++++++++++++++++++ .../trials_pre_expt/training_2_lowprob.csv | 821 ++++++++++++++++++ .../cpTime_with_dotsClock.txt | 34 + .../testing/dotsReproducibilityTest/ddk2.txt | 45 + .../dotsReproducibilityTest/ddk_vs_ddkd.txt | 46 + .../frameRateSecondEpoch.txt | 23 + .../dotsReproducibilityTest/framerate.txt | 24 + .../dotsReproducibilityTest/trialduration.txt | 62 ++ 9 files changed, 1884 insertions(+) create mode 100755 modularTasks/tasks/AdrianTests/trials_pre_expt/training_2_highprob.csv create mode 100644 modularTasks/tasks/AdrianTests/trials_pre_expt/training_2_lowprob.csv create mode 100644 modularTasks/testing/dotsReproducibilityTest/cpTime_with_dotsClock.txt create mode 100644 modularTasks/testing/dotsReproducibilityTest/ddk2.txt create mode 100644 modularTasks/testing/dotsReproducibilityTest/ddk_vs_ddkd.txt create mode 100644 modularTasks/testing/dotsReproducibilityTest/frameRateSecondEpoch.txt create mode 100644 modularTasks/testing/dotsReproducibilityTest/framerate.txt create mode 100644 modularTasks/testing/dotsReproducibilityTest/trialduration.txt diff --git a/.gitignore b/.gitignore index 5509140..9d30e53 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,9 @@ *.DS_Store +modularTasks/tasks/AdrianTests/trials_post_expt/* +modularTasks/tasks/AdrianTests/trials_pre_expt/training_3.csv +modularTasks/tasks/AdrianTests/trials_pre_expt/training_4.csv +modularTasks/tasks/AdrianTests/trials_pre_expt/training_5.csv +modularTasks/tasks/AdrianTests/trials_pre_expt/training_6.csv +modularTasks/tasks/AdrianTests/trials_pre_expt/training_7.csv +modularTasks/tasks/AdrianTests/trials_pre_expt/training_8.csv +*.png diff --git a/modularTasks/tasks/AdrianTests/trials_pre_expt/training_2_highprob.csv b/modularTasks/tasks/AdrianTests/trials_pre_expt/training_2_highprob.csv new file mode 100755 index 0000000..b3b9eb0 --- /dev/null +++ b/modularTasks/tasks/AdrianTests/trials_pre_expt/training_2_highprob.csv @@ -0,0 +1,821 @@ +direction,coherence,reversal,duration,finalDuration +180,100,0,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0,0.2,NaN +180,100,0,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0,0.4,NaN +180,100,0,0.2,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.6,NaN +0,100,0,0.1,NaN +0,100,0.2,0.4,NaN +0,100,0,0.2,NaN +180,100,0,0.2,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0,0.1,NaN +0,100,0,0.2,NaN +180,100,0.2,0.6,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.6,NaN +0,100,0.2,0.6,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.6,NaN +180,100,0.2,0.4,NaN +0,100,0,0.1,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.6,NaN +0,100,0.2,0.6,NaN +180,100,0,0.2,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0,0.2,NaN +180,100,0.2,0.6,NaN +0,100,0.2,0.6,NaN +0,100,0,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0,0.2,NaN +0,100,0,0.2,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0,0.1,NaN +0,100,0,0.2,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.6,NaN +180,100,0.2,0.25,NaN +0,100,0,0.1,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +0,100,0,0.1,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0,0.1,NaN +0,100,0,0.1,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.6,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0,0.1,NaN +180,100,0.2,0.25,NaN +180,100,0,0.1,NaN +180,100,0,0.1,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0,0.1,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0,0.4,NaN +180,100,0,0.1,NaN +180,100,0.2,0.3,NaN +0,100,0,0.1,NaN +180,100,0.2,0.3,NaN +0,100,0,0.1,NaN +180,100,0,0.1,NaN +180,100,0,0.3,NaN +0,100,0.2,0.6,NaN +0,100,0.2,0.6,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0,0.1,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0,0.1,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.6,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0,0.1,NaN +180,100,0.2,0.25,NaN +180,100,0,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.6,NaN +0,100,0,0.2,NaN +180,100,0.2,0.6,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0,0.6,NaN +180,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0,0.1,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0,0.1,NaN +0,100,0,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.6,NaN +180,100,0,0.3,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.6,NaN +180,100,0,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0,0.1,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0,0.1,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0,0.2,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0,0.1,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +0,100,0,0.2,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0,0.2,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0,0.1,NaN +0,100,0,0.1,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0,0.1,NaN +180,100,0,0.2,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.6,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0,0.2,NaN +180,100,0,0.1,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0,0.2,NaN +0,100,0,0.2,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0,0.4,NaN +180,100,0,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0,0.1,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.2,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0,0.25,NaN +0,100,0.2,0.6,NaN +180,100,0.2,0.4,NaN +0,100,0,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0,0.2,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0,0.3,NaN +180,100,0,0.25,NaN +180,100,0,0.4,NaN +180,100,0,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0,0.2,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0,0.2,NaN +180,100,0,0.1,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +0,100,0,0.1,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.6,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0,0.2,NaN +0,100,0.2,0.3,NaN +180,100,0,0.2,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0,0.25,NaN +180,100,0.2,0.6,NaN +180,100,0,0.1,NaN +0,100,0.2,0.3,NaN +0,100,0,0.25,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0,0.2,NaN +0,100,0,0.25,NaN +0,100,0,0.2,NaN +0,100,0.2,0.6,NaN +180,100,0.2,0.6,NaN +0,100,0,0.2,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0,0.2,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.6,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0,0.2,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.6,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0,0.1,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.6,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0,0.1,NaN +180,100,0.2,0.6,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0,0.2,NaN +180,100,0,0.1,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0,0.4,NaN +180,100,0.2,0.6,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0,0.1,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0,0.1,NaN +180,100,0,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0,0.2,NaN +180,100,0.2,0.4,NaN +180,100,0,0.2,NaN +0,100,0.2,0.6,NaN +0,100,0,0.1,NaN +0,100,0.2,0.3,NaN +0,100,0,0.2,NaN +180,100,0.2,0.25,NaN +180,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.6,NaN +180,100,0,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0,0.25,NaN +180,100,0.2,0.6,NaN +0,100,0.2,0.3,NaN +180,100,0,0.2,NaN +180,100,0.2,0.25,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0,0.25,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0,0.25,NaN +0,100,0,0.2,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0,0.4,NaN +180,100,0,0.2,NaN +0,100,0,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0,0.1,NaN +0,100,0.2,0.4,NaN +180,100,0,0.1,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0,0.1,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.2,NaN +180,100,0,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0,0.2,NaN +180,100,0,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.6,NaN +180,100,0.2,0.4,NaN +180,100,0,0.4,NaN +0,100,0,0.1,NaN +0,100,0.2,0.25,NaN +0,100,0,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0,0.1,NaN +180,100,0,0.1,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0,0.1,NaN +0,100,0.2,0.3,NaN +0,100,0,0.3,NaN +180,100,0.2,0.3,NaN +0,100,0,0.1,NaN +180,100,0,0.1,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0,0.1,NaN +180,100,0,0.2,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0,0.3,NaN +180,100,0,0.1,NaN +0,100,0.2,0.3,NaN +180,100,0,0.2,NaN +0,100,0.2,0.25,NaN +0,100,0,0.2,NaN +0,100,0.2,0.3,NaN +0,100,0,0.2,NaN +180,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +0,100,0,0.1,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0,0.2,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.2,NaN +0,100,0,0.25,NaN +0,100,0,0.2,NaN +180,100,0,0.2,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0,0.1,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.6,NaN +0,100,0.2,0.3,NaN +180,100,0,0.2,NaN +0,100,0.2,0.4,NaN +0,100,0,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0,0.2,NaN +0,100,0,0.4,NaN +180,100,0,0.1,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0,0.1,NaN +180,100,0.2,0.3,NaN +180,100,0,0.1,NaN +0,100,0,0.1,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.3,NaN +180,100,0,0.3,NaN +180,100,0,0.1,NaN +0,100,0,0.1,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0,0.1,NaN +180,100,0.2,0.4,NaN +180,100,0,0.1,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.6,NaN +0,100,0,0.1,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.6,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0,0.1,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0,0.1,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0,0.2,NaN +180,100,0,0.2,NaN +180,100,0,0.2,NaN +180,100,0.2,0.3,NaN +180,100,0,0.1,NaN +0,100,0.2,0.25,NaN +180,100,0,0.4,NaN +180,100,0.2,0.4,NaN +0,100,0,0.2,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0,0.2,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0,0.2,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.6,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0,0.1,NaN +180,100,0,0.1,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0,0.1,NaN +0,100,0.2,0.3,NaN +180,100,0,0.2,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0,0.2,NaN +0,100,0,0.1,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.1,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.1,NaN +180,100,0,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0,0.4,NaN +0,100,0,0.1,NaN +0,100,0.2,0.3,NaN +0,100,0,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0,0.2,NaN +180,100,0.2,0.25,NaN +180,100,0,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0,0.6,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.6,NaN +180,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0,0.1,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0,0.2,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0,0.2,NaN +180,100,0,0.1,NaN +0,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0,0.4,NaN +0,100,0,0.2,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0,0.2,NaN +180,100,0.2,0.25,NaN +180,100,0,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0,0.1,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0,0.25,NaN +0,100,0.2,0.6,NaN +180,100,0,0.2,NaN +180,100,0.2,0.6,NaN +180,100,0.2,0.25,NaN +180,100,0,0.1,NaN +0,100,0.2,0.3,NaN +180,100,0,0.1,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +0,100,0,0.2,NaN +180,100,0.2,0.6,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0,0.2,NaN +0,100,0.2,0.4,NaN +0,100,0,0.1,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0,0.1,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +0,100,0,0.1,NaN +180,100,0,0.1,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0,0.2,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +0,100,0,0.1,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.6,NaN +180,100,0,0.1,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0,0.1,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0,0.2,NaN +0,100,0,0.2,NaN +180,100,0,0.2,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN diff --git a/modularTasks/tasks/AdrianTests/trials_pre_expt/training_2_lowprob.csv b/modularTasks/tasks/AdrianTests/trials_pre_expt/training_2_lowprob.csv new file mode 100644 index 0000000..850bbce --- /dev/null +++ b/modularTasks/tasks/AdrianTests/trials_pre_expt/training_2_lowprob.csv @@ -0,0 +1,821 @@ +direction,coherence,reversal,duration,finalDuration +0,100,0,0.1,NaN +180,100,0.2,0.25,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0,0.4,NaN +0,100,0,0.4,NaN +0,100,0,0.3,NaN +180,100,0,0.3,NaN +0,100,0,0.4,NaN +180,100,0,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0,0.1,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0,0.1,NaN +0,100,0.2,0.25,NaN +180,100,0,0.3,NaN +0,100,0,0.1,NaN +0,100,0,0.25,NaN +0,100,0,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0,0.1,NaN +180,100,0.2,0.6,NaN +180,100,0,0.4,NaN +180,100,0,0.6,NaN +0,100,0,0.2,NaN +180,100,0,0.4,NaN +180,100,0,0.2,NaN +180,100,0,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0,0.2,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0,0.4,NaN +180,100,0,0.4,NaN +0,100,0,0.3,NaN +0,100,0,0.2,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0,0.4,NaN +0,100,0,0.2,NaN +0,100,0.2,0.4,NaN +0,100,0,0.25,NaN +180,100,0,0.3,NaN +0,100,0,0.4,NaN +180,100,0,0.1,NaN +180,100,0,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0,0.25,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0,0.6,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0,0.1,NaN +180,100,0,0.25,NaN +0,100,0,0.2,NaN +0,100,0,0.1,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.1,NaN +0,100,0,0.1,NaN +180,100,0,0.4,NaN +180,100,0,0.4,NaN +0,100,0,0.4,NaN +0,100,0,0.2,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0,0.3,NaN +180,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0,0.25,NaN +180,100,0,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0,0.3,NaN +180,100,0,0.4,NaN +180,100,0,0.6,NaN +180,100,0,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0,0.25,NaN +0,100,0,0.4,NaN +0,100,0,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0,0.2,NaN +0,100,0,0.6,NaN +0,100,0,0.1,NaN +180,100,0,0.3,NaN +180,100,0,0.2,NaN +180,100,0,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0,0.1,NaN +0,100,0,0.3,NaN +180,100,0,0.4,NaN +0,100,0,0.1,NaN +0,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0,0.1,NaN +180,100,0,0.2,NaN +180,100,0,0.4,NaN +0,100,0,0.25,NaN +180,100,0,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0,0.25,NaN +180,100,0,0.4,NaN +180,100,0,0.2,NaN +0,100,0.2,0.4,NaN +0,100,0,0.1,NaN +180,100,0.2,0.3,NaN +180,100,0,0.1,NaN +0,100,0,0.2,NaN +0,100,0,0.2,NaN +0,100,0,0.2,NaN +0,100,0,0.1,NaN +0,100,0,0.4,NaN +0,100,0,0.1,NaN +180,100,0,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0,0.1,NaN +0,100,0.2,0.4,NaN +180,100,0,0.2,NaN +180,100,0,0.1,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +180,100,0,0.4,NaN +0,100,0.2,0.6,NaN +0,100,0,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0,0.3,NaN +0,100,0,0.1,NaN +180,100,0,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0,0.3,NaN +180,100,0.2,0.6,NaN +0,100,0,0.2,NaN +0,100,0,0.2,NaN +180,100,0.2,0.4,NaN +0,100,0,0.2,NaN +180,100,0.2,0.25,NaN +180,100,0,0.1,NaN +0,100,0,0.2,NaN +0,100,0,0.2,NaN +180,100,0,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0,0.2,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0,0.4,NaN +0,100,0,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0,0.25,NaN +0,100,0,0.1,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0,0.3,NaN +180,100,0,0.4,NaN +0,100,0,0.25,NaN +180,100,0,0.2,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0,0.25,NaN +180,100,0,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0,0.25,NaN +180,100,0,0.1,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +180,100,0,0.25,NaN +180,100,0,0.1,NaN +180,100,0.2,0.25,NaN +180,100,0,0.3,NaN +180,100,0.2,0.6,NaN +180,100,0.2,0.25,NaN +180,100,0,0.1,NaN +0,100,0,0.1,NaN +0,100,0,0.2,NaN +180,100,0,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0,0.25,NaN +0,100,0,0.2,NaN +0,100,0,0.4,NaN +0,100,0,0.4,NaN +180,100,0,0.2,NaN +180,100,0,0.4,NaN +0,100,0,0.4,NaN +0,100,0,0.1,NaN +180,100,0,0.2,NaN +180,100,0,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0,0.2,NaN +0,100,0,0.25,NaN +0,100,0,0.4,NaN +180,100,0,0.1,NaN +180,100,0.2,0.25,NaN +0,100,0,0.25,NaN +0,100,0,0.25,NaN +180,100,0,0.4,NaN +0,100,0,0.4,NaN +180,100,0,0.4,NaN +0,100,0,0.3,NaN +180,100,0,0.1,NaN +180,100,0,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0,0.1,NaN +0,100,0,0.2,NaN +0,100,0,0.3,NaN +0,100,0,0.1,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.6,NaN +180,100,0,0.3,NaN +0,100,0,0.6,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +0,100,0,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0,0.1,NaN +180,100,0,0.25,NaN +0,100,0,0.1,NaN +0,100,0,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0,0.25,NaN +0,100,0,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0,0.25,NaN +0,100,0,0.25,NaN +180,100,0,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0,0.2,NaN +180,100,0,0.4,NaN +180,100,0,0.4,NaN +180,100,0,0.3,NaN +180,100,0,0.4,NaN +180,100,0,0.2,NaN +0,100,0,0.4,NaN +180,100,0,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0,0.4,NaN +180,100,0,0.4,NaN +0,100,0,0.25,NaN +0,100,0,0.1,NaN +0,100,0,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0,0.4,NaN +180,100,0,0.25,NaN +180,100,0.2,0.25,NaN +0,100,0,0.1,NaN +0,100,0,0.1,NaN +0,100,0,0.3,NaN +0,100,0,0.25,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0,0.1,NaN +180,100,0,0.25,NaN +180,100,0,0.2,NaN +0,100,0,0.25,NaN +180,100,0,0.3,NaN +180,100,0,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0,0.3,NaN +180,100,0,0.4,NaN +180,100,0,0.25,NaN +180,100,0,0.2,NaN +0,100,0.2,0.3,NaN +0,100,0,0.3,NaN +180,100,0,0.1,NaN +180,100,0,0.2,NaN +180,100,0,0.3,NaN +180,100,0,0.4,NaN +0,100,0,0.25,NaN +180,100,0,0.1,NaN +0,100,0.2,0.25,NaN +180,100,0,0.3,NaN +0,100,0,0.3,NaN +0,100,0,0.2,NaN +0,100,0,0.4,NaN +0,100,0.2,0.4,NaN +180,100,0,0.4,NaN +0,100,0,0.1,NaN +180,100,0,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0,0.4,NaN +180,100,0,0.3,NaN +0,100,0,0.4,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +0,100,0,0.4,NaN +180,100,0,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0,0.25,NaN +180,100,0,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0,0.1,NaN +180,100,0,0.1,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0,0.1,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0,0.4,NaN +180,100,0,0.1,NaN +180,100,0,0.1,NaN +0,100,0,0.4,NaN +180,100,0,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0,0.3,NaN +180,100,0,0.3,NaN +180,100,0,0.3,NaN +180,100,0,0.4,NaN +180,100,0,0.4,NaN +0,100,0,0.3,NaN +180,100,0,0.1,NaN +0,100,0.2,0.6,NaN +0,100,0,0.6,NaN +180,100,0,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +0,100,0,0.4,NaN +0,100,0,0.2,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0,0.1,NaN +180,100,0,0.3,NaN +180,100,0.2,0.3,NaN +0,100,0,0.4,NaN +0,100,0,0.4,NaN +0,100,0,0.3,NaN +0,100,0,0.3,NaN +180,100,0,0.4,NaN +180,100,0,0.2,NaN +180,100,0.2,0.25,NaN +0,100,0,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0,0.1,NaN +0,100,0.2,0.4,NaN +180,100,0,0.3,NaN +0,100,0,0.4,NaN +180,100,0,0.3,NaN +180,100,0,0.4,NaN +0,100,0,0.1,NaN +180,100,0,0.2,NaN +180,100,0,0.4,NaN +0,100,0,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.6,NaN +0,100,0.2,0.3,NaN +0,100,0,0.3,NaN +0,100,0,0.25,NaN +0,100,0,0.25,NaN +0,100,0,0.25,NaN +180,100,0,0.4,NaN +0,100,0,0.25,NaN +180,100,0,0.6,NaN +0,100,0.2,0.25,NaN +0,100,0,0.1,NaN +0,100,0,0.4,NaN +0,100,0,0.4,NaN +180,100,0,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0,0.3,NaN +180,100,0,0.3,NaN +0,100,0.2,0.4,NaN +180,100,0,0.3,NaN +0,100,0,0.3,NaN +0,100,0,0.25,NaN +180,100,0,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0,0.4,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +0,100,0,0.3,NaN +180,100,0,0.4,NaN +0,100,0,0.1,NaN +0,100,0,0.2,NaN +180,100,0,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.6,NaN +180,100,0,0.1,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +180,100,0,0.2,NaN +0,100,0,0.3,NaN +180,100,0,0.1,NaN +0,100,0,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0,0.4,NaN +0,100,0,0.3,NaN +0,100,0,0.4,NaN +0,100,0,0.25,NaN +0,100,0,0.3,NaN +180,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0,0.25,NaN +180,100,0,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.1,NaN +180,100,0,0.4,NaN +180,100,0.2,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.4,NaN +180,100,0,0.3,NaN +180,100,0.2,0.3,NaN +0,100,0,0.2,NaN +180,100,0.2,0.25,NaN +180,100,0,0.25,NaN +180,100,0,0.2,NaN +0,100,0.2,0.6,NaN +180,100,0,0.4,NaN +180,100,0,0.2,NaN +0,100,0,0.25,NaN +180,100,0,0.2,NaN +180,100,0.2,0.6,NaN +180,100,0,0.4,NaN +180,100,0,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0,0.4,NaN +0,100,0,0.4,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0.2,0.3,NaN +0,100,0,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0,0.2,NaN +180,100,0,0.3,NaN +180,100,0,0.3,NaN +180,100,0.2,0.3,NaN +0,100,0,0.6,NaN +0,100,0,0.4,NaN +180,100,0,0.3,NaN +180,100,0,0.25,NaN +0,100,0,0.2,NaN +0,100,0,0.4,NaN +180,100,0,0.2,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +180,100,0,0.25,NaN +0,100,0,0.25,NaN +180,100,0,0.4,NaN +180,100,0,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0,0.3,NaN +0,100,0,0.2,NaN +0,100,0,0.2,NaN +180,100,0,0.4,NaN +180,100,0,0.25,NaN +180,100,0,0.3,NaN +180,100,0,0.3,NaN +0,100,0,0.4,NaN +0,100,0,0.4,NaN +0,100,0,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0,0.4,NaN +180,100,0,0.1,NaN +180,100,0.2,0.3,NaN +0,100,0,0.3,NaN +180,100,0,0.25,NaN +180,100,0,0.4,NaN +180,100,0,0.3,NaN +0,100,0,0.2,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +0,100,0,0.2,NaN +0,100,0,0.1,NaN +0,100,0.2,0.4,NaN +0,100,0,0.3,NaN +0,100,0,0.25,NaN +180,100,0,0.1,NaN +0,100,0,0.3,NaN +180,100,0,0.2,NaN +0,100,0.2,0.4,NaN +0,100,0,0.25,NaN +180,100,0,0.3,NaN +180,100,0,0.3,NaN +180,100,0,0.6,NaN +0,100,0,0.2,NaN +0,100,0,0.6,NaN +180,100,0,0.25,NaN +180,100,0,0.1,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0,0.1,NaN +0,100,0.2,0.4,NaN +180,100,0,0.3,NaN +0,100,0,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0,0.2,NaN +180,100,0,0.3,NaN +180,100,0,0.25,NaN +0,100,0,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0,0.1,NaN +180,100,0.2,0.6,NaN +180,100,0,0.1,NaN +0,100,0,0.3,NaN +180,100,0,0.3,NaN +180,100,0,0.3,NaN +180,100,0,0.3,NaN +180,100,0,0.2,NaN +180,100,0,0.3,NaN +0,100,0,0.4,NaN +0,100,0,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0,0.6,NaN +180,100,0.2,0.25,NaN +180,100,0,0.2,NaN +0,100,0.2,0.25,NaN +180,100,0,0.6,NaN +180,100,0.2,0.4,NaN +0,100,0,0.3,NaN +0,100,0,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.2,NaN +0,100,0,0.25,NaN +0,100,0,0.1,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +0,100,0,0.3,NaN +180,100,0.2,0.25,NaN +0,100,0,0.25,NaN +0,100,0,0.4,NaN +0,100,0,0.2,NaN +180,100,0,0.6,NaN +0,100,0,0.6,NaN +180,100,0,0.25,NaN +0,100,0,0.4,NaN +180,100,0,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0,0.2,NaN +0,100,0,0.1,NaN +0,100,0.2,0.25,NaN +0,100,0,0.1,NaN +0,100,0,0.2,NaN +180,100,0.2,0.25,NaN +0,100,0,0.25,NaN +0,100,0,0.3,NaN +180,100,0.2,0.3,NaN +0,100,0,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0,0.25,NaN +0,100,0,0.2,NaN +180,100,0.2,0.3,NaN +0,100,0,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0,0.2,NaN +180,100,0,0.2,NaN +0,100,0.2,0.3,NaN +0,100,0,0.25,NaN +0,100,0,0.4,NaN +0,100,0,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0,0.25,NaN +0,100,0,0.1,NaN +0,100,0.2,0.3,NaN +0,100,0.2,0.3,NaN +0,100,0,0.4,NaN +0,100,0,0.1,NaN +180,100,0,0.2,NaN +180,100,0.2,0.25,NaN +0,100,0,0.2,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0,0.3,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.4,NaN +0,100,0,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +0,100,0,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0,0.25,NaN +0,100,0,0.25,NaN +0,100,0,0.3,NaN +0,100,0,0.1,NaN +0,100,0,0.1,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0,0.4,NaN +180,100,0,0.2,NaN +180,100,0,0.4,NaN +180,100,0,0.1,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +180,100,0,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0,0.2,NaN +180,100,0,0.2,NaN +0,100,0,0.4,NaN +0,100,0,0.25,NaN +0,100,0,0.4,NaN +180,100,0,0.4,NaN +0,100,0,0.25,NaN +0,100,0,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0,0.2,NaN +0,100,0,0.25,NaN +0,100,0,0.2,NaN +0,100,0,0.3,NaN +0,100,0,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0,0.6,NaN +0,100,0,0.25,NaN +180,100,0,0.2,NaN +0,100,0.2,0.4,NaN +180,100,0,0.4,NaN +0,100,0,0.2,NaN +180,100,0,0.4,NaN +0,100,0,0.1,NaN +180,100,0.2,0.4,NaN +180,100,0,0.1,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.4,NaN +180,100,0,0.1,NaN +180,100,0,0.2,NaN +0,100,0,0.25,NaN +0,100,0.2,0.4,NaN +0,100,0,0.4,NaN +180,100,0,0.6,NaN +180,100,0,0.4,NaN +180,100,0,0.25,NaN +0,100,0,0.3,NaN +180,100,0,0.4,NaN +180,100,0,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0.2,0.6,NaN +180,100,0,0.4,NaN +180,100,0,0.6,NaN +0,100,0,0.25,NaN +0,100,0,0.3,NaN +180,100,0,0.2,NaN +180,100,0.2,0.4,NaN +180,100,0,0.1,NaN +180,100,0,0.4,NaN +180,100,0,0.25,NaN +180,100,0.2,0.3,NaN +180,100,0,0.1,NaN +180,100,0.2,0.25,NaN +0,100,0.2,0.25,NaN +180,100,0,0.1,NaN +180,100,0,0.25,NaN +180,100,0,0.1,NaN +0,100,0.2,0.25,NaN +0,100,0,0.2,NaN +0,100,0,0.2,NaN +0,100,0,0.25,NaN +0,100,0,0.3,NaN +180,100,0.2,0.3,NaN +180,100,0,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0,0.2,NaN +0,100,0,0.4,NaN +180,100,0,0.1,NaN +0,100,0,0.3,NaN +0,100,0.2,0.3,NaN +180,100,0,0.4,NaN +0,100,0,0.3,NaN +180,100,0,0.1,NaN +180,100,0,0.3,NaN +0,100,0,0.1,NaN +0,100,0.2,0.3,NaN +0,100,0,0.6,NaN +180,100,0.2,0.4,NaN +0,100,0,0.4,NaN +0,100,0,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0,0.4,NaN +0,100,0,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0,0.2,NaN +0,100,0.2,0.25,NaN +0,100,0,0.4,NaN +180,100,0,0.25,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.3,NaN +180,100,0,0.3,NaN +0,100,0.2,0.4,NaN +0,100,0.2,0.3,NaN +0,100,0,0.3,NaN +0,100,0,0.4,NaN +180,100,0,0.3,NaN +180,100,0,0.1,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0,0.3,NaN +0,100,0,0.3,NaN +0,100,0,0.3,NaN +180,100,0,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0.2,0.4,NaN +180,100,0.2,0.3,NaN +0,100,0,0.25,NaN +0,100,0.2,0.3,NaN +0,100,0,0.25,NaN +0,100,0,0.1,NaN +0,100,0,0.1,NaN +180,100,0,0.3,NaN +180,100,0.2,0.25,NaN +180,100,0,0.25,NaN +0,100,0,0.3,NaN +180,100,0,0.25,NaN +0,100,0,0.1,NaN +180,100,0,0.3,NaN +0,100,0,0.4,NaN +0,100,0,0.25,NaN +180,100,0.2,0.4,NaN +180,100,0,0.1,NaN +0,100,0,0.25,NaN +180,100,0,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0.2,0.25,NaN +180,100,0,0.2,NaN +0,100,0.2,0.3,NaN +180,100,0.2,0.4,NaN +180,100,0.2,0.25,NaN +0,100,0,0.3,NaN +0,100,0,0.6,NaN +0,100,0,0.3,NaN +0,100,0,0.25,NaN +180,100,0.2,0.3,NaN +0,100,0,0.4,NaN +0,100,0.2,0.25,NaN +0,100,0,0.4,NaN +0,100,0.2,0.25,NaN +180,100,0,0.1,NaN +0,100,0.2,0.3,NaN +0,100,0,0.1,NaN +0,100,0,0.3,NaN +180,100,0,0.4,NaN +0,100,0,0.25,NaN +180,100,0,0.6,NaN +180,100,0,0.2,NaN +180,100,0,0.1,NaN +180,100,0.2,0.6,NaN +180,100,0.2,0.4,NaN +0,100,0,0.1,NaN +180,100,0.2,0.3,NaN +180,100,0,0.1,NaN +180,100,0,0.3,NaN +180,100,0,0.3,NaN +0,100,0,0.25,NaN +0,100,0,0.1,NaN diff --git a/modularTasks/testing/dotsReproducibilityTest/cpTime_with_dotsClock.txt b/modularTasks/testing/dotsReproducibilityTest/cpTime_with_dotsClock.txt new file mode 100644 index 0000000..cabb848 --- /dev/null +++ b/modularTasks/testing/dotsReproducibilityTest/cpTime_with_dotsClock.txt @@ -0,0 +1,34 @@ +The variable t below was obtained by calling readtable on the FIRA .csv file from session 2019_12_18_14_00 (task100) +and only taking the first 10 rows of the resulting table (only 10 valid trials were performed) + +======== Code on MATLAB console leading to plot with filename similar to present text filename ===== + +>> t +t = + taskID trialIndex trialStart trialEnd RT cpRT dirChoice cpChoice dirCorrect cpCorrect direction coherence randSeedBase fixationOn fixationStart targetOn dotsOn finalCPTime dotsOff choiceTime cpChoiceTime blankScreen feedbackOn subject date probCP cpScreenOn dummyBlank cpTimeDotsClock firstDraw lastDraw firstDrawPostCP numberDrawPreCP numberDrawPostCP reversal duration finalDuration + ______ __________ __________ __________ _______ _______ _________ ________ __________ _________ _________ _________ ____________ __________ _____________ ________ _______ ___________ _______ __________ ____________ ___________ __________ _______ __________ ______ __________ __________ _______________ __________ __________ _______________ _______________ ________________ ________ ________ _____________ + 100 1 3.0322e+06 3.0322e+06 0.43945 0.968 1 1 1 0 0 0 1 0.071271 NaN 1.0204 1.2069 NaN 1.3256 1.7651 2.7331 3.0322e+06 NaN 99 2.0191e+11 0.3 1.7833 2.7494 NaN 7.3778e+05 7.3778e+05 NaN 7 0 0 0.1 NaN + 100 2 3.0322e+06 3.0322e+06 0.28089 0.79999 1 1 1 1 0 14 2 0.072815 NaN 0.63214 0.86943 0.23729 1.1406 1.4215 2.2215 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4287 2.2254 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 2 0.2 0.25 NaN + 100 3 3.0322e+06 3.0322e+06 0.14804 0.824 1 1 1 0 0 14 3 0.066609 NaN 0.49034 0.82932 NaN 1.0497 1.1977 2.0217 3.0322e+06 NaN 99 2.0191e+11 0.3 1.2022 2.0327 NaN 7.3778e+05 7.3778e+05 NaN 13 0 0 0.2 NaN + 100 4 3.0322e+06 3.0322e+06 0.17857 0.632 1 1 0 1 180 14 4 0.047647 NaN 1.0646 1.3697 0.23729 1.6239 1.8025 2.4345 3.0322e+06 NaN 99 2.0191e+11 0.3 1.8104 2.4375 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 15 1 0.2 0.25 NaN + 100 5 3.0322e+06 3.0322e+06 0.19255 0.784 1 1 0 1 180 14 5 0.032352 NaN 0.45608 0.82896 0.23729 1.2527 1.4452 2.2292 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4561 2.2357 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 11 0.2 0.4 NaN + 100 6 3.0322e+06 3.0322e+06 0.17039 0.896 1 1 1 1 0 14 6 0.041483 NaN 0.44826 1.1601 0.23886 1.5685 1.7389 2.6349 3.0322e+06 NaN 99 2.0191e+11 0.3 1.7549 2.6532 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 11 0.2 0.4 NaN + 100 7 3.0322e+06 3.0322e+06 0.26472 0.84 1 1 0 1 180 14 7 0.03441 NaN 0.35644 0.81407 0.23729 1.1361 1.4008 2.2408 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4073 2.2547 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 5 0.2 0.3 NaN + 100 8 3.0322e+06 3.0322e+06 0.18809 0.912 1 1 0 0 180 0 8 0.042727 NaN 0.41561 0.70374 NaN 0.95895 1.147 2.059 3.0322e+06 NaN 99 2.0191e+11 0.3 1.1623 2.0776 NaN 7.3778e+05 7.3778e+05 NaN 16 0 0 0.25 NaN + 100 9 3.0322e+06 3.0322e+06 0.42278 1.176 1 1 1 1 0 14 9 0.044909 NaN 0.45169 0.75663 0.23384 1.0754 1.4982 2.6742 3.0322e+06 NaN 99 2.0191e+11 0.3 1.5161 2.6856 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 5 0.2 0.3 NaN + 100 10 3.0322e+06 3.0322e+06 0.27053 0.84799 1 1 0 0 180 0 10 0.040582 NaN 0.6338 0.88804 NaN 1.2946 1.5651 2.4131 3.0322e+06 NaN 99 2.0191e+11 0.3 1.5827 2.4301 NaN 7.3778e+05 7.3778e+05 NaN 25 0 0 0.4 NaN +>> plot(t.trialIndex,(t.cpTimeDotsClock - t.firstDraw)*24*3600) +>> plot(t.trialIndex,(t.cpTimeDotsClock - t.firstDraw)*24*3600,'*', 'MarkerSize',5) +>> plot(t.trialIndex,(t.cpTimeDotsClock - t.firstDraw)*24*3600,'*', 'MarkerSize',15) +>> plot(t.trialIndex,(t.cpTimeDotsClock - t.firstDraw)*24*3600,'*r', 'MarkerSize',15) +>> ylim(.2,.25) +Error using ylim (line 29) +Wrong number of arguments +>> ylim([.2,.25]) +>> hold on +>> plot(t.trialIndex,t.finalCPTime,'ob', 'MarkerSize',15) +>> legend({'dotsClock','finalCPTime'}) +>> ylabel('time (s)') +>> xlabel('trialIndex') +>> title('a more precise measure of CPtime (red)') +>> hold off diff --git a/modularTasks/testing/dotsReproducibilityTest/ddk2.txt b/modularTasks/testing/dotsReproducibilityTest/ddk2.txt new file mode 100644 index 0000000..5ed4864 --- /dev/null +++ b/modularTasks/testing/dotsReproducibilityTest/ddk2.txt @@ -0,0 +1,45 @@ +ddk2 = readtable('/Users/joshuagold/Documents/MATLAB/projects/Lab_Matlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/trials_post_expt/2019_12_19_09_57/completed4AFCtrials_task100_date_2019_12_19_09_57.csv'); +{Error using readtable (line 143) +Unable to open file +'/Users/joshuagold/Documents/MATLAB/projects/Lab_Matlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/trials_post_expt/2019_12_19_09_57/completed4AFCtrials_task100_date_2019_12_19_09_57.csv'.} +ddk2 = readtable('/Users/joshuagold/Documents/MATLAB/projects/Lab_Matlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/trials_post_expt/2019_12_19_09_57/completed4AFCtrials_task100_date_2019_12_19_09_57.csv'); +ddk = readtable('/Users/joshuagold/Documents/MATLAB/projects/Lab_Matlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/trials_post_expt/2019_12_18_14_00/completed4AFCtrials_task100_date_2019_12_18_14_00.csv'); +ddk = ddk(1:10,:); ddk2 = ddk2(1:10,:); +ddk +ddk = + taskID trialIndex trialStart trialEnd RT cpRT dirChoice cpChoice dirCorrect cpCorrect direction coherence randSeedBase fixationOn fixationStart targetOn dotsOn finalCPTime dotsOff choiceTime cpChoiceTime blankScreen feedbackOn subject date probCP cpScreenOn dummyBlank cpTimeDotsClock firstDraw lastDraw firstDrawPostCP numberDrawPreCP numberDrawPostCP reversal duration finalDuration + ______ __________ __________ __________ _______ _______ _________ ________ __________ _________ _________ _________ ____________ __________ _____________ ________ _______ ___________ _______ __________ ____________ ___________ __________ _______ __________ ______ __________ __________ _______________ __________ __________ _______________ _______________ ________________ ________ ________ _____________ + 100 1 3.0322e+06 3.0322e+06 0.43945 0.968 1 1 1 0 0 0 1 0.071271 NaN 1.0204 1.2069 NaN 1.3256 1.7651 2.7331 3.0322e+06 NaN 99 2.0191e+11 0.3 1.7833 2.7494 NaN 7.3778e+05 7.3778e+05 NaN 7 0 0 0.1 NaN + 100 2 3.0322e+06 3.0322e+06 0.28089 0.79999 1 1 1 1 0 14 2 0.072815 NaN 0.63214 0.86943 0.23729 1.1406 1.4215 2.2215 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4287 2.2254 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 2 0.2 0.25 NaN + 100 3 3.0322e+06 3.0322e+06 0.14804 0.824 1 1 1 0 0 14 3 0.066609 NaN 0.49034 0.82932 NaN 1.0497 1.1977 2.0217 3.0322e+06 NaN 99 2.0191e+11 0.3 1.2022 2.0327 NaN 7.3778e+05 7.3778e+05 NaN 13 0 0 0.2 NaN + 100 4 3.0322e+06 3.0322e+06 0.17857 0.632 1 1 0 1 180 14 4 0.047647 NaN 1.0646 1.3697 0.23729 1.6239 1.8025 2.4345 3.0322e+06 NaN 99 2.0191e+11 0.3 1.8104 2.4375 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 15 1 0.2 0.25 NaN + 100 5 3.0322e+06 3.0322e+06 0.19255 0.784 1 1 0 1 180 14 5 0.032352 NaN 0.45608 0.82896 0.23729 1.2527 1.4452 2.2292 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4561 2.2357 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 11 0.2 0.4 NaN + 100 6 3.0322e+06 3.0322e+06 0.17039 0.896 1 1 1 1 0 14 6 0.041483 NaN 0.44826 1.1601 0.23886 1.5685 1.7389 2.6349 3.0322e+06 NaN 99 2.0191e+11 0.3 1.7549 2.6532 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 11 0.2 0.4 NaN + 100 7 3.0322e+06 3.0322e+06 0.26472 0.84 1 1 0 1 180 14 7 0.03441 NaN 0.35644 0.81407 0.23729 1.1361 1.4008 2.2408 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4073 2.2547 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 5 0.2 0.3 NaN + 100 8 3.0322e+06 3.0322e+06 0.18809 0.912 1 1 0 0 180 0 8 0.042727 NaN 0.41561 0.70374 NaN 0.95895 1.147 2.059 3.0322e+06 NaN 99 2.0191e+11 0.3 1.1623 2.0776 NaN 7.3778e+05 7.3778e+05 NaN 16 0 0 0.25 NaN + 100 9 3.0322e+06 3.0322e+06 0.42278 1.176 1 1 1 1 0 14 9 0.044909 NaN 0.45169 0.75663 0.23384 1.0754 1.4982 2.6742 3.0322e+06 NaN 99 2.0191e+11 0.3 1.5161 2.6856 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 5 0.2 0.3 NaN + 100 10 3.0322e+06 3.0322e+06 0.27053 0.84799 1 1 0 0 180 0 10 0.040582 NaN 0.6338 0.88804 NaN 1.2946 1.5651 2.4131 3.0322e+06 NaN 99 2.0191e+11 0.3 1.5827 2.4301 NaN 7.3778e+05 7.3778e+05 NaN 25 0 0 0.4 NaN +ddk2 +ddk2 = + taskID trialIndex trialStart trialEnd RT cpRT dirChoice cpChoice dirCorrect cpCorrect direction coherence randSeedBase fixationOn fixationStart targetOn dotsOn finalCPTime dotsOff choiceTime cpChoiceTime blankScreen feedbackOn subject date probCP cpScreenOn dummyBlank cpTimeDotsClock firstDraw lastDraw firstDrawPostCP numberDrawPreCP numberDrawPostCP reversal duration finalDuration + ______ __________ __________ _________ _______ _______ _________ ________ __________ _________ _________ _________ ____________ __________ _____________ ________ _______ ___________ _______ __________ ____________ ___________ __________ _______ __________ ______ __________ __________ _______________ __________ __________ _______________ _______________ ________________ ________ ________ _____________ + 100 1 3.104e+06 3.104e+06 0.41953 0.44798 1 1 1 0 0 0 1 0.071788 NaN 0.71586 1.004 NaN 1.1057 1.5252 1.9732 3.104e+06 NaN 99 2.0191e+11 0.3 1.5294 1.987 NaN 7.3778e+05 7.3778e+05 NaN 7 0 0 0.1 NaN + 100 2 3.104e+06 3.104e+06 0.49188 0.40802 1 1 1 1 0 14 2 0.072776 NaN 0.4965 0.86939 0.23775 1.141 1.6329 2.0409 3.104e+06 NaN 99 2.0191e+11 0.3 1.6495 2.0563 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 2 0.2 0.25 NaN + 100 3 3.104e+06 3.104e+06 0.36819 0.48 1 1 1 0 0 14 3 0.067797 NaN 0.45763 0.67797 NaN 0.89831 1.2665 1.7465 3.104e+06 NaN 99 2.0191e+11 0.3 1.2712 1.7627 NaN 7.3778e+05 7.3778e+05 NaN 13 0 0 0.2 NaN + 100 4 3.104e+06 3.104e+06 0.34208 0.46399 1 1 0 1 180 14 4 0.038515 NaN 0.83513 0.98767 0.23595 1.2406 1.5826 2.0466 3.104e+06 NaN 99 2.0191e+11 0.3 1.5965 2.0541 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 16 1 0.2 0.25 NaN + 100 5 3.104e+06 3.104e+06 0.32099 0.47199 1 1 0 1 180 14 5 0.036103 NaN 0.52763 0.78187 0.23729 1.2053 1.5263 1.9983 3.104e+06 NaN 99 2.0191e+11 0.3 1.5443 2.0019 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 12 0.2 0.4 NaN + 100 6 3.104e+06 3.104e+06 0.36077 0.56 1 1 1 1 0 14 6 0.041204 NaN 0.53273 0.97341 0.23866 1.3816 1.7423 2.3023 3.104e+06 NaN 99 2.0191e+11 0.3 1.7544 2.3138 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 16 11 0.2 0.4 NaN + 100 7 3.104e+06 3.104e+06 0.32873 0.632 1 1 0 1 180 14 7 0.041409 NaN 0.87192 1.5838 0.234 1.9014 2.2301 2.8621 3.104e+06 NaN 99 2.0191e+11 0.3 2.2404 2.8675 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 6 0.2 0.3 NaN + 100 8 3.104e+06 3.104e+06 0.45673 0.536 1 1 0 0 180 0 8 0.039383 NaN 1.3784 1.5648 NaN 1.819 2.2758 2.8118 3.104e+06 NaN 99 2.0191e+11 0.3 2.2936 2.819 NaN 7.3778e+05 7.3778e+05 NaN 17 0 0 0.25 NaN + 100 9 3.104e+06 3.104e+06 0.43882 0.488 1 1 1 1 0 14 9 0.035016 NaN 0.76383 1.4926 0.23729 1.7977 2.2366 2.7245 3.104e+06 NaN 99 2.0191e+11 0.3 2.2554 2.7299 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 16 4 0.2 0.3 NaN + 100 10 3.104e+06 3.104e+06 0.65402 0.60801 1 1 0 0 180 0 10 0.031661 NaN 0.77742 1.0147 NaN 1.4211 2.0751 2.6831 3.104e+06 NaN 99 2.0191e+11 0.3 2.0821 2.6923 NaN 7.3778e+05 7.3778e+05 NaN 26 0 0 0.4 NaN +plot(ddk.trialIndex, ddk.numberDrawPreCP, 'bo', 'MarkerSize', 15) +hold on +plot(ddk2.trialIndex, ddk2.numberDrawPreCP, 'r*', 'MarkerSize', 15) +plot(ddk2.trialIndex, ddk2.numberDrawPostCP, 'r^', 'MarkerSize', 15) +plot(ddk.trialIndex, ddk.numberDrawPostCP, 'b.', 'MarkerSize', 23) +legend({'epoch1 ddk', 'epoch1 ddk2', 'epoch2 ddk2', 'epoch2 ddk'}) +title('frame count with dDDK vs dDDK2') +ylabel('calls to draw()') +xlabel('trialIndex') +diary off diff --git a/modularTasks/testing/dotsReproducibilityTest/ddk_vs_ddkd.txt b/modularTasks/testing/dotsReproducibilityTest/ddk_vs_ddkd.txt new file mode 100644 index 0000000..7ff879d --- /dev/null +++ b/modularTasks/testing/dotsReproducibilityTest/ddk_vs_ddkd.txt @@ -0,0 +1,46 @@ +ddk = readtable('/Users/joshuagold/Documents/MATLAB/projects/Lab_Matlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/trials_post_expt/2019_12_18_14_00/completed4AFCtrials_task100_date_2019_12_18_14_00.csv'); +ddkd = readtable('/Users/joshuagold/Documents/MATLAB/projects/Lab_Matlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/trials_post_expt/2019_12_18_17_06/completed4AFCtrials_task100_date_2019_12_18_17_06.csv'); +ddk = ddk(1:10,:); ddkd = ddkd(1:10,:); +epoch1_ddk = (ddk.cpTimeDotsClock - ddk.firstDraw)*24*3600; +epoch1_ddkd = (ddkd.cpTimeDotsClock - ddkd.firstDraw)*24*3600; +epoch1_ddkd - epoch1_ddk +ans = + NaN + -0.0030 + NaN + -0.0016 + 0.0060 + 0.0132 + 0.0015 + NaN + 0.0074 + NaN +(epoch1_ddkd - epoch1_ddk)*1000 +ans = + NaN + -3.0175 + NaN + -1.6294 + 5.9545 + 13.2166 + 1.4685 + NaN + 7.4230 + NaN +plot(ddk.trialIndex, ddk.numberDrawPreCP, 'bo', 'MarkerSize', 15) +hold on +plot(ddkd.trialIndex, ddkd.numberDrawPreCP, 'r*', 'MarkerSize', 15) +legend({'ddk', 'ddkd'}) +plot(ddkd.trialIndex, ddkd.numberDrawPostCP, 'r^', 'MarkerSize', 15) +plot(ddk.trialIndex, ddk.numberDrawPostCP, 'b.', 'MarkerSize', 23) +legend({'epoch1 ddk', 'epoch1 ddkd', 'epoch2 ddkd', 'epoch2 ddk'}) +title('frame count with dDDK vs dDDKDebug') +ylabel('calls to draw()') +xlabel('trialIndex') +hold off +hold on +stairs(1:10, ddk.numberDrawPreCP + ddk.numberDrawPostCP, 'r') +stairs(1:10, ddkd.numberDrawPreCP + ddkd.numberDrawPostCP, 'b') +stairs(1:10, ddk.numberDrawPreCP + ddk.numberDrawPostCP, 'b') +stairs(1:10, ddkd.numberDrawPreCP + ddkd.numberDrawPostCP, 'r') +diary off diff --git a/modularTasks/testing/dotsReproducibilityTest/frameRateSecondEpoch.txt b/modularTasks/testing/dotsReproducibilityTest/frameRateSecondEpoch.txt new file mode 100644 index 0000000..df88868 --- /dev/null +++ b/modularTasks/testing/dotsReproducibilityTest/frameRateSecondEpoch.txt @@ -0,0 +1,23 @@ +frameRateSecondEpoch = t.numberDrawPostCP ./ ((t.lastDraw - t.firstDrawPostCP)*24*3600 + mean(frameDurations, 'omitnan')); +plot(t.trialIndex, frameRateSecondEpoch, 'ob', 'MarkerSize', 15) +hold on +plot(t.trialIndex, frameRate, '*r', 'MarkerSize', 15) +ylim([59,64]) +legend({'second epoch', 'first epoch'}) +frameRateNoCP = t.numberDrawPreCP ./ ((t.lastDraw - t.firstDrawPostCP)*24*3600 + mean(frameDurations, 'omitnan')); +plot([1,3,8,10], frameRateNoCP([1,3,8,10]), 'k.', 'MarkerSize',20) +frameRateNoCP = t.numberDrawPreCP ./ ((t.lastDraw - t.firstDraw)*24*3600 + mean(frameDurations, 'omitnan')); +plot([1,3,8,10], frameRateNoCP([1,3,8,10]), 'k.', 'MarkerSize',20) +ylim([58,65]) +ylim([59,65]) +legend({'second epoch', 'first epoch', 'noCP'}) +7/.091 +ans = + 76.9231 +7/.118 +ans = + 59.3220 +.091 + 0.0162 +ans = + 0.1072 +diary off diff --git a/modularTasks/testing/dotsReproducibilityTest/framerate.txt b/modularTasks/testing/dotsReproducibilityTest/framerate.txt new file mode 100644 index 0000000..6210a13 --- /dev/null +++ b/modularTasks/testing/dotsReproducibilityTest/framerate.txt @@ -0,0 +1,24 @@ +t +t = + taskID trialIndex trialStart trialEnd RT cpRT dirChoice cpChoice dirCorrect cpCorrect direction coherence randSeedBase fixationOn fixationStart targetOn dotsOn finalCPTime dotsOff choiceTime cpChoiceTime blankScreen feedbackOn subject date probCP cpScreenOn dummyBlank cpTimeDotsClock firstDraw lastDraw firstDrawPostCP numberDrawPreCP numberDrawPostCP reversal duration finalDuration + ______ __________ __________ __________ _______ _______ _________ ________ __________ _________ _________ _________ ____________ __________ _____________ ________ _______ ___________ _______ __________ ____________ ___________ __________ _______ __________ ______ __________ __________ _______________ __________ __________ _______________ _______________ ________________ ________ ________ _____________ + 100 1 3.0322e+06 3.0322e+06 0.43945 0.968 1 1 1 0 0 0 1 0.071271 NaN 1.0204 1.2069 NaN 1.3256 1.7651 2.7331 3.0322e+06 NaN 99 2.0191e+11 0.3 1.7833 2.7494 NaN 7.3778e+05 7.3778e+05 NaN 7 0 0 0.1 NaN + 100 2 3.0322e+06 3.0322e+06 0.28089 0.79999 1 1 1 1 0 14 2 0.072815 NaN 0.63214 0.86943 0.23729 1.1406 1.4215 2.2215 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4287 2.2254 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 2 0.2 0.25 NaN + 100 3 3.0322e+06 3.0322e+06 0.14804 0.824 1 1 1 0 0 14 3 0.066609 NaN 0.49034 0.82932 NaN 1.0497 1.1977 2.0217 3.0322e+06 NaN 99 2.0191e+11 0.3 1.2022 2.0327 NaN 7.3778e+05 7.3778e+05 NaN 13 0 0 0.2 NaN + 100 4 3.0322e+06 3.0322e+06 0.17857 0.632 1 1 0 1 180 14 4 0.047647 NaN 1.0646 1.3697 0.23729 1.6239 1.8025 2.4345 3.0322e+06 NaN 99 2.0191e+11 0.3 1.8104 2.4375 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 15 1 0.2 0.25 NaN + 100 5 3.0322e+06 3.0322e+06 0.19255 0.784 1 1 0 1 180 14 5 0.032352 NaN 0.45608 0.82896 0.23729 1.2527 1.4452 2.2292 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4561 2.2357 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 11 0.2 0.4 NaN + 100 6 3.0322e+06 3.0322e+06 0.17039 0.896 1 1 1 1 0 14 6 0.041483 NaN 0.44826 1.1601 0.23886 1.5685 1.7389 2.6349 3.0322e+06 NaN 99 2.0191e+11 0.3 1.7549 2.6532 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 11 0.2 0.4 NaN + 100 7 3.0322e+06 3.0322e+06 0.26472 0.84 1 1 0 1 180 14 7 0.03441 NaN 0.35644 0.81407 0.23729 1.1361 1.4008 2.2408 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4073 2.2547 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 5 0.2 0.3 NaN + 100 8 3.0322e+06 3.0322e+06 0.18809 0.912 1 1 0 0 180 0 8 0.042727 NaN 0.41561 0.70374 NaN 0.95895 1.147 2.059 3.0322e+06 NaN 99 2.0191e+11 0.3 1.1623 2.0776 NaN 7.3778e+05 7.3778e+05 NaN 16 0 0 0.25 NaN + 100 9 3.0322e+06 3.0322e+06 0.42278 1.176 1 1 1 1 0 14 9 0.044909 NaN 0.45169 0.75663 0.23384 1.0754 1.4982 2.6742 3.0322e+06 NaN 99 2.0191e+11 0.3 1.5161 2.6856 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 5 0.2 0.3 NaN + 100 10 3.0322e+06 3.0322e+06 0.27053 0.84799 1 1 0 0 180 0 10 0.040582 NaN 0.6338 0.88804 NaN 1.2946 1.5651 2.4131 3.0322e+06 NaN 99 2.0191e+11 0.3 1.5827 2.4301 NaN 7.3778e+05 7.3778e+05 NaN 25 0 0 0.4 NaN +firstEpoch = (t.firstDrawPostCP - t.firstDraw)*24*3600; +frameRate = t.numberDrawPreCP ./ firstEpoch; +plot(t.trialIndex, frameRate) +plot(t.trialIndex, frameRate, '*r', 'MarkerSize', 15) +ylim([59,64]) +ylabel('frame rate (Hz)') +xlabel('trialIndex') +title('true frame rate') +title('true frame rate on 1st Epoch') +diary off diff --git a/modularTasks/testing/dotsReproducibilityTest/trialduration.txt b/modularTasks/testing/dotsReproducibilityTest/trialduration.txt new file mode 100644 index 0000000..ccae5f0 --- /dev/null +++ b/modularTasks/testing/dotsReproducibilityTest/trialduration.txt @@ -0,0 +1,62 @@ +t +t = + taskID trialIndex trialStart trialEnd RT cpRT dirChoice cpChoice dirCorrect cpCorrect direction coherence randSeedBase fixationOn fixationStart targetOn dotsOn finalCPTime dotsOff choiceTime cpChoiceTime blankScreen feedbackOn subject date probCP cpScreenOn dummyBlank cpTimeDotsClock firstDraw lastDraw firstDrawPostCP numberDrawPreCP numberDrawPostCP reversal duration finalDuration + ______ __________ __________ __________ _______ _______ _________ ________ __________ _________ _________ _________ ____________ __________ _____________ ________ _______ ___________ _______ __________ ____________ ___________ __________ _______ __________ ______ __________ __________ _______________ __________ __________ _______________ _______________ ________________ ________ ________ _____________ + 100 1 3.0322e+06 3.0322e+06 0.43945 0.968 1 1 1 0 0 0 1 0.071271 NaN 1.0204 1.2069 NaN 1.3256 1.7651 2.7331 3.0322e+06 NaN 99 2.0191e+11 0.3 1.7833 2.7494 NaN 7.3778e+05 7.3778e+05 NaN 7 0 0 0.1 NaN + 100 2 3.0322e+06 3.0322e+06 0.28089 0.79999 1 1 1 1 0 14 2 0.072815 NaN 0.63214 0.86943 0.23729 1.1406 1.4215 2.2215 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4287 2.2254 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 2 0.2 0.25 NaN + 100 3 3.0322e+06 3.0322e+06 0.14804 0.824 1 1 1 0 0 14 3 0.066609 NaN 0.49034 0.82932 NaN 1.0497 1.1977 2.0217 3.0322e+06 NaN 99 2.0191e+11 0.3 1.2022 2.0327 NaN 7.3778e+05 7.3778e+05 NaN 13 0 0 0.2 NaN + 100 4 3.0322e+06 3.0322e+06 0.17857 0.632 1 1 0 1 180 14 4 0.047647 NaN 1.0646 1.3697 0.23729 1.6239 1.8025 2.4345 3.0322e+06 NaN 99 2.0191e+11 0.3 1.8104 2.4375 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 15 1 0.2 0.25 NaN + 100 5 3.0322e+06 3.0322e+06 0.19255 0.784 1 1 0 1 180 14 5 0.032352 NaN 0.45608 0.82896 0.23729 1.2527 1.4452 2.2292 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4561 2.2357 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 11 0.2 0.4 NaN + 100 6 3.0322e+06 3.0322e+06 0.17039 0.896 1 1 1 1 0 14 6 0.041483 NaN 0.44826 1.1601 0.23886 1.5685 1.7389 2.6349 3.0322e+06 NaN 99 2.0191e+11 0.3 1.7549 2.6532 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 11 0.2 0.4 NaN + 100 7 3.0322e+06 3.0322e+06 0.26472 0.84 1 1 0 1 180 14 7 0.03441 NaN 0.35644 0.81407 0.23729 1.1361 1.4008 2.2408 3.0322e+06 NaN 99 2.0191e+11 0.3 1.4073 2.2547 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 5 0.2 0.3 NaN + 100 8 3.0322e+06 3.0322e+06 0.18809 0.912 1 1 0 0 180 0 8 0.042727 NaN 0.41561 0.70374 NaN 0.95895 1.147 2.059 3.0322e+06 NaN 99 2.0191e+11 0.3 1.1623 2.0776 NaN 7.3778e+05 7.3778e+05 NaN 16 0 0 0.25 NaN + 100 9 3.0322e+06 3.0322e+06 0.42278 1.176 1 1 1 1 0 14 9 0.044909 NaN 0.45169 0.75663 0.23384 1.0754 1.4982 2.6742 3.0322e+06 NaN 99 2.0191e+11 0.3 1.5161 2.6856 7.3778e+05 7.3778e+05 7.3778e+05 7.3778e+05 14 5 0.2 0.3 NaN + 100 10 3.0322e+06 3.0322e+06 0.27053 0.84799 1 1 0 0 180 0 10 0.040582 NaN 0.6338 0.88804 NaN 1.2946 1.5651 2.4131 3.0322e+06 NaN 99 2.0191e+11 0.3 1.5827 2.4301 NaN 7.3778e+05 7.3778e+05 NaN 25 0 0 0.4 NaN +durationFIRA = t.dotsOff - t.dotsOn; +durationDots = (t.lastDraw - t.firstDraw)*24*3600; +hold off +plot(t.trialIndex, durationFIRA, 'ob', 'MarkerSize', 15) +hold on +plot(t.trialIndex, durationDots, '*r', 'MarkerSize', 15) +legend({'dotsOff-dotsOn', 'lastDraw - firstDraw'}) +title('measures of trial duration') +ylabel('duration (s)') +xlabel('trialIndex') +durationFIRA - durationDots +ans = + 0.0268 + 0.0199 + 0.0246 + 0.0170 + 0.0270 + 0.0187 + 0.0247 + 0.0185 + 0.0291 + 0.0176 +frameDurations = 1 ./ frameRate +frameDurations = + NaN + 0.0167 + NaN + 0.0158 + 0.0166 + 0.0159 + 0.0165 + NaN + 0.0159 + NaN +2 ./ frameRate +ans = + NaN + 0.0334 + NaN + 0.0316 + 0.0332 + 0.0318 + 0.0330 + NaN + 0.0319 + NaN +hold off +diary off From c75d9af8c42d21dacd24d114cb7582131479e987 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Thu, 2 Jan 2020 11:30:04 -0500 Subject: [PATCH 75/78] randomize trial sequence --- modularTasks/tasks/AdrianTests/singlecp.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index f5fb74f..889683f 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -181,7 +181,7 @@ function add_training_block(tid, name, condstop) end ttt.independentVariables=task_file; -ttt.trialIterationMethod='sequential'; +% ttt.trialIterationMethod='sequential'; ttt.randomizeWhenRepeating = false; ttt.pauseBeforeTask = pauseBeforeTask; ttt.stopCondition = 'button'; From 6ff2c00c76b4fa804bea26110132aa1af2ce5a15 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Thu, 2 Jan 2020 11:30:30 -0500 Subject: [PATCH 76/78] Revert to task version that doesn't store the dots the file modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m in the parent commit was set-up to store the dots positions from each frame on every trial in a dotsInfo task property. This setup works with the dotsDrawableDotKinetogramDebug class for the dots stimulus. In the present commit, the file modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m should be used with the dotsDrawableDotKinetogram class, and the dots positions on every frame will NOT be recorded. However, the trialData struct (and therefore the FIRA matrix) will contain the number of frames drawn before the CP (numberDrawPreCP) and the number of frames drawn after CP time (numberDrawPostCP). --- .../tasks/topsTreeNodeTaskReversingDots4AFC.m | 40 +------------------ 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index f75c19d..d2ecfdf 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -30,7 +30,6 @@ 'valsFromQuest', [], ... % % cor vals on pmf to get 'targetDistance', 8, ... 'dotsSeedBase', 1, ... - 'recordDotsPositions', true, ... 'reversalSet', [0.3 0.6 0.9], ... % if reversal<-1 'reversalType', 'time'); % 'time' or 'hazard'; see prepareDrawables @@ -98,23 +97,6 @@ 'numberDrawPreCP', ... 'numberDrawPostCP'}; - % empty struct that will later be filled, only if - % self.settings.recordDotsPositions is true. - %%%%%%%%%%%%%%%%%%%%%%%% - % Description of fields: - % dotsPositions is a 1-by-JJ cell, where JJ is the number of - % trials run in the experiment. Each entry of the - % cell will contain matrix equal to - % dotsDrawableDotKinetogram.dotsPositions - % dumpTime is a cell array of times, each computed as - % feval(self.clockFunction). - % The times are computed by the dumpDots() method, - % once at the end of every trial. They should be - % compared to the 'trialStart' time stamp in order - % to assign a sequence of dots frames to a - % particular trial. - dotsInfo = struct('dotsPositions', [], 'dumpTime', []); - % Drawables settings drawable = struct( ... ... @@ -142,7 +124,7 @@ ... ... % Dots drawable settings 'dots', struct( ... - 'fevalable', @sdotsDrawableDotKinetogramDebug, ... + 'fevalable', @dotsDrawableDotKinetogram, ... 'settings', struct( ... 'xCenter', 0, ... 'yCenter', 0, ... @@ -151,7 +133,6 @@ 'pixelSize', 6, ... 'diameter', 8, ... 'density', 150, ... - 'recordDotsPositions', true, ... 'speed', 5)), ... ... % CP Targets drawable settings 'cpScreen', struct( ... @@ -354,25 +335,6 @@ function startTrial(self) % % Could add stuff here function finishTrial(self) - %% dump dots positions and states - % by state I mean whether each dot is active or not on a particular - % frame, and whether it is coherent or not, on a particular frame - if self.settings.recordDotsPositions - - % Pre-allocate cells - if isempty(self.dotsInfo.dotsPositions) - self.dotsInfo.dotsPositions = cell(1, length(self.trialIndices)); - self.dotsInfo.dumpTime = nans(1, length(self.trialIndices)); - end - - % Save the info - self.dotsInfo.dotsPositions{self.trialCount} = ... - self.helpers.stimulusEnsemble.theObject.getObjectProperty(... - 'dotsPositions', self.dotsIndex); - self.dotsInfo.dumpTime(self.trialCount) = feval(self.clockFunction); - end - - % update running count of consecutive correct trials trial = self.getTrial(); dcorr = trial.dirCorrect; From 9a3ad0b569f1361de247d99d6d93e04453bf76ca Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Thu, 2 Jan 2020 11:51:26 -0500 Subject: [PATCH 77/78] default to Quest block first in singlecp.m --- modularTasks/tasks/AdrianTests/singlecp.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modularTasks/tasks/AdrianTests/singlecp.m b/modularTasks/tasks/AdrianTests/singlecp.m index 889683f..dcc6b05 100644 --- a/modularTasks/tasks/AdrianTests/singlecp.m +++ b/modularTasks/tasks/AdrianTests/singlecp.m @@ -13,14 +13,19 @@ function singlecp(subject_code, probCP) %-------------------------- DEFAULT ARGS dump_folder = '/Users/joshuagold/Documents/MATLAB/projects/Lab_Matlab_Control_Adrian_Fork/modularTasks/tasks/AdrianTests/trials_post_expt/'; -first_block_of_day = false; % if true, Quest block is added +first_block_of_day = true; % if true, Quest block is added + % the following variable should hold the full path to a topsDataLog.mat % file where a valid Quest block was run. This is when one wants to skip % the Quest block presently, and thus use the threshold estimated from a % prior Quest block. -quest_task_topsDataLog = '/Users/joshuagold/Users/Adrian/oneCP/raw/2019_12_13_13_37/2019_12_13_13_37_topsDataLog.mat'; +% An example path would be: +% '/Users/joshuagold/Users/Adrian/oneCP/raw/2019_12_13_13_37/2019_12_13_13_37_topsDataLog.mat' +% It is okay to leave the following variable as an empty string if +% first_block_of_day is set to true above. +quest_task_topsDataLog = ''; %-------------------------- DOTS STIMULUS PROPERTIES From d76be4b27c6514097d06a047f7a0d669526cdca4 Mon Sep 17 00:00:00 2001 From: TheGoldLab Psychophysics Date: Thu, 2 Jan 2020 14:44:03 -0500 Subject: [PATCH 78/78] really randomize seed for every trial --- modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m index d2ecfdf..80daae9 100644 --- a/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m +++ b/modularTasks/tasks/topsTreeNodeTaskReversingDots4AFC.m @@ -572,7 +572,7 @@ function prepareDrawables(self) end % Set the seed base for the random number generator - trial.randSeedBase = trial.trialIndex; %sum(clock*10); + trial.randSeedBase = sum(clock*10); % Set the dots duration if not already given in trial struct if ~isfinite(trial.duration)