-
Notifications
You must be signed in to change notification settings - Fork 1
/
GetParameters.m
105 lines (74 loc) · 2.9 KB
/
GetParameters.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
function [ Parameters ] = GetParameters( DataStruct )
% GETPARAMETERS Prepare common parameters
%
% Response buttuns (fORRP 932) :
% USB
% HHSC - 1x2 - CYL
% HID NAR 12345
%% Paths
Parameters.Path.wav = ['wav' filesep];
Parameters.Path.img = ['img' filesep];
%% Set parameters
%%%%%%%%%%%%%%
% Screen %
%%%%%%%%%%%%%%
Parameters.Video.ScreenWidthPx = 1024; % Number of horizontal pixel in MRI video system @ CENIR
Parameters.Video.ScreenHeightPx = 768; % Number of vertical pixel in MRI video system @ CENIR
Parameters.Video.ScreenFrequency = 60; % Refresh rate (in Hertz)
Parameters.Video.SubjectDistance = 0.120; % m
Parameters.Video.ScreenWidthM = 0.040; % m
Parameters.Video.ScreenHeightM = 0.030; % m
switch DataStruct.Task
case 'Calibration'
Parameters.Video.ScreenBackgroundColor = [0 0 0]; % [R G B] ( from 0 to 255 )
case 'Instructions'
Parameters.Video.ScreenBackgroundColor = [0 0 0]; % [R G B] ( from 0 to 255 )
case 'Session'
Parameters.Video.ScreenBackgroundColor = [0 0 0]; % [R G B] ( from 0 to 255 )
case 'EyelinkCalibration'
Parameters.Video.ScreenBackgroundColor = [128 128 128]; % [R G B] ( from 0 to 255 )
end
%%%%%%%%%%%%
% Text %
%%%%%%%%%%%%
switch DataStruct.Task
case 'Calibration'
Parameters.Text.Size = 40;
case 'Instructions'
Parameters.Text.Size = 40;
case 'Session'
Parameters.Text.Size = 60;
case 'EyelinkCalibration'
Parameters.Text.Size = 40;
end
Parameters.Text.Font = 'Courier New';
Parameters.Text.Color = [255 255 255]; % [R G B] ( from 0 to 255 )
%%%%%%%%%%%
% Audio %
%%%%%%%%%%%
Parameters.Audio.SamplingRate = 44100/2; % Hz
Parameters.Audio.Playback_Mode = 1; % 1 = playback, 2 = record
Parameters.Audio.Playback_LowLatencyMode = 1; % {0,1,2,3,4}
Parameters.Audio.Playback_freq = Parameters.Audio.SamplingRate ;
Parameters.Audio.Playback_Channels = 2; % 1 = mono, 2 = stereo
% Parameters.Record_Mode = 2; % 1 = playback, 2 = record
% Parameters.Record_LowLatencyMode = 0; % {0,1,2,3,4}
% Parameters.Record_freq = SamplingRate;
% Parameters.Record_Channels = 1; % 1 = mono, 2 = stereo
%%%%%%%%%%%%%%
% Keybinds %
%%%%%%%%%%%%%%
KbName('UnifyKeyNames');
Parameters.Keybinds.TTL_t_ASCII = KbName('t'); % MRI trigger has to be the first defined key
Parameters.Keybinds.emulTTL_s_ASCII = KbName('s');
Parameters.Keybinds.Stop_Escape_ASCII = KbName('ESCAPE');
Parameters.Keybinds.Right_Blue_b_ASCII = KbName('b');
Parameters.Keybinds.Left_Yellow_y_ASCII = KbName('y');
Parameters.Keybinds.LeftArrow = KbName('LeftArrow');
Parameters.Keybinds.RightArrow = KbName('RightArrow');
%% Echo in command window
disp('--------------------------');
disp(['--- ' mfilename ' done ---']);
disp('--------------------------');
disp(' ');
end