|
1 | | -function cfg = apertureTexture(action, cfg, thisEvent) |
| 1 | +function [cfg, thisEvent] = apertureTexture(action, cfg, thisEvent) |
2 | 2 |
|
3 | 3 | transparent = [0 0 0 0]; |
4 | 4 |
|
|
15 | 15 | cfg.aperture.width = cfg.screen.winRect(4) / cfg.screen.ppd; |
16 | 16 | end |
17 | 17 | cfg.aperture = degToPix('width', cfg.aperture, cfg); |
| 18 | + |
| 19 | + case 'ring' |
| 20 | + |
| 21 | + % Set parameters for rings |
| 22 | + if strcmp(cfg.aperture.type ,'ring') |
| 23 | + % scale of outer ring (exceeding screen until |
| 24 | + % inner ring reaches window boarder) |
| 25 | + cfg.ring.maxEcc = ... |
| 26 | + cfg.screen.FOV / 2 + ... |
| 27 | + cfg.aperture.width + ... |
| 28 | + log(cfg.screen.FOV / 2 + 1) ; |
| 29 | + % ring.CsFuncFact is used to expand with log increasing speed so |
| 30 | + % that ring is at ring.maxEcc at end of cycle |
| 31 | + cfg.ring.csFuncFact = ... |
| 32 | + 1 / ... |
| 33 | + ((cfg.ring.maxEcc + exp(1)) * ... |
| 34 | + log(cfg.ring.maxEcc + exp(1)) - ... |
| 35 | + (cfg.ring.maxEcc + exp(1))) ; |
| 36 | + end |
18 | 37 | end |
19 | 38 |
|
20 | 39 | cfg.aperture.texture = Screen('MakeTexture', cfg.screen.win, ... |
|
48 | 67 |
|
49 | 68 | case 'ring' |
50 | 69 |
|
| 70 | + % expansion speed is log over eccentricity |
| 71 | + [cfg] = eccenLogSpeed(cfg, thisEvent.time); |
| 72 | + |
51 | 73 | Screen('Fillrect', cfg.aperture.texture, cfg.color.background); |
52 | 74 |
|
53 | 75 | Screen('FillOval', cfg.aperture.texture, transparent, ... |
|
62 | 84 |
|
63 | 85 | case 'wedge' |
64 | 86 |
|
| 87 | + cycleDuration = cfg.mri.repetitionTime * cfg.volsPerCycle; |
| 88 | + |
| 89 | + % Update angle for rotation of background and for apperture for wedge |
| 90 | + switch cfg.direction |
| 91 | + |
| 92 | + case '+' |
| 93 | + thisEvent.angle = 90 - ... |
| 94 | + cfg.aperture.width / 2 + ... |
| 95 | + (thisEvent.time / cycleDuration) * 360; |
| 96 | + case '-' |
| 97 | + thisEvent.angle = 90 - ... |
| 98 | + cfg.aperture.width / 2 - ... |
| 99 | + (thisEvent.time / cycleDuration) * 360; |
| 100 | + |
| 101 | + end |
| 102 | + |
65 | 103 | Screen('Fillrect', cfg.aperture.texture, cfg.color.background); |
66 | 104 |
|
67 | 105 | Screen('FillArc', cfg.aperture.texture, transparent, ... |
|
0 commit comments