Skip to content

Commit b8b183b

Browse files
committed
rename main script and lint
1 parent 2db46f9 commit b8b183b

File tree

3 files changed

+61
-40
lines changed

3 files changed

+61
-40
lines changed

setParameters.m

Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
cfg.debug.smallWin = false; % To test on a part of the screen, change to 1
2121
cfg.debug.transpWin = false; % To test with trasparent full size screen
2222

23-
cfg.verbose = false;
23+
cfg.verbose = 2;
2424

2525
%% Engine parameters
2626

@@ -40,25 +40,22 @@
4040

4141
%% Experiment Design
4242

43-
cfg.design.localizer = 'MT_MST';
44-
45-
cfg.design.motionType = 'radial';
46-
cfg.design.motionDirections = [666 666 -666 -666];
43+
% switching this on to MT or MT/MST with use:
44+
% - MT: translational motion on the whole screen
45+
% - alternates static and motion (left or right) blocks
46+
% - MST: radial motion centered in a circle aperture that is on the opposite
47+
% side of the screen relative to the fixation
48+
% - alternates fixaton left and fixation right
49+
cfg.design.localizer = 'MT';
50+
% cfg.design.localizer = 'MT_MST';
51+
52+
cfg.design.motionType = 'translation';
53+
cfg.design.motionDirections = [0 0 180 180];
4754
cfg.design.names = {'static'; 'motion'};
48-
cfg.design.xDisplacementFixation = 7;
49-
cfg.design.xDisplacementAperture = 3;
50-
51-
% cfg.design.motionType = 'translation';
52-
% cfg.design.motionDirections = [0 0 180 180];
53-
% cfg.design.names = {'static'; 'motion'};
54-
55+
5556
cfg.design.nbRepetitions = 8;
5657
cfg.design.nbEventsPerBlock = 12; % DO NOT CHANGE
5758

58-
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
59-
cfg.design.names = {'fixation_right'; 'fixation_left'};
60-
end
61-
6259
%% Timing
6360

6461
% FOR 7T: if you want to create localizers on the fly, the following must be
@@ -78,10 +75,6 @@
7875
% Number of seconds after the end all the stimuli before ending the run
7976
cfg.timing.endDelay = 3.6;
8077

81-
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
82-
cfg.timing.IBI = 3.6;
83-
end
84-
8578
% reexpress those in terms of repetition time
8679
if cfg.pacedByTriggers.do
8780

@@ -99,10 +92,6 @@
9992
% Number of seconds after the end all the stimuli before ending the run
10093
cfg.timing.endDelay = 2;
10194

102-
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
103-
cfg.timing.IBI = 2;
104-
end
105-
10695
end
10796

10897
%% Visual Stimulation
@@ -114,9 +103,9 @@
114103
% Number of dots per visual angle square.
115104
cfg.dot.density = 1;
116105
% Dot life time in seconds
117-
cfg.dot.lifeTime = .5;
106+
cfg.dot.lifeTime = .4;
118107
% proportion of dots killed per frame
119-
cfg.dot.proportionKilledPerFrame = 0.05;
108+
cfg.dot.proportionKilledPerFrame = 0;
120109
% Dot Size (dot width) in visual angles.
121110
cfg.dot.size = .2;
122111
cfg.dot.color = cfg.color.white;
@@ -126,18 +115,9 @@
126115
cfg.aperture.width = []; % if left empty it will take the screen height
127116
cfg.aperture.xPos = 0;
128117

129-
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
130-
cfg.aperture.type = 'circle';
131-
cfg.aperture.width = 7; % if left empty it will take the screen height
132-
cfg.aperture.xPos = cfg.design.xDisplacementAperture;
133-
end
134-
135118
%% Task(s)
136119

137120
cfg.task.name = 'visual localizer';
138-
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
139-
cfg.task.name = 'mt mst localizer';
140-
end
141121

142122
% Instruction
143123
cfg.task.instruction = '1-Detect the RED fixation cross\n \n\n';
@@ -152,7 +132,7 @@
152132
cfg.fixation.yDisplacement = 0;
153133

154134
cfg.target.maxNbPerBlock = 1;
155-
cfg.target.duration = 0.05; % In secs
135+
cfg.target.duration = 0.025; % In secs
156136

157137
cfg.extraColumns = { ...
158138
'direction', ...
@@ -164,6 +144,9 @@
164144
'fixationPosition', ...
165145
'aperturePosition'};
166146

147+
%% orverrireds the relevant fields in case we use the MT / MST localizer
148+
cfg = setParametersMtMst(cfg);
149+
167150
end
168151

169152
function cfg = setKeyboards(cfg)
@@ -211,4 +194,34 @@
211194
cfg.screen.monitorWidth = 25;
212195
cfg.screen.monitorDistance = 95;
213196
end
197+
198+
end
199+
200+
function cfg = setParametersMtMst(cfg)
201+
202+
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
203+
204+
cfg.task.name = 'mt mst localizer';
205+
206+
cfg.design.motionType = 'radial';
207+
cfg.design.motionDirections = [666 666 -666 -666];
208+
cfg.design.names = {'fixation_right'; 'fixation_left'};
209+
cfg.design.xDisplacementFixation = 7;
210+
cfg.design.xDisplacementAperture = 3;
211+
212+
cfg.timing.IBI = 3.6;
213+
214+
% reexpress those in terms of repetition time
215+
if cfg.pacedByTriggers.do
216+
217+
cfg.timing.IBI = 2;
218+
219+
end
220+
221+
cfg.aperture.type = 'circle';
222+
cfg.aperture.width = 7; % if left empty it will take the screen height
223+
cfg.aperture.xPos = cfg.design.xDisplacementAperture;
224+
225+
end
226+
214227
end

subfun/preTrialSetup.m

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,30 @@
1616
% If this frame shows a target we change the color of the cross
1717
thisFixation.fixation = cfg.fixation;
1818
thisFixation.screen = cfg.screen;
19-
20-
% To shift the dot matrix
19+
20+
% ThisEvent.dotCenterXPosPix determines by how much the dot matrix has to be
21+
% shifted relative to the center of the screen.
22+
% By default it is centered on screen but for the MT/MST localizer we
23+
% shift so the center of the radial motion is matched to that of the
24+
% aperture on the side of the screen.
25+
%
26+
% Meanwhile the cross is shifted on the opposite side
27+
%
28+
2129
thisEvent.dotCenterXPosPix = 0;
2230

2331
switch thisEvent.trial_type
2432
case 'fixation_right'
2533
cfg.aperture.xPosPix = -abs(cfg.aperture.xPosPix);
26-
34+
2735
thisEvent.dotCenterXPosPix = cfg.aperture.xPosPix;
2836

2937
thisFixation.fixation.xDisplacement = cfg.design.xDisplacementFixation;
3038
thisFixation = initFixation(thisFixation);
3139

3240
case 'fixation_left'
3341
cfg.aperture.xPosPix = +abs(cfg.aperture.xPosPix);
34-
42+
3543
thisEvent.dotCenterXPosPix = cfg.aperture.xPosPix;
3644

3745
thisFixation.fixation.xDisplacement = -cfg.design.xDisplacementFixation;
File renamed without changes.

0 commit comments

Comments
 (0)