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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/CPP_BIDS
Submodule CPP_BIDS updated 50 files
+17 −4 .all-contributorsrc
+18 −0 .github/workflows/check_md_links.yml
+39 −0 .github/workflows/miss_hit.yml
+13 −0 .prettierrc
+11 −0 .remarkrc
+17 −9 .travis.yml
+51 −35 README.md
+50 −29 docs/functions_description.md
+23 −16 docs/installation.md
+1 −1 lib/bids-matlab
+2 −2 manualTests/test_createDataDictionary.m
+4 −4 manualTests/test_createJson.m
+14 −14 manualTests/test_makeRawDataset.m
+1 −1 miss_hit.cfg
+6 −0 npm-requirements.txt
+6 −4 src/checkCFG.m
+11 −6 src/convertSourceToRaw.m
+16 −14 src/createDataDictionary.m
+4 −2 src/createDatasetDescription.m
+34 −32 src/createFilename.m
+9 −6 src/createJson.m
+0 −3 src/miss_hit.cfg
+35 −27 src/saveEventsFile.m
+2 −0 src/subfun/askForGroupAndOrSession.m
+2 −0 src/subfun/askUserCli.m
+9 −7 src/subfun/askUserGui.m
+4 −2 src/subfun/checkCppBidsDependencies.m
+2 −0 src/subfun/createQuestionList.m
+2 −0 src/subfun/createValidName.m
+2 −0 src/subfun/getIsQuestionToAsk.m
+5 −3 src/subfun/initializeExtraColumns.m
+7 −5 src/subfun/isPositiveInteger.m
+10 −8 src/subfun/printCreditsCppBids.m
+11 −4 src/subfun/removeAllDateSuffix.m
+3 −1 src/subfun/removeDateSuffix.m
+2 −0 src/subfun/returnHeaderName.m
+2 −0 src/subfun/returnNamesExtraColumns.m
+2 −0 src/subfun/returnNbColumns.m
+5 −3 src/subfun/setDefaultFields.m
+2 −0 src/subfun/setDefaultResponses.m
+2 −0 src/subfun/transferInfoToBids.m
+2 −0 src/userInputs.m
+1 −1 tests/test_checkCFG.m
+25 −25 tests/test_createFilename.m
+5 −5 tests/test_createJson.m
+4 −4 tests/test_createQuestionList.m
+10 −10 tests/test_getIsQuestionToAsk.m
+12 −8 tests/test_removeDateSuffix.m
+4 −2 tests/test_saveEventsFileOpen.m
+3 −3 tests/test_saveEventsFileSave.m
2 changes: 1 addition & 1 deletion lib/CPP_PTB
Submodule CPP_PTB updated 58 files
+18 −4 .all-contributorsrc
+18 −0 .github/workflows/check_md_links.yml
+39 −0 .github/workflows/miss_hit.yml
+13 −0 .prettierrc
+11 −0 .remarkrc
+14 −10 .travis.yml
+75 −50 README.md
+3 −3 demos/CPP_getResponseDemo.m
+5 −5 dev/devSandbox.m
+74 −51 docs/00-index.md
+219 −0 docs/10-functions-description.md
+0 −203 docs/10_functions_description.md
+1 −1 manualTests/test_getResponse.m
+21 −0 manualTests/test_radialMotion.m
+6 −0 npm-requirements.txt
+125 −116 src/aperture/apertureTexture.m
+1 −1 src/aperture/eccenLogSpeed.m
+4 −4 src/dot/computeCartCoord.m
+3 −3 src/dot/computeRadialMotionDirection.m
+107 −0 src/dot/dotMotionSimulation.m
+10 −6 src/dot/dotTexture.m
+2 −2 src/dot/generateNewDotPositions.m
+8 −30 src/dot/initDots.m
+12 −13 src/dot/reseedDots.m
+28 −0 src/dot/seedDots.m
+21 −16 src/dot/setDotDirection.m
+6 −6 src/drawFieldOfVIew.m
+3 −3 src/errors/errorDistanceToScreen.m
+28 −17 src/eyeTracker.m
+33 −33 src/fixation/drawFixation.m
+8 −8 src/fixation/initFixation.m
+2 −2 src/getExperimentEnd.m
+19 −15 src/initPTB.m
+2 −2 src/keyboard/checkAbortGetResponse.m
+2 −2 src/keyboard/getResponse.m
+0 −50 src/readAndFilterLogfile.m
+2 −2 src/screen/standByScreen.m
+9 −9 src/utils/checkPtbVersion.m
+1 −1 src/utils/degToPix.m
+1 −1 src/utils/pixToDeg.m
+4 −4 src/utils/printCreditsCppPtb.m
+6 −6 src/utils/setDefaults.m
+2 −0 src/utils/setDefaultsPTB.m
+42 −0 src/utils/setUpRand.m
+4 −4 src/waitFor.m
+2 −2 src/waitForTrigger.m
+0 −0 test-2.py
+0 −0 test-permission.py
+1 −1 tests/test_checkAbortGetResponse.m
+1 −1 tests/test_computeFOV.m
+15 −17 tests/test_computeRadialMotionDirection.m
+48 −0 tests/test_dotMotionSimulation.m
+2 −2 tests/test_generateNewDotPositions.m
+2 −5 tests/test_initDots.m
+25 −27 tests/test_reseedDots.m
+37 −0 tests/test_seedDots.m
+15 −13 tests/test_setDefaultsPTB.m
+39 −8 tests/test_setDotDirection.m
76 changes: 47 additions & 29 deletions setParameters.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

