|
4 | 4 | cfg.fixation = degToPix('width', cfg.fixation, cfg); |
5 | 5 | cfg.fixation = degToPix('xDisplacement', cfg.fixation, cfg); |
6 | 6 | cfg.fixation = degToPix('yDisplacement', cfg.fixation, cfg); |
7 | | - |
8 | | - if strcmp(cfg.fixation.type, 'cross') |
9 | | - |
10 | | - % Prepare fixation cross |
11 | | - cfg.fixation.xCoords = [-cfg.fixation.widthPix cfg.fixation.widthPix 0 0] / 2 + ... |
12 | | - cfg.fixation.xDisplacementPix; |
13 | | - cfg.fixation.yCoords = [0 0 -cfg.fixation.widthPix cfg.fixation.widthPix] / 2 + ... |
14 | | - cfg.fixation.yDisplacementPix; |
15 | | - cfg.fixation.allCoords = [cfg.fixation.xCoords; cfg.fixation.yCoords]; |
16 | | - |
| 7 | + |
| 8 | + % Prepare fixation cross |
| 9 | + xLine = [-cfg.fixation.widthPix cfg.fixation.widthPix 0 0] / 2; |
| 10 | + yLine = [0 0 -cfg.fixation.widthPix cfg.fixation.widthPix] / 2; |
| 11 | + |
| 12 | + cfg.fixation.xCoords = xLine + cfg.fixation.xDisplacementPix; |
| 13 | + cfg.fixation.yCoords = yLine + cfg.fixation.yDisplacementPix; |
| 14 | + |
| 15 | + cfg.fixation.allCoords = [cfg.fixation.xCoords; cfg.fixation.yCoords]; |
| 16 | + |
| 17 | + switch cfg.fixation.type |
| 18 | + |
| 19 | + case 'bestFixation' |
| 20 | + |
| 21 | + % Code adapted from: |
| 22 | + % What is the best fixation target? |
| 23 | + % DOI 10.1016/j.visres.2012.10.012 |
| 24 | + |
| 25 | + cfg.fixation.outerOval = [... |
| 26 | + cfg.screen.center(1)-cfg.fixation.widthPix/2, ... |
| 27 | + cfg.screen.center(2)-cfg.fixation.widthPix/2, ... |
| 28 | + cfg.screen.center(1)+cfg.fixation.widthPix/2, ... |
| 29 | + cfg.screen.center(2)+cfg.fixation.widthPix/2]; |
| 30 | + |
| 31 | + cfg.fixation.innerOval = [... |
| 32 | + cfg.screen.center(1)-cfg.fixation.widthPix/6, ... |
| 33 | + cfg.screen.center(2)-cfg.fixation.widthPix/6, ... |
| 34 | + cfg.screen.center(1)+cfg.fixation.widthPix/6, ... |
| 35 | + cfg.screen.center(2)+cfg.fixation.widthPix/6]; |
| 36 | + |
17 | 37 | end |
18 | | - |
| 38 | + |
19 | 39 | end |
0 commit comments