-
Notifications
You must be signed in to change notification settings - Fork 1
/
s_Make_BAIR_Visual_Experiments.m
94 lines (77 loc) · 4.18 KB
/
s_Make_BAIR_Visual_Experiments.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
% Make Visual Experiment Files
%
% 1. HRF
% Exponential ISI, mean 9, range 3-24 s, interpolated to fit TR
% 2. TASK
% 12 s fixation task, 12 s relax, repeat 8 times (to measure anticipatory BOLD)
% 3. RETINOTOPY
% Like Dumoulin and Wandell, 2008: 8 sweeps: 4 cardinal, 4 diagonal (diagonals include 50% blanks)
% 4. SPATIOTEMPORAL
% VISUAL: 36 unique stimuli, shown once each per scan (0.5 s except for temporal stimuli),
% with mean ISI of 4.5 s, range 3-6 s; orientation (3; 1 grating, 1 plaid, 1 circular);
% contrast (5; noise patterns); spacing: (5: noise patterns, 1 overlaps with contrast);
% objects (12: 4 faces, 4 letters, 4 houses); temporal (12; 6 durations; 6 ISIs);
% Prompt for ExperimentSpecs
[experimentSpecs, whichSite, selectionMade] = bairExperimentSpecs('prompt', true);
if ~selectionMade, return; end
% Which experiment to make?
[experimentType, selectionMade] = bairWhichExperimentVisual();
if ~selectionMade, return; end
% Generate stimulus template
% max stimulus radius (in deg)
% 16.6º is the height of the screen for the 3T display at Utrecht,
% which is the smallest FOV among NYU-3T, UMC-3T, NYU-ECoG, UMC-ECoG,
% NYU-MEG
TR = 0.850; % ms
stimDiameterDeg = 16.6; % degrees
peakSFcpd = 3; % peak sf of all stimuli (and therefore peak of bandpass filter to make stimuli)
sfAtHalfMax = [1.4 4.7]; % spatial frequencies where filter falls off to half-height
stimParams = stimInitialize(experimentSpecs, whichSite, stimDiameterDeg);
stimParams.bpFilter = stimMakeBandPassFilter(stimParams, peakSFcpd);
switch experimentType
case {'SPATIALPATTERN' 'SPATIALOBJECT' 'TEMPORALPATTERN'}
% Make SPATIOTEMPORAL experiment
% We have 2 unique Master runs with fixed stimulus orders that will
% be identical for other modalities. Timing (ISI) is different
% between modalities; the fixation sequence is generated anew for
% each new experiment (run)
numberOfRuns = 2;
onsetTimeMultiple = 0.170; % make the onsets multiple of 170 ms, which is 1/5 of the TR (fMRI experiments only)
for runNum = 1:numberOfRuns
stimMakeSpatiotemporalExperiment(stimParams, runNum, experimentType, onsetTimeMultiple, TR);
end
case {'HRFPATTERN' 'HRFPATTERNINVERTED' 'HRFCHECKER' 'HRFCHECKERINVERTED' 'HRFPATTERNBREATHINGCHALLENGE'}
% Make HRF experiment
% Timing should be specified with values that are integer multiples of
% the default refresh rate of 60 Hz (ie 16.66666 ms). And the stimulus
% duration should be an even multiple of this value since we may use
% paired stimuli for the hRF experiment (a contrast pattern immediately
% followed by its contrast-reversed pattern).
stimDurationSeconds = 0.200; % seconds.
onsetTimeMultiple = 0.170; % make the onsets multiple of 170 ms, which is 1/5 of the TR
% For HRF, we have ONE unique run; order, timing and fixation
% sequence is the same across all sites
numberOfRuns = 1;
for runNum = numberOfRuns
stimMakeHRFExperiment(stimParams, runNum, stimDurationSeconds, onsetTimeMultiple, experimentType, TR);
end
case 'PRF'
% Make PRF experiment
stimulusDuration = 0.500; % seconds
isi = 0.350; % seconds
% For PRF, the stimuli that make up the bars ("the carriers") are
% generated by random sampling from the noise patterns used in the
% HRF experiment as well as rotated versions of those stimuli.
% Fixation sequences are generated anew for each run.
numberOfRuns = 2;
for runNum = 1:numberOfRuns
% Make PRF experiment
stimMakePRFExperiment(stimParams, runNum, stimulusDuration, isi, TR);
end
case 'DOTTASK'
numberOfRuns = 2;
for runNum = 1:numberOfRuns
% MAKE TASK EXPERIMENT
stimMakeTaskExperiment(stimParams, runNum, TR);
end
end