-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetupDots.m
50 lines (45 loc) · 2.42 KB
/
setupDots.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
% This code reproduces the analyses in the paper
% Urai AE, Braun A, Donner THD (2016) Pupil-linked arousal is driven
% by decision uncertainty and alters serial choice bias.
%
% Permission is hereby granted, free of charge, to any person obtaining a
% copy of this software and associated documentation files (the "Software"),
% to deal in the Software without restriction, including without limitation
% the rights to use, copy, modify, merge, publish, distribute, sublicense,
% and/or sell copies of the Software, and to permit persons to whom the
% Software is furnished to do so, subject to the following conditions:
%
% The above copyright notice and this permission notice shall be included
% in all copies or substantial portions of the Software.
% If you use the Software for your own research, cite the paper.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
% OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
% DEALINGS IN THE SOFTWARE.
%
% Anne Urai, 2016
% anne.urai@gmail.com
function [dots, fix] = setupDots(window)
% DOTS CHARACTERISTICS
dots = struct; %preallocate
% parameters that stay constant
dots.radius = deg2pix(window, 12); %keep constant
dots.innerspace = deg2pix(window, 2);
dots.lifetime = 4; % in frames
dots.nvar = 3; %interleave two variants of the stimulus
dots.color = [255 255 255]; % always 100% dot contrast
% determine the appearance of the dots - as in Siegel, 2007
dots.speed = deg2pix(window, 11.5); % speed of the dots in degrees/second
dots.size = deg2pix(window, 0.2); %size of each dot in degrees
dots.density = 1.7; % dot density in dots per degree^2
dots.nDots = round(dots.density*pi*pix2deg(window, dots.radius)^2); %number of dots in the circle, calculated from density (can also just be a fixed nr, eg. 500
% FIXATION
% this is the fixation descibed in Thaler et al. 2013
fix.dotsize = deg2pix(window,0.2); % fixation dot
fix.circlesize = deg2pix(window,0.6); % circle around fixation dot
fix.color = [255 0 0];
end