|
6 | 6 | % |
7 | 7 | % Here, a tutorial from https://peterscarfe.com/contrastgratingdemo.html is |
8 | 8 | % provided for illustrative purpose (notice that some vars' name are updated |
9 | | -% to our code style). |
| 9 | +% to our code style). For your use, you will delete that part. |
10 | 10 | % |
11 | 11 | % It is composed of two parts: |
12 | 12 | % - a fixed structure that will initialize and close PTB in 'debug mode' |
|
20 | 20 | % github repo, therefore it should be easy to move everything in your experiment |
21 | 21 | % scripts (see the template that is annexed in `cpp-lln-lab/CPP_PTB`) |
22 | 22 |
|
23 | | - |
| 23 | +% Init the structure that will contain PTB setup |
24 | 24 | cfg = struct; |
25 | 25 |
|
| 26 | +% Set the PTB window background manually |
26 | 27 | cfg.backgroundColor = [ 127 127 127 ]; |
27 | 28 |
|
| 29 | +% Init PTB, see the Sub-Functions below |
28 | 30 | cfg = devSandbox_initPTB(cfg); |
29 | 31 |
|
30 | 32 | %% |
|
58 | 60 | % ------------------------------------------------------------------------- |
59 | 61 | %% |
60 | 62 |
|
| 63 | +% Catch the error and restore your computer for debugging |
61 | 64 | try |
62 | 65 |
|
63 | 66 | %% |
64 | 67 | % ------------------------------------------------------------------------- |
65 | 68 | % ------------------------------ PLAYGROUND ------------------------------- |
66 | 69 | % ------------------------------------------------------------------------- |
67 | | - % Define Half-Size of the grating image. |
| 70 | +% Define Half-Size of the grating image. |
68 | 71 | texsize = gratingSizePix / 2; |
69 | 72 |
|
70 | 73 | % First we compute pixels per cycle rounded to the nearest pixel |
|
150 | 153 | % ------------------------------------------------------------------------- |
151 | 154 | %% |
152 | 155 |
|
| 156 | +% Close PTB, see the Sub-Functions below |
153 | 157 | devSandbox_cleanUp |
154 | 158 |
|
155 | 159 | catch |
|
162 | 166 |
|
163 | 167 | end |
164 | 168 |
|
165 | | - |
| 169 | +%% Sub-Functions |
166 | 170 | function cfg = devSandbox_initPTB(cfg) |
167 | 171 |
|
| 172 | +% Shorter version of `initPTB.m` |
| 173 | + |
| 174 | +% Skip the PTB sync test |
168 | 175 | Screen('Preference', 'SkipSyncTests', 2); |
169 | 176 |
|
| 177 | +% Open a transparent window |
170 | 178 | PsychDebugWindowConfiguration |
171 | 179 |
|
172 | 180 | % Here we call some default settings for setting up Psychtoolbox |
|
0 commit comments