11# CPP_PTB
2+
23<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
4+
35[ ![ All Contributors] ( https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square )] ( #contributors- )
6+
47<!-- ALL-CONTRIBUTORS-BADGE:END -->
58
69This is List of Crossmodal Perpeption and Plasticity lab (CPP) PsychToolBox (PTB) toolbox.
@@ -16,7 +19,7 @@ For instructions see the following links:
1619
1720| Requirements | Used version |
1821| ----------------------------------------------------------| --------------|
19- | [ PsychToolBox] ( http://psychtoolbox.org/ ) Duuuuhh | >3.0.13 |
22+ | [ PsychToolBox] ( http://psychtoolbox.org/ ) Duuuuhh | >= 3.0.14 |
2023| [ Matlab] ( https://www.mathworks.com/products/matlab.html ) | 201?? |
2124| or [ octave] ( https://www.gnu.org/software/octave/ ) | 4.? |
2225
@@ -36,40 +39,37 @@ We keep the McCabe complexity as reported by the [check_my_code function](https:
3639This repository can be added as a dependencies by listing it in a [ mpm-requirements.txt file] ( .mpm-requirements.txt )
3740as follows:
3841
39- ```
40- CPP_PTB -u https://github.com/cpp-lln-lab/CPP_PTB.git
41- ```
42+ CPP_PTB -u https://github.com/cpp-lln-lab/CPP_PTB.git
4243
4344You 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.
4445
45-
4646``` matlab
47- function getDependencies(action)
48- % Will install on your computer the matlab dependencies specified in the mpm-requirements.txt
49- % and add them to the matlab path. The path is never saved so you need to run getDependencies() when
50- % you start matlab.
51- %
52- % getDependencies('update') will force the update and overwrite previous version of the dependencies.
53- %
54- % getDependencies() If you only already have the appropriate version but just want to add them to the matlab path.
55-
56- experimentName = YOUR_EXPERIMENT_NAME;
57-
58- if nargin<1
59- action = '';
60- end
61-
62- switch action
63- case 'update'
64- % install dependencies
65- mpm install -i mpm-requirements.txt -f -c YOUR_EXPERIMENT_NAME
66- end
67-
68- % adds them to the path
69- mpm_folder = fileparts(which('mpm'));
70- addpath(genpath(fullfile(mpm_folder, 'mpm-packages', 'mpm-collections', experimentName)));
71-
72- end
47+ function getDependencies(action)
48+ % Will install on your computer the matlab dependencies specified in the mpm-requirements.txt
49+ % and add them to the matlab path. The path is never saved so you need to run getDependencies() when
50+ % you start matlab.
51+ %
52+ % getDependencies('update') will force the update and overwrite previous version of the dependencies.
53+ %
54+ % getDependencies() If you only already have the appropriate version but just want to add them to the matlab path.
55+
56+ experimentName = YOUR_EXPERIMENT_NAME;
57+
58+ if nargin<1
59+ action = '';
60+ end
61+
62+ switch action
63+ case 'update'
64+ % install dependencies
65+ mpm install -i mpm-requirements.txt -f -c YOUR_EXPERIMENT_NAME
66+ end
67+
68+ % adds them to the path
69+ mpm_folder = fileparts(which('mpm'));
70+ addpath(genpath(fullfile(mpm_folder, 'mpm-packages', 'mpm-collections', experimentName)));
71+
72+ end
7373```
7474
7575
8080### initPTB
8181
8282This will initialize PsychToolBox
83+
8384- screen
84- - the windon opened takes the whole screen by default
85- - set in debug mode with window transparency if necessary
86- - can skip synch test if you ask for it (nicely)
87- - gets the flip interval
88- - computes the pixel per degree of visual angle
89- - set font details
85+ - the windon opened takes the whole screen by default
86+ - set in debug mode with window transparency if necessary
87+ - can skip synch test if you ask for it (nicely)
88+ - gets the flip interval
89+ - computes the pixel per degree of visual angle
90+ - set font details
9091- keyboard
9192- sound
9293
9394### testKeyboards
95+
9496Checks that the keyboards asked for properly connected.
9597
9698If no key is pressed on the correct keyboard after the timeOut time this exits with an error.
9799
98100### cleanUp
101+
99102A wrapper function to close all windows, ports, show mouse cursor, close keyboard queues
100103and give access back to the keyboards.
101104
@@ -118,12 +121,10 @@ the value assigned by PTB to each keyboard device.
118121
119122To know this copy-paste this on the command window:
120123
121- ```
122- [keyboardNumbers, keyboardNames] = GetKeyboardIndices;
124+ [keyboardNumbers, keyboardNames] = GetKeyboardIndices;
123125
124- keyboardNumbers
125- keyboardNames
126- ```
126+ keyboardNumbers
127+ keyboardNames
127128
128129### deg2Pix
129130
@@ -139,22 +140,16 @@ Define the parameters of the fixation cross in `cfg` and `expParameters` and thi
139140
140141Use that to stop your script and only restart when the space bar is pressed.
141142
142-
143-
144-
145-
146-
147-
148-
149-
150-
151143## Contributors ✨
152144
153145Thanks goes to these wonderful people ([ emoji key] ( https://allcontributors.org/docs/en/emoji-key ) ):
154146
155147<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
148+
156149<!-- prettier-ignore-start -->
150+
157151<!-- markdownlint-disable -->
152+
158153<table >
159154 <tr >
160155 <td align="center"><a href="https://remi-gau.github.io/"><img src="https://avatars3.githubusercontent.com/u/6961185?v=4" width="100px;" alt=""/><br /><sub><b>Remi Gau</b></sub></a><br /><a href="https://github.com/cpp-lln-lab/CPP_PTB/commits?author=Remi-Gau" title="Code">💻</a> <a href="#design-Remi-Gau" title="Design">🎨</a> <a href="https://github.com/cpp-lln-lab/CPP_PTB/commits?author=Remi-Gau" title="Documentation">📖</a></td>
@@ -163,7 +158,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
163158</table >
164159
165160<!-- markdownlint-enable -->
161+
166162<!-- prettier-ignore-end -->
163+
167164<!-- ALL-CONTRIBUTORS-LIST:END -->
168165
169166This project follows the [ all-contributors] ( https://github.com/all-contributors/all-contributors ) specification. Contributions of any kind welcome!
0 commit comments