Repository navigation
Expand file tree
/
Copy pathDVT_run.m
More file actions
61 lines (51 loc) · 1.75 KB
/
Copy pathDVT_run.m
File metadata and controls
61 lines (51 loc) · 1.75 KB
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
% Main start
try
sca;
close all;
clear;
% Add files to path
addpath('tests/');
addpath('utils/');
% Make output directory
out_dir = fullfile('results', string(datetime("now", "Format","uuuu-MM-dd_HH-mm")));
mkdir(out_dir);
% Config
cfg = DVT_config();
% PTB setup
Screen('Preference', 'Verbosity', 0);
PsychDefaultSetup(2);
PsychImaging('PrepareConfiguration');
if cfg.bits > 8
% Native 10+ bit output requires GPU/driver/OS support (e.g. a
% Quadro/Studio-class NVIDIA card with the right driver config on
% Windows, or a depth-30 Xorg config on Linux). If this errors out
% on OpenWindow below, set MONITOR_BIT_PRECISION to 8 in
% DVT_config.m to skip this request.
PsychImaging('AddTask', 'General', 'EnableNative10BitFramebuffer', 1);
end
PsychImaging('AddTask', 'General', 'FloatingPoint32Bit');
PsychImaging('AddTask', 'General', 'NormalizedHighresColorRange', 1);
% Setup screen
screenId = max(Screen('Screens'));
%windowRect = [100 100 900 600]; % Make screen small for testing
[win,rect] = PsychImaging('OpenWindow', screenId, 0.5);
Screen('LoadNormalizedGammaTable', win, repmat(linspace(0,1,256),3,1)', 0);
cfg.win = win;
cfg.rect = rect;
% Run tests
results.A = DVT_temporal(cfg, out_dir);
results.B = DVT_gamma(cfg, out_dir);
results.C = DVT_contrast(cfg, out_dir);
results.D = DVT_spatial(cfg, out_dir);
% Save results
DVT_report(results, cfg, out_dir);
save(fullfile(out_dir, "result.mat"), "results");
catch ME
fprintf(2, 'Error: %s\n', ME.message);
fprintf(2, '%s\n', ME.identifier);
fprintf(2, '%s\n', ME.Correction);
sca;
close all;
end
sca;
close all;