cfg.debug.do = false; % To test the script out of the scanner, skip PTB sync
cfg.debug.smallWin = false; % To test on a part of the screen, change to 1
cfg.debug.transpWin = true; % To test with trasparent full size screen
cfg.debug.transpWin = false; % To test with trasparent full size screen

cfg.verbose = false;
cfg.verbose = 2;

%% Engine parameters

Expand All @@ -40,20 +40,22 @@

%% Experiment Design

% cfg.design.localizer = 'MT_MST';
% switching this on to MT or MT/MST with use:
% - MT: translational motion on the whole screen
% - alternates static and motion (left or right) blocks
% - MST: radial motion centered in a circle aperture that is on the opposite
% side of the screen relative to the fixation
% - alternates fixaton left and fixation right
cfg.design.localizer = 'MT';
% cfg.design.localizer = 'MT_MST';

% cfg.design.motionType = 'radial';
cfg.design.motionType = 'translation';

cfg.design.motionDirections = [0 0 180 180];
cfg.design.names = {'static'; 'motion'};

cfg.design.nbRepetitions = 8;
cfg.design.nbEventsPerBlock = 12; % DO NOT CHANGE

if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
cfg.design.names = {'fixation_right'; 'fixation_left'};
end

%% Timing

% FOR 7T: if you want to create localizers on the fly, the following must be
Expand All @@ -73,10 +75,6 @@
% Number of seconds after the end all the stimuli before ending the run
cfg.timing.endDelay = 3.6;

if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
cfg.timing.IBI = 3.6;
end

% reexpress those in terms of repetition time
if cfg.pacedByTriggers.do

Expand All @@ -94,10 +92,6 @@
% Number of seconds after the end all the stimuli before ending the run
cfg.timing.endDelay = 2;

if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
cfg.timing.IBI = 2;
end

end

%% Visual Stimulation
Expand All @@ -109,9 +103,9 @@
% Number of dots per visual angle square.
cfg.dot.density = 1;
% Dot life time in seconds
cfg.dot.lifeTime = .15;
cfg.dot.lifeTime = .4;
% proportion of dots killed per frame
cfg.dot.proportionKilledPerFrame = 0.005;
cfg.dot.proportionKilledPerFrame = 0;
% Dot Size (dot width) in visual angles.
cfg.dot.size = .2;
cfg.dot.color = cfg.color.white;
Expand All @@ -121,18 +115,9 @@
cfg.aperture.width = []; % if left empty it will take the screen height
cfg.aperture.xPos = 0;

