Skip to content

Commit a156468

Browse files
authored
Merge pull request #79 from Remi-Gau/dev
simplify code for static dot position repeats
2 parents 4f379d8 + f6f82ab commit a156468

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

lib/CPP_PTB

setParameters.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
%% Timing
6464

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

131131
% Fixation cross (in pixels)
132132
cfg.fixation.type = 'cross';
133-
cfg.fixation.colorTarget = cfg.color.red;
134133
cfg.fixation.color = cfg.color.white;
135134
cfg.fixation.width = .25;
136135
cfg.fixation.lineWidthPix = 3;
@@ -142,7 +141,12 @@
142141
cfg.target.duration = 0.1; % In secs
143142
cfg.target.type = 'fixation_cross';
144143
% 'fixation_cross' : the fixation cross changes color
145-
% 'static_repeat' : dots are in the same position
144+
% 'static_repeat' : static dots are in the same position as previous trials
145+
146+
cfg.fixation.colorTarget = cfg.fixation.color;
147+
if strcmp(cfg.target.type, 'fixation_cross')
148+
cfg.fixation.colorTarget = cfg.color.red;
149+
end
146150

147151
cfg.extraColumns = { ...
148152
'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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@
7777
fprintf('\n - Running Block %.0f \n', iBlock);
7878

7979
eyeTracker('Message', cfg, ['start_block-', num2str(iBlock)]);
80+
8081
dots = [];
8182
previousEvent.target = 0;
83+
8284
% For each event in the block
8385
for iEvent = 1:cfg.design.nbEventsPerBlock
8486

@@ -99,10 +101,15 @@
99101
eyeTracker('Message', cfg, ...
100102
['start_trial-', num2str(iEvent), '_', thisEvent.trial_type]);
101103

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
104+
% we only reuse the dots position for targets that consists of
105+
% presenting static dots with the same position as those of the
106+
% previous trial
107+
%
108+
% TODO does not take into account what to do if 3 or more targets in a row
104109
if strcmp(cfg.target.type, 'static_repeat') && ...
105-
thisEvent.target == previousEvent.target
110+
strcmp(thisEvent.trial_type, 'static') && ...
111+
thisEvent.target == 1 && ...
112+
thisEvent.target == previousEvent.target
106113
else
107114
dots = [];
108115
end

0 commit comments

Comments
 (0)