11function varargout = preTrialSetup(varargin )
22 % varargout = postInitializatinSetup(varargin)
33
4- % generic function to finalize some set up after psychtoolbox has been
5- % initialized
4+ % generic function to prepare some structure before each trial
65
76 [cfg , iBlock , iEvent ] = deal(varargin{: });
87
98 % set direction, speed of that event and if it is a target
109 thisEvent.trial_type = cfg.design.blockNames{iBlock };
1110 thisEvent.direction = cfg .design .directions(iBlock , iEvent );
1211 thisEvent.speed = cfg .design .speeds(iBlock , iEvent );
13- thisEvent.target = cfg .design .fixationTargets(iBlock , iEvent );
12+ thisEvent.target = cfg .design .fixationTargets(iBlock , iEvent );
1413
1514 % If this frame shows a target we change the color of the cross
1615 thisFixation.fixation = cfg .fixation ;
1716 thisFixation.screen = cfg .screen ;
17+
18+ switch thisEvent .trial_type
19+ case ' fixation_right'
20+ cfg.aperture.xPosPix = - abs(cfg .aperture .xPosPix );
21+
22+ thisFixation.fixation.xDisplacement = cfg .aperture .xPos ;
23+ thisFixation = initFixation(thisFixation );
24+
25+ case ' fixation_left'
26+ cfg.aperture.xPosPix = + abs(cfg .aperture .xPosPix );
27+
28+ thisFixation.fixation.xDisplacement = - cfg .aperture .xPos ;
29+ thisFixation = initFixation(thisFixation );
30+
31+ end
32+
33+ varargout = {thisEvent , thisFixation , cfg };
34+
1835
19- varargout = {thisEvent , thisFixation };
2036
2137end
0 commit comments