Skip to content

Commit d8d5769

Browse files
authored
Merge pull request #59 from Remi-Gau/remi-MT_MST
MT / MST ready
2 parents 9454d50 + f16bcff commit d8d5769

File tree

6 files changed

+68
-34
lines changed

6 files changed

+68
-34
lines changed

lib/CPP_BIDS

Submodule CPP_BIDS updated 50 files

lib/CPP_PTB

Submodule CPP_PTB updated 58 files

setParameters.m

Lines changed: 47 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
cfg.debug.do = false; % To test the script out of the scanner, skip PTB sync
2020
cfg.debug.smallWin = false; % To test on a part of the screen, change to 1
21-
cfg.debug.transpWin = true; % To test with trasparent full size screen
21+
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,20 +40,22 @@
4040

4141
%% Experiment Design
4242

43-
% cfg.design.localizer = 'MT_MST';
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';
4451

45-
% cfg.design.motionType = 'radial';
4652
cfg.design.motionType = 'translation';
47-
4853
cfg.design.motionDirections = [0 0 180 180];
4954
cfg.design.names = {'static'; 'motion'};
55+
5056
cfg.design.nbRepetitions = 8;
5157
cfg.design.nbEventsPerBlock = 12; % DO NOT CHANGE
5258

53-
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
54-
cfg.design.names = {'fixation_right'; 'fixation_left'};
55-
end
56-
5759
%% Timing
5860

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

76-
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
77-
cfg.timing.IBI = 3.6;
78-
end
79-
8078
% reexpress those in terms of repetition time
8179
if cfg.pacedByTriggers.do
8280

@@ -94,10 +92,6 @@
9492
% Number of seconds after the end all the stimuli before ending the run
9593
cfg.timing.endDelay = 2;
9694

97-
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
98-
cfg.timing.IBI = 2;
99-
end
100-
10195
end
10296

10397
%% Visual Stimulation
@@ -109,9 +103,9 @@
109103
% Number of dots per visual angle square.
110104
cfg.dot.density = 1;
111105
% Dot life time in seconds
112-
cfg.dot.lifeTime = .15;
106+
cfg.dot.lifeTime = .4;
113107
% proportion of dots killed per frame
114-
cfg.dot.proportionKilledPerFrame = 0.005;
108+
cfg.dot.proportionKilledPerFrame = 0;
115109
% Dot Size (dot width) in visual angles.
116110
cfg.dot.size = .2;
117111
cfg.dot.color = cfg.color.white;
@@ -121,18 +115,9 @@
121115
cfg.aperture.width = []; % if left empty it will take the screen height
122116
cfg.aperture.xPos = 0;
123117

124-
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
125-
cfg.aperture.type = 'circle';
126-
cfg.aperture.width = 7; % if left empty it will take the screen height
127-
cfg.aperture.xPos = 7;
128-
end
129-
130118
%% Task(s)
131119

132120
cfg.task.name = 'visual localizer';
133-
if isfield(cfg.design, 'localizer') && strcmpi(cfg.design.localizer, 'MT_MST')
134-
cfg.task.name = 'mt mst localizer';
135-
end
136121

137122
% Instruction
138123
cfg.task.instruction = '1-Detect the RED fixation cross\n \n\n';
@@ -147,7 +132,7 @@
147132
cfg.fixation.yDisplacement = 0;
148133

149134
cfg.target.maxNbPerBlock = 1;
150-
cfg.target.duration = 0.05; % In secs
135+
cfg.target.duration = 0.1; % In secs
151136

152137
cfg.extraColumns = { ...
153138
'direction', ...
@@ -159,6 +144,9 @@
159144
'fixationPosition', ...
160145
'aperturePosition'};
161146

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

164152
function cfg = setKeyboards(cfg)
@@ -206,4 +194,34 @@
206194
cfg.screen.monitorWidth = 25;
207195
cfg.screen.monitorDistance = 95;
208196
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+
209227
end

subfun/doDotMo.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151

5252
apertureTexture('draw', cfg, thisEvent);
5353

54-
if thisEvent.target(1) && GetSecs < (onset + cfg.target.duration)
54+
thisFixation.fixation.color = cfg.fixation.color;
55+
if thisEvent.target(1) && vbl < (onset + cfg.target.duration)
5556
thisFixation.fixation.color = cfg.fixation.colorTarget;
5657
end
5758
drawFixation(thisFixation);

subfun/preTrialSetup.m

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,32 @@
1717
thisFixation.fixation = cfg.fixation;
1818
thisFixation.screen = cfg.screen;
1919

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+
29+
thisEvent.dotCenterXPosPix = 0;
30+
2031
switch thisEvent.trial_type
2132
case 'fixation_right'
2233
cfg.aperture.xPosPix = -abs(cfg.aperture.xPosPix);
2334

24-
thisFixation.fixation.xDisplacement = cfg.aperture.xPos;
35+
thisEvent.dotCenterXPosPix = cfg.aperture.xPosPix;
36+
37+
thisFixation.fixation.xDisplacement = cfg.design.xDisplacementFixation;
2538
thisFixation = initFixation(thisFixation);
2639

2740
case 'fixation_left'
2841
cfg.aperture.xPosPix = +abs(cfg.aperture.xPosPix);
2942

30-
thisFixation.fixation.xDisplacement = -cfg.aperture.xPos;
43+
thisEvent.dotCenterXPosPix = cfg.aperture.xPosPix;
44+
45+
thisFixation.fixation.xDisplacement = -cfg.design.xDisplacementFixation;
3146
thisFixation = initFixation(thisFixation);
3247

3348
end
File renamed without changes.

0 commit comments

Comments
 (0)