-
Notifications
You must be signed in to change notification settings - Fork 1
/
BAIR_RUNME.m
102 lines (92 loc) · 3.17 KB
/
BAIR_RUNME.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
function quitProg = BAIR_RUNME(stimPrefix, runID, siteSpecs, subjID, sessionID, sensoryDomain)
% quitProg = BAIR_RUNME(stimPrefix, runNumber, specs, subjID, sessionID)
%
% Run BAIR experiments (Do not call this function directly. It gets called
% from the wrapper function, s_runme_BAIR)
% ------
% Run time per experiment = XX seconds
%
% INPUTS
% stimPrefix prefix for the stimulus files containing images
% should be
% - spatiotemporal
% - prf
% - spatialpattern
% - temporalpattern
% etc
% runID run number
% siteSpecs one-row table generated from the function bairExperimentSpecs
% subjID alphanumeric subject ID
% sensoryDomain should be one of the following sensory modalities
% - visual
% - tactile
% - motor
%
% Example
% experimentSpecs = bairExperimentSpecs;
% siteSpecs = experimentSpecs(2,:);
% runnum = 1;
% stimPrefix = 'hrfchecker';
% subjID = 'wl001';
% sensoryDomain = 'visual'
% BAIR_RUNME(runnum, stimPrefix, siteSpecs, subjID,[], sensoryDomain);
if notDefined('stimPrefix')
help(mfilename)
error('stimPrefix is a required input');
end
if notDefined('sensoryDomain')
help(mfilename)
error('sensoryDomain is a required input');
end
if notDefined('siteSpecs')
help(mfilename)
error('siteSpecs is a required input');
end
if notDefined('runID'), runID = 1; end
if notDefined('sessionID'), sessionID = '01'; end
% Set parameters for this experiment
params.experiment = stimPrefix;
params.subjID = subjID;
params.runID = runID;
params.sessionID = sessionID;
params.loadMatrix = sprintf('%s_%s_%d.mat', siteSpecs.sites{1}, stimPrefix, runID);
params.modality = siteSpecs.modalities{1};
params.site = siteSpecs.sites{1};
params.calibration = siteSpecs.displays{1};
params.triggerKey = siteSpecs.trigger{1};
params.useSerialPort = siteSpecs.serialport;
params.useEyeTracker = siteSpecs.eyetracker;
params.usePhotoDiode = siteSpecs.photodiode;
params.shiftDestRect = siteSpecs.displaypos;
params.sensoryDomain = sensoryDomain;
params.useDataGlove = false;
% Additional parameters
params.prescanDuration = 0;
params.startScan = 0;
% Set priority (depends on operating system)
if ispc
params.runPriority = 2;
elseif ismac
params.runPriority = 7;
end
% Specify which type of fixation to use
params.fixation = 'cross'; % default
if contains(stimPrefix, 'dottask')
params.fixation = '4 color dot';
end
if contains(lower(sensoryDomain), 'motor')
params.fixation = 'crossdisk';
end
if contains(lower(sensoryDomain), 'tactile-visual')
params.fixation = 'hand';
end
% Sensory modality-specific stuff to do before starting experiment?
[params] = checkforSensoryDomainSpecificRequest(params);
% Debug mode?
params.skipSyncTests = 1;
% folder where to save screenshots
% default: empty '' (doesn't save screenshots)
params.path_for_screenshots = '';
% Go!
quitProg = doExperiment(params);
end