Skip to content

Commit 13dd113

Browse files
committed
add postInitDots function
1 parent 8c8a0da commit 13dd113

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/dot/postInitDots.m

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
function cfg = postInitDots(cfg)
2+
%
3+
% cfg = postInitDots(cfg)
4+
%
5+
% generic function to finalize dots set up after psychtoolbox initialization
6+
%
7+
%
8+
% (C) Copyright 2022 CPP_PTB developpers
9+
10+
cfg.dot.matrixWidth = cfg.screen.winWidth;
11+
12+
% Convert some values from degrees to pixels
13+
cfg.dot = degToPix('size', cfg.dot, cfg);
14+
cfg.dot = degToPix('speed', cfg.dot, cfg);
15+
16+
% Get dot speeds in pixels per frame
17+
cfg.dot.speedPixPerFrame = cfg.dot.speedPix / cfg.screen.monitorRefresh;
18+
19+
cfg.aperture = degToPix('xPos', cfg.aperture, cfg);
20+
21+
% dots are displayed on a square with a length in visual angle equal to the
22+
% field of view
23+
cfg.dot.number = round(cfg.dot.density * ...
24+
(cfg.dot.matrixWidth / cfg.screen.ppd)^2);
25+
26+
end

0 commit comments

Comments
 (0)