if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
cfg.aperture.type = 'circle';
cfg.aperture.width = 7; % if left empty it will take the screen height
cfg.aperture.xPos = 7;
end

%% Task(s)

cfg.task.name = 'visual localizer';
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
cfg.task.name = 'mt mst localizer';
end

% Instruction
cfg.task.instruction = '1-Detect the RED fixation cross\n \n\n';
Expand All @@ -147,7 +132,7 @@
cfg.fixation.yDisplacement = 0;

cfg.target.maxNbPerBlock = 1;
cfg.target.duration = 0.05; % In secs
cfg.target.duration = 0.1; % In secs

cfg.extraColumns = { ...
'direction', ...
Expand All @@ -159,6 +144,9 @@
'fixationPosition', ...
'aperturePosition'};

%% orverrireds the relevant fields in case we use the MT / MST localizer
cfg = setParametersMtMst(cfg);

end

function cfg = setKeyboards(cfg)
Expand Down Expand Up @@ -206,4 +194,34 @@
cfg.screen.monitorWidth = 25;
cfg.screen.monitorDistance = 95;
end

end

function cfg = setParametersMtMst(cfg)

if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')

cfg.task.name = 'mt mst localizer';

cfg.design.motionType = 'radial';
cfg.design.motionDirections = [666 666 -666 -666];
cfg.design.names = {'fixation_right'; 'fixation_left'};
cfg.design.xDisplacementFixation = 7;
cfg.design.xDisplacementAperture = 3;

cfg.timing.IBI = 3.6;

% reexpress those in terms of repetition time
if cfg.pacedByTriggers.do

cfg.timing.IBI = 2;

end

cfg.aperture.type = 'circle';
cfg.aperture.width = 7; % if left empty it will take the screen height
cfg.aperture.xPos = cfg.design.xDisplacementAperture;

end

end
3 changes: 2 additions & 1 deletion subfun/doDotMo.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@

apertureTexture('draw', cfg, thisEvent);

if thisEvent.target(1) && GetSecs < (onset + cfg.target.duration)
thisFixation.fixation.color = cfg.fixation.color;
if thisEvent.target(1) && vbl < (onset + cfg.target.duration)
thisFixation.fixation.color = cfg.fixation.colorTarget;
end
drawFixation(thisFixation);
Expand Down
19 changes: 17 additions & 2 deletions subfun/preTrialSetup.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,32 @@
thisFixation.fixation = cfg.fixation;
thisFixation.screen = cfg.screen;

% ThisEvent.dotCenterXPosPix determines by how much the dot matrix has to be
% shifted relative to the center of the screen.
% By default it is centered on screen but for the MT/MST localizer we
% shift so the center of the radial motion is matched to that of the
% aperture on the side of the screen.
%
% Meanwhile the cross is shifted on the opposite side
%

thisEvent.dotCenterXPosPix = 0;

switch thisEvent.trial_type
case 'fixation_right'
cfg.aperture.xPosPix = -abs(cfg.aperture.xPosPix);

thisFixation.fixation.xDisplacement = cfg.aperture.xPos;
thisEvent.dotCenterXPosPix = cfg.aperture.xPosPix;

thisFixation.fixation.xDisplacement = cfg.design.xDisplacementFixation;
thisFixation = initFixation(thisFixation);

case 'fixation_left'
cfg.aperture.xPosPix = +abs(cfg.aperture.xPosPix);

thisFixation.fixation.xDisplacement = -cfg.aperture.xPos;
thisEvent.dotCenterXPosPix = cfg.aperture.xPosPix;

thisFixation.fixation.xDisplacement = -cfg.design.xDisplacementFixation;
thisFixation = initFixation(thisFixation);

end
Expand Down
File renamed without changes.