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
To work with a specific version, create a branch at a specific version tag number
57
+
```bash
58
+
# creating and checking out a branch that will be calle version1 at the version tag v0.0.1
59
+
git checkout -b version1 v0.0.1
60
+
```
44
61
45
-
You can then use the [matlab package manager](https://github.com/mobeets/mpm), to simply download the appropriate version of those dependencies and add them to your path by running a `getDependencies` function like the one below where you just need to replace `YOUR_EXPERIMENT_NAME` by the name of your experiment.
62
+
### Add as a submodule
46
63
47
-
```matlab
48
-
function getDependencies(action)
49
-
% Will install on your computer the matlab dependencies specified in the mpm-requirements.txt
50
-
% and add them to the matlab path. The path is never saved so you need to run getDependencies() when
51
-
% you start matlab.
52
-
%
53
-
% getDependencies('update') will force the update and overwrite previous version of the dependencies.
54
-
%
55
-
% getDependencies() If you only already have the appropriate version but just want to add them to the matlab path.
To get the latest commit you then need to update the submodule with the information
77
+
on its remote repository and then merge those locally.
78
+
```bash
79
+
git submodule update --remote --merge
80
+
```
81
+
82
+
Remember that updates to submodules need to be committed as well.
83
+
84
+
#### Example for submodule usage
85
+
86
+
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. -->
111
+
112
+
### Direct download
113
+
114
+
Download the code. Unzip. And add to the matlab path.
<!-- 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?) -->
75
128
76
129
## Setting up keyboards
77
130
@@ -98,9 +151,66 @@ press the keys necessary to start or abort the experiment.
98
151
99
152
Using empty vectors (ie `[]`) or a negative value for those means that you will let PTB find and use the default device.
100
153
101
-
## Structure and function details
154
+
## Structure
155
+
156
+
```matlab
157
+
158
+
cfg.testingDevice = 'pc';
159
+
160
+
% cfg.color
161
+
cfg.keyboard.keyboard = [];
162
+
cfg.keyboard.responseBox = [];
163
+
cfg.keyboard.responseKey = {};
164
+
cfg.keyboard.escapeKey = 'ESCAPE';
165
+
166
+
% cfg.debug
167
+
cfg.debug.do = true;
168
+
cfg.debug.transpWin = true;
169
+
cfg.debug.smallWin = true;
170
+
171
+
% cfg.text
172
+
cfg.text.font
173
+
cfg.text.size
174
+
cfg.text.style
175
+
176
+
% cfg.color
177
+
cfg.color.background
178
+
179
+
% cfg.screen
180
+
cfg.screen.monitorWidth
181
+
cfg.screen.monitorDistance
182
+
cfg.screen.idx
183
+
cfg.screen.win
184
+
cfg.screen.winRect
185
+
cfg.screen.winWidth
186
+
cfg.screen.winHeight
187
+
cfg.screen.center
188
+
cfg.screen.FOV
189
+
cfg.screen.ppd
190
+
cfg.screen.ifi
191
+
cfg.screen.monRefresh
192
+
193
+
% cfg.audio
194
+
cfg.audio.do
195
+
cfg.audio.pahandle
196
+
cfg.audio.devIdx
197
+
cfg.audio.playbackMode
198
+
cfg.audio.requestedLatency
199
+
cfg.audio.fs
200
+
cfg.audio.channels
201
+
cfg.audio.initVolume
202
+
cfg.audio.pushSize
203
+
cfg.audio.requestOffsetTime
204
+
cfg.audio.reqsSampleOffset
205
+
206
+
% cfg.mri
207
+
cfg.mri.repetitionTime
208
+
cfg.mri.triggerNb
209
+
cfg.mri.triggerKey
210
+
```
211
+
212
+
## function details
102
213
103
-
<!-- ### setParameters -->
104
214
105
215
### initPTB
106
216
@@ -129,12 +239,12 @@ and give access back to the keyboards.
129
239
130
240
### getResponse
131
241
132
-
It is wrapper function to use `KbQueue` which is definitely what you should used to collect responses.
242
+
It is wrapper function to use `KbQueue` which is definitely what you should use to collect responses.
133
243
134
244
You can easily collect responses while running some other code at the same time.
135
245
136
-
It will only take responses from one device which can simply be the "main keyboard"
137
-
(the default device that PTB will find) or another keyboard connected to the computer
246
+
It will only take responses from one device which can simply be the "main keyboard"
247
+
(the default device that PTB will find) or another keyboard connected to the computer
138
248
or the response box that the participant is using.
139
249
140
250
You can use it in a way so that it only takes responses from certain keys and ignore others (like
@@ -146,7 +256,7 @@ In brief, there are several actions you can execute with this function.
146
256
147
257
- init: initialize the buffer for key presses on a given device (you can also specify the keys of interest that should be listened to).
148
258
- start: start listening to the key presses (carefully insert into your script - where do you want to start buffering the responses).
149
-
- check: till that point, it will check the buffer for all key presses.
259
+
- check: till that point, it will check the buffer for all key presses.
150
260
- It only reports presses on the keys of interest mentioned at initialization.
151
261
- It **can** also check for presses on the escape key and abort if the escape key is part of the keys of interest.
152
262
- flush: Empties the buffer of key presses in case you want to discard any previous key presses.
@@ -173,11 +283,18 @@ This will handle the Eye Tracker (EyeLink set up) and can be called to initializ
173
283
174
284
Use that to stop your script and only restart when the space bar is pressed.
175
285
286
+
287
+
### waitForTrigger
288
+
289
+
Counts a certain number of triggers coming from the mri/scanner before returning.
290
+
Requires number of triggers to wait for.
291
+
292
+
176
293
## Annexes
177
294
178
295
### Experiment template [ WIP ]
179
296
180
-
### `devSandobox.m`stand-alone
297
+
### devSandbox (stand-alone)
181
298
182
299
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.
0 commit comments