Skip to content

Commit 13aa8f6

Browse files
authored
Merge pull request #75 from iqrashahzad14/target_same
TargetsRepeat
2 parents faeaa1d + 039b2db commit 13aa8f6

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

setParameters.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,12 @@
133133
cfg.fixation.xDisplacement = 0;
134134
cfg.fixation.yDisplacement = 0;
135135

136+
% target
136137
cfg.target.maxNbPerBlock = 1;
137138
cfg.target.duration = 0.1; % In secs
139+
cfg.target.type = 'fixation_cross';
140+
% 'fixation_cross' : the fixation cross changes color
141+
% 'static_repeat' : dots are in the same position
138142

139143
cfg.extraColumns = { ...
140144
'direction', ...

subfun/doDotMo.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% (C) Copyright 2018 Mohamed Rezk
22
% (C) Copyright 2020 CPP visual motion localizer developpers
33

4-
function [onset, duration] = doDotMo(cfg, thisEvent, thisFixation)
4+
function [onset, duration, dots] = doDotMo(cfg, thisEvent, thisFixation, dots)
55
% Draws the stimulation of static/moving in 4 directions dots or static
66
%
77
% DIRECTIONS
@@ -18,8 +18,10 @@
1818
% We then draw an aperture on top to hide the certain dots.
1919

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

2426
% Set for how many frames this event will last
2527
framesLeft = floor(cfg.timing.eventDuration / cfg.screen.ifi);

visualMotionLocalizer.m

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@
7777
fprintf('\n - Running Block %.0f \n', iBlock);
7878

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

@@ -98,8 +99,16 @@
9899
eyeTracker('Message', cfg, ...
99100
['start_trial-', num2str(iEvent), '_', thisEvent.trial_type]);
100101

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+
if strcmp(cfg.target.type, 'static_repeat') && ...
105+
thisEvent.target == previousEvent.target
106+
else
107+
dots = [];
108+
end
109+
101110
% play the dots and collect onset and duraton of the event
102-
[onset, duration] = doDotMo(cfg, thisEvent, thisFixation);
111+
[onset, duration, dots] = doDotMo(cfg, thisEvent, thisFixation, dots);
103112

104113
thisEvent = preSaveSetup( ...
105114
thisEvent, ...
@@ -121,6 +130,8 @@
121130
eyeTracker('Message', cfg, ...
122131
['end_trial-', num2str(iEvent), '_', thisEvent.trial_type]);
123132

133+
previousEvent = thisEvent;
134+
124135
waitFor(cfg, cfg.timing.ISI);
125136

126137
end

0 commit comments

Comments
 (0)