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
1 change: 1 addition & 0 deletions initEnv.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function addDependencies()
pth = fileparts(mfilename('fullpath'));
addpath(fullfile(pth, 'lib', 'CPP_BIDS', 'src'));
addpath(fullfile(pth, 'lib', 'CPP_PTB'));
addpath(genpath(fullfile(pth, 'lib', 'CPP_PTB', 'src')));
addpath(fullfile(pth, 'subfun'));

end
25 changes: 17 additions & 8 deletions setParameters.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'output');

%% Debug mode settings

cfg.debug.do = true; % 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
Expand All @@ -34,22 +34,31 @@

%% Experiment Design

% cfg.design.motionType = 'translation';
% cfg.design.motionType = 'radial';
cfg.design.motionType = 'translation';
cfg.design.names = {'static'; 'motion'};
cfg.design.nbRepetitions = 4;
cfg.design.nbEventsPerBlock = 12; % DO NOT CHANGE

%% Timing

% FOR 7T: if you want to create localizers on the fly, the following must be
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our TR will be around 1.8 ms and we to have only one "condition" per volume so we have to make sure some of our parameters are a multiple of the TR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add an automatic check for this that send an error in case we don't the math wrong.

% multiples of the scanneryour sequence TR
%
% IBI
% block length = (cfg.eventDuration + cfg.ISI) * cfg.design.nbEventsPerBlock

% Time between blocs in secs
cfg.IBI = .5; % 8;
cfg.IBI = 1.8*3; % 8;
% Time between events in secs
cfg.ISI = 0.5;
cfg.ISI = 0.1;
% Number of seconds before the motion stimuli are presented
cfg.onsetDelay = .1;
% Number of seconds after the end all the stimuli before ending the run
cfg.endDelay = .1;

cfg.eventDuration = 1; % second
cfg.eventDuration = 0.8; % second

%% Visual Stimulation

Expand Down Expand Up @@ -91,13 +100,13 @@
cfg.target.maxNbPerBlock = 2;
cfg.target.duration = 0.05; % In secs

cfg.extraColumns = {'direction', 'speed', 'target', 'event', 'block'};
cfg.extraColumns = {'direction', 'speed', 'target', 'event', 'block', 'keyName'};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for extra precautions we wanto also collect the key pressed by the subject to distinguish keypresses from trigger


end

function cfg = setKeyboards(cfg)
cfg.keyboard.escapeKey = 'ESCAPE';
cfg.keyboard.responseKey = {'space'};
cfg.keyboard.responseKey = {'space', 't'};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will be monitoring the trigger keys on the same KbQueue as the responses so we need automate adding the value from cfg.mri.triggeyKey to cfg.keyboard.responseKey

cfg.keyboard.keyboard = [];
cfg.keyboard.responseBox = [];

Expand All @@ -112,7 +121,7 @@
cfg.mri.triggerKey = 't';
cfg.mri.triggerNb = 4;

cfg.mri.repetitionTime = 2;
cfg.mri.repetitionTime = 1.8;

cfg.bids.MRI.Instructions = 'Detect the RED fixation cross';
cfg.bids.MRI.TaskDescription = [];
Expand Down
2 changes: 1 addition & 1 deletion subfun/doDotMo.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
% We assumed that zero is at the top left, but we want it to be
% in the center, so shift the dots up and left, which just means
% adding half of the screen width in pixel to both the x and y direction.
thisEvent.dot.positions = (dots.positions - cfg.screen.winWidth / 2)';
thisEvent.dot.positions = (dots.positions - cfg.dot.matrixWidth / 2)';

%% make textures
dotTexture('make', cfg, thisEvent);
Expand Down
Loading