Skip to content

Commit 7bc1a21

Browse files
authored
Merge pull request #25 from Remi-Gau/remi-save_stim_file
saving triggers in tsv file
2 parents ba1a20c + e47b8d6 commit 7bc1a21

File tree

7 files changed

+183
-127
lines changed

7 files changed

+183
-127
lines changed

initEnv.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ function addDependencies()
8888
pth = fileparts(mfilename('fullpath'));
8989
addpath(fullfile(pth, 'lib', 'CPP_BIDS', 'src'));
9090
addpath(fullfile(pth, 'lib', 'CPP_PTB'));
91+
addpath(genpath(fullfile(pth, 'lib', 'CPP_PTB', 'src')));
9192
addpath(fullfile(pth, 'subfun'));
9293

9394
end

setParameters.m

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
'output');
1212

1313
%% Debug mode settings
14-
14+
1515
cfg.debug.do = true; % To test the script out of the scanner, skip PTB sync
1616
cfg.debug.smallWin = false; % To test on a part of the screen, change to 1
1717
cfg.debug.transpWin = true; % To test with trasparent full size screen
@@ -34,22 +34,31 @@
3434

3535
%% Experiment Design
3636

37+
% cfg.design.motionType = 'translation';
38+
% cfg.design.motionType = 'radial';
39+
cfg.design.motionType = 'translation';
3740
cfg.design.names = {'static'; 'motion'};
3841
cfg.design.nbRepetitions = 4;
3942
cfg.design.nbEventsPerBlock = 12; % DO NOT CHANGE
4043

4144
%% Timing
4245

46+
% FOR 7T: if you want to create localizers on the fly, the following must be
47+
% multiples of the scanneryour sequence TR
48+
%
49+
% IBI
50+
% block length = (cfg.eventDuration + cfg.ISI) * cfg.design.nbEventsPerBlock
51+
4352
% Time between blocs in secs
44-
cfg.IBI = .5; % 8;
53+
cfg.IBI = 1.8*3; % 8;
4554
% Time between events in secs
46-
cfg.ISI = 0.5;
55+
cfg.ISI = 0.1;
4756
% Number of seconds before the motion stimuli are presented
4857
cfg.onsetDelay = .1;
4958
% Number of seconds after the end all the stimuli before ending the run
5059
cfg.endDelay = .1;
5160

52-
cfg.eventDuration = 1; % second
61+
cfg.eventDuration = 0.8; % second
5362

5463
%% Visual Stimulation
5564

@@ -91,13 +100,13 @@
91100
cfg.target.maxNbPerBlock = 2;
92101
cfg.target.duration = 0.05; % In secs
93102

94-
cfg.extraColumns = {'direction', 'speed', 'target', 'event', 'block'};
95-
103+
cfg.extraColumns = {'direction', 'speed', 'target', 'event', 'block', 'keyName'};
104+
96105
end
97106

98107
function cfg = setKeyboards(cfg)
99108
cfg.keyboard.escapeKey = 'ESCAPE';
100-
cfg.keyboard.responseKey = {'space'};
109+
cfg.keyboard.responseKey = {'space', 't'};
101110
cfg.keyboard.keyboard = [];
102111
cfg.keyboard.responseBox = [];
103112

@@ -112,7 +121,7 @@
112121
cfg.mri.triggerKey = 't';
113122
cfg.mri.triggerNb = 4;
114123

115-
cfg.mri.repetitionTime = 2;
124+
cfg.mri.repetitionTime = 1.8;
116125

117126
cfg.bids.MRI.Instructions = 'Detect the RED fixation cross';
118127
cfg.bids.MRI.TaskDescription = [];

subfun/doDotMo.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
% We assumed that zero is at the top left, but we want it to be
3434
% in the center, so shift the dots up and left, which just means
3535
% adding half of the screen width in pixel to both the x and y direction.
36-
thisEvent.dot.positions = (dots.positions - cfg.screen.winWidth / 2)';
36+
thisEvent.dot.positions = (dots.positions - cfg.dot.matrixWidth / 2)';
3737

3838
%% make textures
3939
dotTexture('make', cfg, thisEvent);

0 commit comments

Comments
 (0)