Skip to content

Commit c63591b

Browse files
committed
simplify static event dot poisition repeats targets
1 parent 42feacb commit c63591b

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

setParameters.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
%% Timing
6262

6363
% FOR 7T: if you want to create localizers on the fly, the following must be
64-
% multiples of the scanneryour sequence TR
64+
% multiples of the scanner sequence TR
6565
%
6666
% IBI
6767
% block length = (cfg.eventDuration + cfg.ISI) * cfg.design.nbEventsPerBlock
@@ -126,7 +126,6 @@
126126

127127
% Fixation cross (in pixels)
128128
cfg.fixation.type = 'cross';
129-
cfg.fixation.colorTarget = cfg.color.red;
130129
cfg.fixation.color = cfg.color.white;
131130
cfg.fixation.width = .25;
132131
cfg.fixation.lineWidthPix = 3;
@@ -136,9 +135,14 @@
136135
% target
137136
cfg.target.maxNbPerBlock = 1;
138137
cfg.target.duration = 0.1; % In secs
139-
cfg.target.type = 'fixation_cross';
138+
cfg.target.type = 'static_repeat';
140139
% 'fixation_cross' : the fixation cross changes color
141-
% 'static_repeat' : dots are in the same position
140+
% 'static_repeat' : static dots are in the same position as previous trials
141+
142+
cfg.fixation.colorTarget = cfg.fixation.color;
143+
if strcmp(cfg.target.type, 'fixation_cross')
144+
cfg.fixation.colorTarget = cfg.color.red;
145+
end
142146

143147
cfg.extraColumns = { ...
144148
'direction', ...

subfun/doDotMo.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
% We then draw an aperture on top to hide the certain dots.
1919

2020
%% Get parameters
21-
if ~(strcmp(thisEvent.trial_type, 'static') && thisEvent.target == 1) || ...
22-
isempty(dots)
21+
if isempty(dots)
2322
dots = initDots(cfg, thisEvent);
2423
end
2524

visualMotionLocalizer.m

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@
3434

3535
[el] = eyeTracker('Calibration', cfg);
3636

37-
% if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
38-
% [cfg] = expDesignMtMst(cfg);
39-
% else
4037
[cfg] = expDesign(cfg);
41-
% end
4238

4339
% Prepare for the output logfiles with all
4440
logFile.extraColumns = cfg.extraColumns;
@@ -77,8 +73,10 @@
7773
fprintf('\n - Running Block %.0f \n', iBlock);
7874

7975
eyeTracker('Message', cfg, ['start_block-', num2str(iBlock)]);
76+
8077
dots = [];
8178
previousEvent.target = 0;
79+
8280
% For each event in the block
8381
for iEvent = 1:cfg.design.nbEventsPerBlock
8482

@@ -99,10 +97,15 @@
9997
eyeTracker('Message', cfg, ...
10098
['start_trial-', num2str(iEvent), '_', thisEvent.trial_type]);
10199

102-
% we want to initialize the dots position when targets type is fixation cross
103-
% or if this the first event of a target pair
100+
% we only reuse the dots position for targets that consists of
101+
% presenting static dots with the same position as those of the
102+
% previous trial
103+
%
104+
% TODO does not take into account what to do if 3 or more targets in a row
104105
if strcmp(cfg.target.type, 'static_repeat') && ...
105-
thisEvent.target == previousEvent.target
106+
strcmp(thisEvent.trial_type, 'static') && ...
107+
thisEvent.target == 1 && ...
108+
thisEvent.target == previousEvent.target
106109
else
107110
dots = [];
108111
end

0 commit comments

Comments
 (0)