-
Notifications
You must be signed in to change notification settings - Fork 0
/
Retinotopy_rings.psyexp
268 lines (268 loc) · 31.7 KB
/
Retinotopy_rings.psyexp
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<?xml version="1.0" ?>
<PsychoPy2experiment encoding="utf-8" version="2021.2.3">
<Settings>
<Param name="Audio latency priority" updates="None" val="use prefs" valType="str"/>
<Param name="Audio lib" updates="None" val="use prefs" valType="str"/>
<Param name="Completed URL" updates="None" val="" valType="str"/>
<Param name="Data file delimiter" updates="None" val="auto" valType="str"/>
<Param name="Data filename" updates="None" val="u'data/%s_%s_%s' % (expInfo['participant'], expName, expInfo['date'])" valType="code"/>
<Param name="Enable Escape" updates="None" val="True" valType="bool"/>
<Param name="Experiment info" updates="None" val="{'participant': '', 'run': '', 'date': ''}" valType="code"/>
<Param name="Force stereo" updates="None" val="True" valType="bool"/>
<Param name="Full-screen window" updates="None" val="True" valType="bool"/>
<Param name="HTML path" updates="None" val="" valType="str"/>
<Param name="Incomplete URL" updates="None" val="" valType="str"/>
<Param name="Monitor" updates="None" val="MRIMonitor" valType="str"/>
<Param name="Resources" updates="None" val="[]" valType="list"/>
<Param name="Save csv file" updates="None" val="True" valType="bool"/>
<Param name="Save excel file" updates="None" val="False" valType="bool"/>
<Param name="Save hdf5 file" updates="None" val="False" valType="bool"/>
<Param name="Save log file" updates="None" val="True" valType="bool"/>
<Param name="Save psydat file" updates="None" val="True" valType="bool"/>
<Param name="Save wide csv file" updates="None" val="True" valType="bool"/>
<Param name="Screen" updates="None" val="2" valType="num"/>
<Param name="Show info dlg" updates="None" val="True" valType="bool"/>
<Param name="Show mouse" updates="None" val="False" valType="bool"/>
<Param name="Units" updates="None" val="deg" valType="str"/>
<Param name="Use version" updates="None" val="" valType="str"/>
<Param name="Window size (pixels)" updates="None" val="[1280, 720]" valType="list"/>
<Param name="blendMode" updates="None" val="avg" valType="str"/>
<Param name="color" updates="None" val="$[0,0,0]" valType="color"/>
<Param name="colorSpace" updates="None" val="rgb" valType="str"/>
<Param name="elAddress" updates="None" val="100.1.1.1" valType="str"/>
<Param name="elDataFiltering" updates="None" val="FILTER_LEVEL_2" valType="str"/>
<Param name="elLiveFiltering" updates="None" val="FILTER_LEVEL_OFF" valType="str"/>
<Param name="elModel" updates="None" val="EYELINK 1000 DESKTOP" valType="str"/>
<Param name="elPupilAlgorithm" updates="None" val="ELLIPSE_FIT" valType="str"/>
<Param name="elPupilMeasure" updates="None" val="PUPIL_AREA" valType="str"/>
<Param name="elSampleRate" updates="None" val="1000" valType="num"/>
<Param name="elSimMode" updates="None" val="False" valType="bool"/>
<Param name="elTrackEyes" updates="None" val="RIGHT_EYE" valType="str"/>
<Param name="elTrackingMode" updates="None" val="PUPIL_CR_TRACKING" valType="str"/>
<Param name="expName" updates="None" val="Retinotopy_rings" valType="str"/>
<Param name="exportHTML" updates="None" val="on Sync" valType="str"/>
<Param name="eyetracker" updates="None" val="None" valType="str"/>
<Param name="gpAddress" updates="None" val="127.0.0.1" valType="str"/>
<Param name="gpPort" updates="None" val="4242" valType="num"/>
<Param name="logging level" updates="None" val="exp" valType="code"/>
<Param name="mgBlink" updates="None" val="('MIDDLE_BUTTON',)" valType="list"/>
<Param name="mgMove" updates="None" val="CONTINUOUS" valType="str"/>
<Param name="mgSaccade" updates="None" val="0.5" valType="num"/>
<Param name="tbLicenseFile" updates="None" val="" valType="str"/>
<Param name="tbModel" updates="None" val="" valType="str"/>
<Param name="tbSampleRate" updates="None" val="60" valType="num"/>
<Param name="tbSerialNo" updates="None" val="" valType="str"/>
</Settings>
<Routines>
<Routine name="Welcome">
<TextComponent name="Welcome_text">
<Param name="color" updates="constant" val="white" valType="color"/>
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="contrast" updates="constant" val="1" valType="num"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="flip" updates="constant" val="None" valType="str"/>
<Param name="font" updates="constant" val="Open Sans" valType="str"/>
<Param name="languageStyle" updates="None" val="LTR" valType="str"/>
<Param name="letterHeight" updates="constant" val="1" valType="num"/>
<Param name="name" updates="None" val="Welcome_text" valType="code"/>
<Param name="opacity" updates="constant" val="" valType="num"/>
<Param name="ori" updates="constant" val="0" valType="num"/>
<Param name="pos" updates="constant" val="(0, 0)" valType="list"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="text" updates="constant" val="Welcome!&#10;&#10;Press 'space' to continue" valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="num"/>
</TextComponent>
<KeyboardComponent name="Welcome_rsp">
<Param name="allowedKeys" updates="constant" val="'space'" valType="list"/>
<Param name="correctAns" updates="constant" val="" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="discard previous" updates="constant" val="True" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="True" valType="bool"/>
<Param name="name" updates="None" val="Welcome_rsp" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="store" updates="constant" val="last key" valType="str"/>
<Param name="storeCorrect" updates="constant" val="False" valType="bool"/>
<Param name="syncScreenRefresh" updates="constant" val="True" valType="bool"/>
</KeyboardComponent>
</Routine>
<Routine name="Instructions">
<TextComponent name="Instructions_text">
<Param name="color" updates="constant" val="white" valType="color"/>
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="contrast" updates="constant" val="1" valType="num"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="flip" updates="constant" val="None" valType="str"/>
<Param name="font" updates="constant" val="Open Sans" valType="str"/>
<Param name="languageStyle" updates="None" val="LTR" valType="str"/>
<Param name="letterHeight" updates="constant" val="1" valType="num"/>
<Param name="name" updates="None" val="Instructions_text" valType="code"/>
<Param name="opacity" updates="constant" val="" valType="num"/>
<Param name="ori" updates="constant" val="0" valType="num"/>
<Param name="pos" updates="constant" val="(0, 0)" valType="list"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="text" updates="constant" val="Please stare at the fixation for the duration of the experiment.&#10;&#10;Press 'space' when you are happy to begin." valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="num"/>
</TextComponent>
<KeyboardComponent name="Instructions_rsp">
<Param name="allowedKeys" updates="constant" val="'space'" valType="list"/>
<Param name="correctAns" updates="constant" val="" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="discard previous" updates="constant" val="True" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="True" valType="bool"/>
<Param name="name" updates="None" val="Instructions_rsp" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="store" updates="constant" val="last key" valType="str"/>
<Param name="storeCorrect" updates="constant" val="False" valType="bool"/>
<Param name="syncScreenRefresh" updates="constant" val="True" valType="bool"/>
</KeyboardComponent>
</Routine>
<Routine name="End">
<TextComponent name="End_text">
<Param name="color" updates="constant" val="white" valType="color"/>
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="contrast" updates="constant" val="1" valType="num"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="flip" updates="constant" val="None" valType="str"/>
<Param name="font" updates="constant" val="Open Sans" valType="str"/>
<Param name="languageStyle" updates="None" val="LTR" valType="str"/>
<Param name="letterHeight" updates="constant" val="1" valType="num"/>
<Param name="name" updates="None" val="End_text" valType="code"/>
<Param name="opacity" updates="constant" val="" valType="num"/>
<Param name="ori" updates="constant" val="0" valType="num"/>
<Param name="pos" updates="constant" val="(0, 0)" valType="list"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="text" updates="constant" val="The End!&#10;&#10;Press 'space' to close" valType="str"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="wrapWidth" updates="constant" val="" valType="num"/>
</TextComponent>
<KeyboardComponent name="End_resp">
<Param name="allowedKeys" updates="constant" val="'space'" valType="list"/>
<Param name="correctAns" updates="constant" val="" valType="str"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="discard previous" updates="constant" val="True" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="forceEndRoutine" updates="constant" val="True" valType="bool"/>
<Param name="name" updates="None" val="End_resp" valType="code"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="" valType="code"/>
<Param name="store" updates="constant" val="last key" valType="str"/>
<Param name="storeCorrect" updates="constant" val="False" valType="bool"/>
<Param name="syncScreenRefresh" updates="constant" val="True" valType="bool"/>
</KeyboardComponent>
</Routine>
<Routine name="Ring">
<CodeComponent name="Ring_code">
<Param name="Before Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Before JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="startRing = trigClock.getTime();&#10;psychoJS.experiment.addData("startRingTime", startRing);&#10;num_wedges = 24;&#10;num_rings = 8;&#10;num_expansions = 1;&#10;wedge_size = [0, 360];&#10;stim_size = [14, 14];&#10;opacity = 0.98;&#10;one_ring_size = (stim_size[1] / num_rings);&#10;ring_sizes = np.arange(1.75, 15, 1.75);&#10;circle_sizes = (np.arange(0, 14, 1.75) / 2);&#10;TR = 2;&#10;secs_per_expansion = 36;&#10;secs_per_ring = (secs_per_expansion / ring_sizes.length);&#10;frame_rate = 0.0166;&#10;flash_freq = 6;&#10;ms_per_pattern = Math.round((1000 / flash_freq));&#10;secs_per_pattern = (ms_per_pattern / 1000);&#10;frames_per_pattern = Math.round((secs_per_pattern / frame_rate));&#10;frames_per_ring = Math.round((secs_per_ring / frame_rate));&#10;total_frames = Math.round(((frames_per_ring * ring_sizes.length) * num_expansions));&#10;total_time = (total_frames * frame_rate);&#10;fix = new visual.Circle(psychoJS.window, {"radius": 0.5, "edges": 128, "units": "deg", "lineWidth": 0, "lineColor": null, "lineColorSpace": null, "fillColor": "green", "fillColorSpace": null, "size": 0.5, "ori": 0.0, "opacity": null, "contrast": 1.0, "depth": 0, "interpolate": true, "lineRGB": false, "fillRGB": false, "name": null, "autoLog": null, "autoDraw": false, "color": null, "colorSpace": "rgb"});&#10;for (var s, _pj_c = 0, _pj_a = util.range(num_expansions), _pj_b = _pj_a.length; (_pj_c < _pj_b); _pj_c += 1) {&#10; s = _pj_a[_pj_c];&#10; for (var r, _pj_f = 0, _pj_d = util.range(ring_sizes.length), _pj_e = _pj_d.length; (_pj_f < _pj_e); _pj_f += 1) {&#10; r = _pj_d[_pj_f];&#10; ring_s = ring_sizes[r];&#10; circle_s = circle_sizes[r];&#10; numrings = (r + 1);&#10; T = trigClock.getTime();&#10; psychoJS.experiment.addData((("startRing" + s.toString()) + r.toString()), T);&#10; smallC = new visual.Circle(psychoJS.window, {"radius": circle_s, "size": 1, "edges": 128, "units": "deg", "lineWidth": 0, "lineColor": null, "lineColorSpace": null, "fillColor": "grey", "fillColorSpace": null, "ori": 0.0, "opacity": null, "contrast": 1.0, "depth": 0, "interpolate": true, "lineRGB": false, "fillRGB": false, "name": null, "autoLog": null, "autoDraw": false, "color": null, "colorSpace": "rgb"});&#10; wedge1 = new visual.RadialStim(psychoJS.window, {"tex": "sqrXsqr", "mask": "none", "units": "deg", "pos": [0.0, 0.0], "size": ring_s, "radialCycles": numrings, "angularCycles": num_wedges, "radialPhase": 14, "angularPhase": 0, "ori": 0, "texRes": 64, "angularRes": 100, "visibleWedge": wedge_size, "rgb": null, "color": [(- 1.0), (- 1.0), (- 1.0)], "colorSpace": "rgb", "dkl": null, "lms": null, "contrast": 1.0, "opacity": opacity, "depth": 0, "rgbPedestal": [0.0, 0.0, 0.0], "interpolate": false, "name": "Wedge1", "autoLog": null, "maskParams": null});&#10; wedge2 = new visual.RadialStim(psychoJS.window, {"tex": "sqrXsqr", "mask": "none", "units": "deg", "pos": [0.0, 0.0], "size": ring_s, "radialCycles": numrings, "angularCycles": num_wedges, "radialPhase": 14, "angularPhase": 0, "ori": 0, "texRes": 64, "angularRes": 100, "visibleWedge": wedge_size, "rgb": null, "color": [(- 1.0), (- 1.0), (- 1.0)], "colorSpace": "rgb", "dkl": null, "lms": null, "contrast": (- 1.0), "opacity": opacity, "depth": 0, "rgbPedestal": [0.0, 0.0, 0.0], "interpolate": false, "name": "Wedge2", "autoLog": null, "maskParams": null});&#10; for (var frameN, _pj_i = 0, _pj_g = util.range(Math.round((frames_per_ring / (frames_per_pattern * 2)))), _pj_h = _pj_g.length; (_pj_i < _pj_h); _pj_i += 1) {&#10; frameN = _pj_g[_pj_i];&#10; for (var frameN, _pj_l = 0, _pj_j = util.range((frames_per_pattern * 2)), _pj_k = _pj_j.length; (_pj_l < _pj_k); _pj_l += 1) {&#10; frameN = _pj_j[_pj_l];&#10; if (((0 <= frameN) && (frameN <= frames_per_pattern))) {&#10; wedge1.draw(psychoJS.window);&#10; smallC.draw(psychoJS.window);&#10; fix.draw(psychoJS.window);&#10; psychoJS.window.flip();&#10; }&#10; if (((frames_per_pattern < frameN) && (frameN <= (frames_per_pattern + frames_per_pattern)))) {&#10; wedge2.draw(psychoJS.window);&#10; smallC.draw(psychoJS.window);&#10; fix.draw(psychoJS.window);&#10; psychoJS.window.flip();&#10; }&#10; }&#10; }&#10; }&#10;}&#10;" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="## Parameters of visual.RadialStim&#10;# angular cycles: number of spokes&#10;# angular phase: orientation of the texture&#10;# angular res: number of triangles used&#10;# radial cycles: the number of rings&#10;# radial phas: phase of the texture from the centre to the&#10;# perimiter of the stimulus. Can be used to drift rings&#10;# inwards/outwards&#10;# sf: spatial frequency of the grating texture&#10;# if units are deg, sf is cycles per degree&#10;# visible wedge: (start,end), (0,360) is full visibility&#10;# auto draw: whether the stimulus should be automatically drawn&#10;# on each frame flip.&#10;# auto log: every change logged?&#10;# contrast: 1 visible, 0 no contrast, -1 reversed&#10;# ori: orientation in degrees. 0 vertical, positive values&#10;# rotate clockwise&#10;# pos: centre of the stimuli&#10;&#10;#ringClock = core.Clock()&#10;startRing = trigClock.getTime() # in relation to triggers&#10;thisExp.addData('startRingTime',startRing)&#10;&#10;## Set some parameters for drawing the stimuli&#10;num_wedges = 24&#10;num_rings = 8 #total of 8 rings&#10;num_expansions =1 #8 steps outwards&#10;wedge_size = (0,360) #full circle this time&#10;stim_size = (14, 14) #degrees&#10;opacity = 0.98&#10;one_ring_size = stim_size[1]/num_rings #1.75&#10;#ring_sizes = numpy.arange(one_ring_size,stim_size[1],stim_size[1]+1)&#10;ring_sizes = np.arange(1.75,15,1.75) # should be proportional to stim_size&#10;circle_sizes = np.arange(0,14,1.75)/2 # radius! one size behind the rings&#10;&#10;## Set the timings and frame numbers&#10;TR = 2&#10;secs_per_expansion = 36 #s&#10;secs_per_ring = secs_per_expansion/len(ring_sizes) # 4.5s&#10;frame_rate = 0.0166 #s&#10;flash_freq = 6 #hz&#10;ms_per_pattern = round(1000/flash_freq) #1666.66 or 167ms&#10;secs_per_pattern = ms_per_pattern/1000 # 0.167s&#10;frames_per_pattern = round(secs_per_pattern/frame_rate) # 10&#10;frames_per_ring = round(secs_per_ring/frame_rate) #271&#10;total_frames = round(frames_per_ring*len(ring_sizes)*num_expansions) #17344&#10;total_time = total_frames*frame_rate #287.91s or 4.79mins&#10;&#10;## draw a fixation circle&#10;fix = visual.Circle(win,radius=0.5, edges=128, units='deg', lineWidth=0,&#10; lineColor=None, lineColorSpace=None, fillColor='green', fillColorSpace=None,&#10; size=0.5, ori=0.0, opacity=None, contrast=1.0, depth=0, &#10; interpolate=True, lineRGB=False, fillRGB=False, name=None, autoLog=None,&#10; autoDraw=False, color=None, colorSpace='rgb')&#10; &#10;## Loop over 8 ring cycles&#10;for s in range(num_expansions):&#10;## Loop over ring positions&#10; for r in range(len(ring_sizes)):&#10; ring_s = ring_sizes[r]&#10; circle_s = circle_sizes[r]&#10; numrings = r+1 # python index starts at 0&#10; &#10; T = trigClock.getTime() # save time&#10; thisExp.addData(('startRing'+str(s)+str(r)),T)&#10; &#10; # draw a small circle to hide central rings&#10; # two rings are always visible&#10; smallC = visual.Circle(win,radius=circle_s,size=1,edges=128, units='deg', lineWidth=0,&#10; lineColor=None, lineColorSpace=None, fillColor='grey', fillColorSpace=None,&#10; ori=0.0, opacity=None, contrast=1.0, depth=0, &#10; interpolate=True, lineRGB=False, fillRGB=False, name=None, autoLog=None,&#10; autoDraw=False, color=None, colorSpace='rgb')&#10; &#10; # Draw wedges with correct orientation&#10; # wedge pattern 1 (contrast 1)&#10; wedge1 = visual.RadialStim(win,tex='sqrXsqr', mask='none',&#10; units='deg', pos=(0.0, 0.0), size=ring_s, radialCycles=numrings,&#10; angularCycles=num_wedges, radialPhase=14, angularPhase=0, ori=0,&#10; texRes=64, angularRes=100, visibleWedge=wedge_size, rgb=None,&#10; color=(-1.0, -1.0, -1.0), colorSpace='rgb', dkl=None, lms=None,&#10; contrast=1.0, opacity=opacity, depth=0, rgbPedestal=(0.0, 0.0, 0.0), &#10; interpolate=False, name='Wedge1', autoLog=None, maskParams=None)&#10;&#10; # wedge pattern 2 (contrast -1)&#10; wedge2 = visual.RadialStim(win,tex='sqrXsqr', mask='none',&#10; units='deg', pos=(0.0, 0.0), size=ring_s, radialCycles=numrings,&#10; angularCycles=num_wedges, radialPhase=14, angularPhase=0, ori=0,&#10; texRes=64, angularRes=100, visibleWedge=wedge_size, rgb=None,&#10; color=(-1.0, -1.0, -1.0), colorSpace='rgb', dkl=None, lms=None,&#10; contrast=-1.0, opacity=opacity, depth=0, rgbPedestal=(0.0, 0.0, 0.0), &#10; interpolate=False, name='Wedge2', autoLog=None, maskParams=None)&#10;&#10; # loop over all frames per ring - 2 frames rounded out!&#10; for frameN in range(round(frames_per_ring/(frames_per_pattern*2))): &#10; # loop over one patern reversal&#10; for frameN in range(frames_per_pattern*2): &#10; if 0 <= frameN <= frames_per_pattern:&#10; wedge1.draw(win)&#10; smallC.draw(win)&#10; fix.draw(win)&#10; win.flip() &#10; if frames_per_pattern < frameN <= (frames_per_pattern+frames_per_pattern):&#10; wedge2.draw(win)&#10; smallC.draw(win)&#10; fix.draw(win)&#10; win.flip() &#10; &#10;# end&#10;" valType="extendedCode"/>
<Param name="Code Type" updates="None" val="Auto->JS" valType="str"/>
<Param name="Each Frame" updates="constant" val="" valType="extendedCode"/>
<Param name="Each JS Frame" updates="constant" val="" valType="extendedCode"/>
<Param name="End Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="endRing = trigClock.getTime();&#10;psychoJS.experiment.addData("endRingTime", endRing);&#10;continueRoutine = true;&#10;" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="endRing = trigClock.getTime()&#10;thisExp.addData('endRingTime',endRing)&#10;&#10;continueRoutine = True" valType="extendedCode"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="Ring_code" valType="code"/>
</CodeComponent>
</Routine>
<Routine name="Fixation">
<PolygonComponent name="Fixation_circle">
<Param name="colorSpace" updates="constant" val="rgb" valType="str"/>
<Param name="contrast" updates="constant" val="1" valType="num"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="durationEstim" updates="None" val="" valType="code"/>
<Param name="fillColor" updates="constant" val="green" valType="color"/>
<Param name="interpolate" updates="constant" val="linear" valType="str"/>
<Param name="lineColor" updates="constant" val="green" valType="color"/>
<Param name="lineWidth" updates="constant" val="1" valType="num"/>
<Param name="nVertices" updates="constant" val="4" valType="int"/>
<Param name="name" updates="None" val="Fixation_circle" valType="code"/>
<Param name="opacity" updates="constant" val="" valType="num"/>
<Param name="ori" updates="constant" val="0" valType="num"/>
<Param name="pos" updates="constant" val="(0, 0)" valType="list"/>
<Param name="saveStartStop" updates="None" val="True" valType="bool"/>
<Param name="shape" updates="None" val="circle" valType="str"/>
<Param name="size" updates="constant" val="(0.5, 0.5)" valType="list"/>
<Param name="startEstim" updates="None" val="" valType="code"/>
<Param name="startType" updates="None" val="time (s)" valType="str"/>
<Param name="startVal" updates="None" val="0.0" valType="code"/>
<Param name="stopType" updates="None" val="duration (s)" valType="str"/>
<Param name="stopVal" updates="constant" val="8.0" valType="code"/>
<Param name="syncScreenRefresh" updates="None" val="True" valType="bool"/>
<Param name="units" updates="None" val="from exp settings" valType="str"/>
<Param name="vertices" updates="constant" val="" valType="list"/>
</PolygonComponent>
</Routine>
<Routine name="WaitForTriggers">
<CodeComponent name="code">
<Param name="Before Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Before JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="trigKeyboard = new keyboard.Keyboard();&#10;trigClock = new core.Clock();&#10;textTrig = new visual.TextStim(psychoJS.window, "Waiting for scanner...", {"color": "white", "colorSpace": "rgb", "height": 1});&#10;textTrig.draw(psychoJS.window);&#10;psychoJS.window.flip();&#10;" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="trigKeyboard = keyboard.Keyboard()&#10;trigClock = core.Clock()&#10;&#10;# draw waiting text&#10;textTrig = visual.TextStim(win, 'Waiting for scanner...',&#10; color=('white'), colorSpace='rgb', height=1)&#10;textTrig.draw(win)&#10;win.flip()" valType="extendedCode"/>
<Param name="Code Type" updates="None" val="Auto->JS" valType="str"/>
<Param name="Each Frame" updates="constant" val="&#10;# how many triggers to wait for?&#10;triggers = 4 &#10;&#10;# wait for keypresses here&#10;rtList = []&#10;count = 0&#10;while count < triggers:&#10; if trigKeyboard.getKeys(keyList=["s"]):&#10; count = count+1 &#10; rt = trigClock.getTime()&#10; thisExp.addData('trigKeyboard.rt',rt)&#10; thisExp.nextEntry()&#10; &#10; &#10;" valType="extendedCode"/>
<Param name="Each JS Frame" updates="constant" val="triggers = 4;&#10;rtList = [];&#10;count = 0;&#10;while ((count < triggers)) {&#10; if (trigKeyboard.getKeys({"keyList": ["s"]})) {&#10; count = (count + 1);&#10; rt = trigClock.getTime();&#10; psychoJS.experiment.addData("trigKeyboard.rt", rt);&#10; psychoJS.experiment.nextEntry();&#10; }&#10;}&#10;" valType="extendedCode"/>
<Param name="End Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="code" valType="code"/>
</CodeComponent>
</Routine>
</Routines>
<Flow>
<Routine name="Welcome"/>
<Routine name="Instructions"/>
<Routine name="WaitForTriggers"/>
<Routine name="Fixation"/>
<Routine name="Ring"/>
<Routine name="Fixation"/>
<Routine name="End"/>
</Flow>
</PsychoPy2experiment>