You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remember that updates to submodules need to be committed as well.
83
102
84
-
#### Example for submodule usage
103
+
#### 3.2.1. <aname='Exampleforsubmoduleusage'></a>Example for submodule usage
85
104
86
105
So say you want to clone a repo that has some nested submodules, then you would type this to get the content of all the submodules at once (here with my experiment repo):
pros: in principle, downloading the experiment you have the whole package plus the benefit to stay updated and use version control of this dependency. Can probably handle a use case in which one uses different version on different projects (e.g. older and newer projects).
110
-
cons: for pro users and not super clear how to use it at the moment. -->
<!-- Download a specific version and c/p it in a subfun folder
126
-
pros: the easiest solution to share the code and 'installing' it on the stimulation computer (usually not the one used to develop the code).
127
-
cons: extreme solution useful only at the very latest stage (i.e. one minute before acquiring your data); prone to be customized/modified (is it what we want?) -->
128
-
129
-
## Setting up keyboards
139
+
## 4. <aname='Settingupkeyboards'></a>Setting up keyboards
130
140
131
141
To select a specific keyboard to be used by the experimenter or the participant, you need to know
132
142
the value assigned by PTB to each keyboard device.
@@ -151,7 +161,7 @@ press the keys necessary to start or abort the experiment.
151
161
152
162
Using empty vectors (ie `[]`) or a negative value for those means that you will let PTB find and use the default device.
153
163
154
-
## Structure
164
+
## 5. <aname='Structure'></a>Structure
155
165
156
166
```matlab
157
167
@@ -209,101 +219,11 @@ cfg.mri.triggerNb
209
219
cfg.mri.triggerKey
210
220
```
211
221
212
-
## function details
213
-
214
-
215
-
### initPTB
216
-
217
-
This will initialize PsychToolBox
218
-
219
-
- screen
220
-
- the windon opened takes the whole screen by default
221
-
- set in debug mode with window transparency if necessary
222
-
- can skip synch test if you ask for it (nicely)
223
-
- gets the flip interval
224
-
- computes the pixel per degree of visual angle
225
-
- set font details
226
-
- keyboard
227
-
- sound
228
-
229
-
### testKeyboards
230
-
231
-
Checks that the keyboards asked for properly connected.
232
-
233
-
If no key is pressed on the correct keyboard after the timeOut time this exits with an error.
234
-
235
-
### cleanUp
236
-
237
-
A wrapper function to close all windows, ports, show mouse cursor, close keyboard queues
238
-
and give access back to the keyboards.
239
-
240
-
### getExperimentStart
241
-
242
-
Wrapper function that will show a fixation cross and collect a start timestamp in `cfg.experimentStart`
243
-
244
-
### getExperimentEnd
245
-
246
-
Wrapper function that will show a fixation cross and display in the console the whole experiment's duration in minutes and seconds
247
-
248
-
### getResponse
249
-
250
-
It is wrapper function to use `KbQueue` which is definitely what you should use to collect responses.
251
-
252
-
You can easily collect responses while running some other code at the same time.
253
-
254
-
It will only take responses from one device which can simply be the "main keyboard"
255
-
(the default device that PTB will find) or another keyboard connected to the computer
256
-
or the response box that the participant is using.
257
-
258
-
You can use it in a way so that it only takes responses from certain keys and ignore others (like
259
-
the triggers from an MRI scanner).
260
-
261
-
If you want to know more on how to use it check its help section and the `CPP_getResponseDemo.m`.
262
-
263
-
In brief, there are several actions you can execute with this function.
264
-
265
-
- init: initialize the buffer for key presses on a given device (you can also specify the keys of interest that should be listened to).
266
-
- start: start listening to the key presses (carefully insert into your script - where do you want to start buffering the responses).
267
-
- check: till that point, it will check the buffer for all key presses.
268
-
- It only reports presses on the keys of interest mentioned at initialization.
269
-
- It **can** also check for presses on the escape key and abort if the escape key is part of the keys of interest.
270
-
- flush: Empties the buffer of key presses in case you want to discard any previous key presses.
271
-
- stop: Stops buffering key presses. You can still restart by calling "start" again.
272
-
- release: Closes the buffer for good.
273
-
274
-
### deg2Pix
275
-
276
-
For a given field value in degrees of visual angle in the input `structure`,
277
-
this computes its value in pixel using the pixel per degree value of the `cfg` structure
278
-
and returns a structure with an additional field with Pix suffix holding that new value.
279
-
280
-
### drawFixationCross
281
-
282
-
Define the parameters of the fixation cross in `cfg` and `expParameters` and this does the rest.
283
-
284
-
### eyeTracker
285
-
286
-
This will handle the Eye Tracker (EyeLink set up) and can be called to initialize the connection and start the calibration, start/stop eye(s) movement recordings and save the `*.edf` file (named with BIDS specification from cpp-lln-lab/CPP_BIDS).
287
-
288
-
### pressSpace4me
289
-
290
-
Use that to stop your script and only restart when the space bar is pressed.
291
-
292
-
### standByScreen
293
-
294
-
It shows a basic one-page instruction stored in `cfg.task.instruction` and wait for `space` stroke.
295
-
296
-
### waitForTrigger
297
-
298
-
Counts a certain number of triggers coming from the mri/scanner before returning.
This script is a stand-alone function that can be useful as a sandbox to develop the PTB audio/visual stimulation of your experiment. No input/output required.
309
229
@@ -317,7 +237,7 @@ It is composed of two parts:
317
237
318
238
When you are happy with it, ideally you will move the vars in `setParameters.m` and the stimulation code in a separate function in `my-experiment-folder/subfun`. The code style and variable names are the same used in `cpp-lln-lab/CPP_PTB` github repo, therefore it should be easy to move everything in your experiment scripts (see the template that is annexed in `cpp-lln-lab/CPP_PTB`).
319
239
320
-
## Contributors ✨
240
+
## 7. <aname='Contributors'></a>Contributors ✨
321
241
322
242
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Define the parameters of the fixation cross in `cfg` and `expParameters` and this does the rest.
95
+
96
+
### 1.9. <aname='eyeTracker'></a>eyeTracker
97
+
98
+
This will handle the Eye Tracker (EyeLink set up) and can be called to initialize the connection and start the calibration, start/stop eye(s) movement recordings and save the `*.edf` file (named with BIDS specification from cpp-lln-lab/CPP_BIDS).
0 commit comments