@@ -20,29 +20,40 @@ The `cfg` structure is where most of the information about your experiment will
2020
2121Below we try to outline what it contains.
2222
23- Some of those fields you can set yourself while some others will be created and filled after running ` initPTB.m ` .
23+ Some of those fields you can set yourself while some others will be created and filled after running
24+ ` setDefaultsPTB.m ` and ` initPTB.m ` .
25+
26+ - ` setDefaultsPTB.m ` sets some default values for things about your experiment that that do not "depend" on your system or that PTB cannot "know". For example the width of the screen in cm or the dimensions of the fixation cross you want to use...
27+ - ` initPTB.m ` will fill in the fields that ARE system dependent like the screen refresh rate, the reference of the window that PTB opened and where to flip stimulus to.
2428
2529If no value is provided here, it means that there is no set default (or that the ` initPTB ` takes care of it).
2630
2731``` matlab
32+ %% -------------------------------------------------------------------------- %%
33+ SET BY setDefaultsPTB
2834%% -------------------------------------------------------------------------- %%
2935cfg.testingDevice = 'pc'; % could be 'mri', 'eeg', 'meg'
3036
3137
3238%% -------------------------------------------------------------------------- %%
3339% cfg.keyboard
34- cfg.keyboard.keyboard = []; % device index for the main keyboard (that of the experimenter)
40+ cfg.keyboard.keyboard = []; % device index for the main keyboard
41+ (that of the experimenter)
3542cfg.keyboard.responseBox = []; % device index used by the participants
3643cfg.keyboard.responseKey = {}; % list the keys that PTB should "listen" to when
37- % using KbQueue to collect responses ; if empty PTB will listen to all key presses
44+ % using KbQueue to collect responses ; if empty PTB will listen to
45+ all key presses
3846cfg.keyboard.escapeKey = 'ESCAPE'; % key to press to escape
3947
4048
4149%% -------------------------------------------------------------------------- %%
4250% cfg.debug
43- cfg.debug.do = true; % if true this will make less PTB tolerant with bad synchronisation
44- cfg.debug.transpWin = true; % makes the stimulus windows semi-transparent: useful when designing your experiment
45- cfg.debug.smallWin = true; % open a small window and not a full screen window ; can be useful for debugging
51+ cfg.debug.do = true; % if true this will make less PTB tolerant with
52+ bad synchronisation
53+ cfg.debug.transpWin = true; % makes the stimulus windows semi-transparent:
54+ useful when designing your experiment
55+ cfg.debug.smallWin = true; % open a small window and not a full screen window ;
56+ can be useful for debugging
4657
4758%% -------------------------------------------------------------------------- %%
4859% cfg.text
@@ -60,18 +71,7 @@ cfg.color.background = [0 0 0]; % [r g b] each in 0-255
6071% cfg.screen
6172cfg.screen.monitorWidth = 42;% in cm
6273cfg.screen.monitorDistance = 134;% in cm
63-
64- % all the following will be initialised by initPTB
65- cfg.screen.idx % screen index
66- cfg.screen.win % window index
67- cfg.screen.winRect % rectangle definition of the window
68- cfg.screen.winWidth
69- cfg.screen.winHeight
70- cfg.screen.center % [x y] ; pixel coordinate of the window center
71- cfg.screen.FOV % width of the field of view in degrees of visual angle
72- cfg.screen.ppd % pixel per degree
73- cfg.screen.ifi % inter frame interval
74- cfg.screen.monRefresh % monitor refresh rate ; 1 / ifi
74+ cfg.screen.resolution = {[], [], []};
7575
7676
7777%% -------------------------------------------------------------------------- %%
@@ -83,32 +83,24 @@ cfg.fixation.color = [255 255 255];
8383cfg.fixation.width = 1; % in degrees of visual angle
8484cfg.fixation.lineWidthPix = 5; % width of the lines in pixel
8585
86-
8786%% -------------------------------------------------------------------------- %%
8887% aperture
8988% mostly relevant for retinotopy scripts but can be reused for other types of
9089% experiments where an aperture is needed
9190cfg.aperture.type = 'none'; % 'bar', 'wedge', 'ring', 'circle'
9291
93-
9492%% -------------------------------------------------------------------------- %%
9593% cfg.audio
9694cfg.audio.do = false; % set to true if you are going to play some sounds
97- cfg.audio.pahandle
98- cfg.audio.devIdx = [];
99- cfg.audio.playbackMode = 1;
95+
10096cfg.audio.requestedLatency = 3;
10197cfg.audio.fs 44800; % sampling frequency
10298cfg.audio.channels = 2; % number of auditory channels
10399cfg.audio.initVolume = 1;
104- cfg.audio.pushSize
105- cfg.audio.requestOffsetTime = 1;
106- cfg.audio.reqsSampleOffset
107100cfg.audio.repeat = 1;
108101cfg.audio.startCue = 0;
109102cfg.audio.waitForDevice = 1;
110103
111-
112104%% -------------------------------------------------------------------------- %%
113105% eyetracker
114106cfg.eyeTracker.do = false; % set to true if you are using an eyelink eyetracker
@@ -120,11 +112,36 @@ cfg.eyeTracker.calibrationTargetSize = 1;
120112cfg.eyeTracker.calibrationTargetWidth = 0.5;
121113cfg.eyeTracker.displayCalResults = 1;
122114
123-
124115%% -------------------------------------------------------------------------- %%
125116% cfg.mri
126- cfg.mri.repetitionTime
117+ cfg.bids. mri.repetitionTime
127118
119+ %% -------------------------------------------------------------------------- %%
120+ SET BY initPTB
121+ %% -------------------------------------------------------------------------- %%
122+
123+ %% -------------------------------------------------------------------------- %%
124+ % cfg.screen
125+ % all the following will be initialised by initPTB
126+ cfg.screen.idx % screen index
127+ cfg.screen.win % window index
128+ cfg.screen.winRect % rectangle definition of the window
129+ cfg.screen.winWidth
130+ cfg.screen.winHeight
131+ cfg.screen.center % [x y] ; pixel coordinate of the window center
132+ cfg.screen.FOV % width of the field of view in degrees of visual angle
133+ cfg.screen.ppd % pixel per degree
134+ cfg.screen.ifi % inter frame interval
135+ cfg.screen.monRefresh % monitor refresh rate ; 1 / ifi
136+
137+ %% -------------------------------------------------------------------------- %%
138+ % cfg.audio
139+ cfg.audio.requestOffsetTime = 1;
140+ cfg.audio.reqsSampleOffset
141+ cfg.audio.pushSize
142+ cfg.audio.playbackMode = 1;
143+ cfg.audio.devIdx = [];
144+ cfg.audio.pahandle
128145
129146%% -------------------------------------------------------------------------- %%
130147% operating system information collected by initPTB
0 commit comments