|
1 | | -function [cfg, expParameters] = setParameters(); |
| 1 | +function [cfg] = setParameters() |
2 | 2 |
|
3 | 3 | % Initialize the parameters and general configuration variables |
4 | | - expParameters = struct(); |
5 | 4 | cfg = struct(); |
6 | 5 |
|
7 | | - |
8 | | - |
9 | 6 | % by default the data will be stored in an output folder created where the |
10 | 7 | % setParamters.m file is |
11 | 8 | % change that if you want the data to be saved somewhere else |
12 | | - expParameters.outputDir = fullfile( ... |
| 9 | + cfg.dir.output = fullfile( ... |
13 | 10 | fileparts(mfilename('fullpath')), '..', ... |
14 | 11 | 'output'); |
15 | 12 |
|
16 | 13 | %% Debug mode settings |
17 | | - cfg.debug = true; % To test the script out of the scanner, skip PTB sync |
18 | | - cfg.testingSmallScreen = false; % To test on a part of the screen, change to 1 |
19 | | - cfg.testingTranspScreen = true; % To test with trasparent full size screen |
| 14 | + cfg.debug.do = true; % To test the script out of the scanner, skip PTB sync |
| 15 | + cfg.debug.smallWin = false; % To test on a part of the screen, change to 1 |
| 16 | + cfg.debug.transpWin = true; % To test with trasparent full size screen |
20 | 17 |
|
21 | | - expParameters.verbose = true; |
| 18 | + cfg.verbose = false; |
22 | 19 |
|
23 | 20 | %% Engine parameters |
24 | 21 |
|
25 | 22 | cfg.testingDevice = 'pc'; |
26 | | - cfg.eyeTracker = false; |
27 | | - cfg.initAudio = false; |
| 23 | + cfg.eyeTracker.do = false; |
| 24 | + cfg.audio.do = false; |
28 | 25 |
|
29 | | - [cfg, expParameters] = setMonitor(cfg, expParameters); |
| 26 | + cfg = setMonitor(cfg, cfg); |
30 | 27 |
|
31 | 28 | % Keyboards |
32 | | - [cfg, expParameters] = setKeyboards(cfg, expParameters); |
| 29 | + cfg = setKeyboards(cfg, cfg); |
33 | 30 |
|
34 | 31 | % MRI settings |
35 | | - [cfg, expParameters] = setMRI(cfg, expParameters); |
| 32 | + cfg = setMRI(cfg, cfg); |
36 | 33 |
|
37 | 34 | %% Experiment Design |
38 | | - expParameters.names = {'static', 'motion'}; |
39 | | - expParameters.possibleDirections = [-1 1]; % 1 motion , -1 static |
40 | | - expParameters.numBlocks = size(expParameters.possibleDirections, 2); |
41 | | - expParameters.numRepetitions = 1; % AT THE MOMENT IT IS NOT SET IN THE MAIN SCRIPT |
42 | | - expParameters.IBI = 0; % 8; |
| 35 | + cfg.names = {'static', 'motion'}; |
| 36 | + cfg.possibleDirections = [-1 1]; % 1 motion , -1 static |
| 37 | + cfg.numBlocks = size(cfg.possibleDirections, 2); |
| 38 | + cfg.numRepetitions = 1; % AT THE MOMENT IT IS NOT SET IN THE MAIN SCRIPT |
| 39 | + cfg.IBI = 0; % 8; |
43 | 40 | % Time between events in secs |
44 | | - expParameters.ISI = 0.1; |
| 41 | + cfg.ISI = 0.1; |
45 | 42 | % Number of seconds before the motion stimuli are presented |
46 | | - expParameters.onsetDelay = 5; |
| 43 | + cfg.onsetDelay = 5; |
47 | 44 | % Number of seconds after the end all the stimuli before ending the run |
48 | | - expParameters.endDelay = 1; |
| 45 | + cfg.endDelay = 1; |
49 | 46 |
|
50 | 47 | %% Visual Stimulation |
51 | | - % speed in visual angles |
52 | | - expParameters.speedEvent = 8; |
| 48 | + |
53 | 49 | % Number of events per block (should not be changed) |
54 | | - expParameters.numEventsPerBlock = 12; |
55 | | - expParameters.eventDuration = 1; |
| 50 | + cfg.numEventsPerBlock = 12; |
| 51 | + cfg.eventDuration = 1; % second |
| 52 | + |
| 53 | + % speed in visual angles |
| 54 | + cfg.dot.speed = 8; |
56 | 55 | % Coherence Level (0-1) |
57 | | - expParameters.coh = 1; |
| 56 | + cfg.dot.coh = 1; |
58 | 57 | % Maximum number dots per frame |
59 | | - expParameters.maxDotsPerFrame = 300; |
| 58 | + cfg.dot.maxNbPerFrame = 300; |
60 | 59 | % Dot life time in seconds |
61 | | - expParameters.dotLifeTime = 1; |
| 60 | + cfg.dot.lifeTime = 1; |
62 | 61 | % Dot Size (dot width) in visual angles. |
63 | | - expParameters.dotSize = 0.1; |
64 | | - expParameters.dotColor = cfg.white; |
65 | | - expParameters.dontClear = 0; |
| 62 | + cfg.dot.size = 0.1; |
| 63 | + cfg.dot.color = cfg.color.white; |
| 64 | + cfg.dot.dontClear = 0; |
| 65 | + |
66 | 66 | % Diameter/length of side of aperture in Visual angles |
67 | 67 | cfg.diameterAperture = 8; |
68 | 68 |
|
69 | 69 | %% Task(s) |
70 | | - |
71 | | - expParameters.task = 'visualLocalizer'; |
| 70 | + |
| 71 | + cfg.task.name = 'visual localizer'; |
72 | 72 |
|
73 | 73 | % Instruction |
74 | | - expParameters.taskInstruction = '1-Detect the RED fixation cross\n \n\n'; |
| 74 | + cfg.task.instruction = '1-Detect the RED fixation cross\n \n\n'; |
75 | 75 |
|
76 | 76 | % Fixation cross (in pixels) |
77 | 77 | % Set the length of the lines of the fixation cross |
78 | | - expParameters.fixCrossDimPix = 10; |
| 78 | + cfg.fixation.dimensionPix = 10; |
79 | 79 | % Set the line width for our fixation cross |
80 | | - expParameters.lineWidthPix = 4; |
81 | | - expParameters.maxNumFixationTargetPerBlock = 2; |
82 | | - expParameters.targetDuration = 0.15; % In secs |
83 | | - |
84 | | - expParameters.xDisplacementFixCross = 0; % Manual displacement of the fixation cross |
85 | | - expParameters.yDisplacementFixCross = 0; % Manual displacement of the fixation cross |
86 | | - expParameters.fixationCrossColor = cfg.white; |
87 | | - expParameters.fixationCrossColorTarget = cfg.red; |
88 | | - |
89 | | - expParameters.extraColumns = {'direction', 'speed', 'target', 'event', 'block'}; |
| 80 | + cfg.fixation.lineWidthPix = 4; |
| 81 | + cfg.fixation.xDisplacement = 0; % Manual displacement of the fixation cross |
| 82 | + cfg.fixation.yDisplacement = 0; % Manual displacement of the fixation cross |
| 83 | + cfg.fixation.color = cfg.color.white; |
| 84 | + cfg.fixation.colorTarget = cfg.color.red; |
| 85 | + |
| 86 | + cfg.target.maxNbPerBlock = 2; |
| 87 | + cfg.target.duration = 0.15; % In secs |
| 88 | + |
| 89 | + cfg.extraColumns = {'direction', 'speed', 'target', 'event', 'block'}; |
90 | 90 | end |
91 | 91 |
|
92 | | -function [cfg, expParameters] = setKeyboards(cfg, expParameters) |
| 92 | +function cfg = setKeyboards(cfg) |
93 | 93 | cfg.keyboard.escapeKey = 'ESCAPE'; |
94 | 94 | cfg.keyboard.responseKey = {'space'}; |
95 | 95 | cfg.keyboard.keyboard = []; |
|
101 | 101 | end |
102 | 102 | end |
103 | 103 |
|
104 | | -function [cfg, expParameters] = setMRI(cfg, expParameters) |
| 104 | +function cfg = setMRI(cfg) |
105 | 105 | % letter sent by the trigger to sync stimulation and volume acquisition |
106 | | - cfg.triggerKey = 't'; |
107 | | - cfg.numTriggers = 4; |
| 106 | + cfg.mri.triggerKey = 't'; |
| 107 | + cfg.mri.triggerNb = 4; |
108 | 108 |
|
109 | | - expParameters.bids.MRI.RepetitionTime = 2; |
| 109 | + cfg.mri.repetitionTime = 2; |
110 | 110 |
|
111 | | - expParameters.bids.MRI.Instructions = 'Detect the RED fixation cross'; |
112 | | - expParameters.bids.MRI.TaskDescription = []; |
| 111 | + cfg.bids.MRI.Instructions = 'Detect the RED fixation cross'; |
| 112 | + cfg.bids.MRI.TaskDescription = []; |
113 | 113 |
|
114 | 114 | end |
115 | 115 |
|
116 | | -function [cfg, expParameters] = setMonitor(cfg, expParameters) |
| 116 | +function cfg = setMonitor(cfg) |
117 | 117 |
|
118 | 118 | % Monitor parameters for PTB |
119 | | - cfg.white = [255 255 255]; |
120 | | - cfg.black = [0 0 0]; |
121 | | - cfg.red = [255 0 0]; |
122 | | - cfg.grey = mean([cfg.black; cfg.white]); |
123 | | - cfg.backgroundColor = cfg.black; |
124 | | - cfg.textColor = cfg.white; |
| 119 | + cfg.color.white = [255 255 255]; |
| 120 | + cfg.color.black = [0 0 0]; |
| 121 | + cfg.color.red = [255 0 0]; |
| 122 | + cfg.color.grey = mean([cfg.color.black; cfg.color.white]); |
| 123 | + cfg.color.background = cfg.color.black; |
| 124 | + cfg.text.color = cfg.color.white; |
125 | 125 |
|
126 | 126 | % Monitor parameters |
127 | | - cfg.monitorWidth = 42; % in cm |
128 | | - cfg.screenDistance = 134; % distance from the screen in cm |
| 127 | + cfg.screen.monitorWidth = 42; % in cm |
| 128 | + cfg.screen.monitorDistance = 134; % distance from the screen in cm |
129 | 129 |
|
130 | 130 | if strcmpi(cfg.testingDevice, 'mri') |
131 | | - cfg.monitorWidth = 42; |
132 | | - cfg.screenDistance = 134; |
| 131 | + cfg.screen.monitorWidth = 42; |
| 132 | + cfg.screen.monitorDistance = 134; |
133 | 133 | end |
134 | 134 | end |
0 commit comments