Skip to content

Commit e5e9323

Browse files
authored
Merge pull request #133 from cpp-lln-lab/remi-estimate_field_of_view
updates from estimate field of view
2 parents d15f9bc + 935dab3 commit e5e9323

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

src/drawFieldOfVIew.m

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
% (C) Copyright 2020 CPP_PTB developers
22

3-
function drawFieldOfVIew(cfg)
3+
function fov = drawFieldOfVIew(cfg, centerOnScreen)
44
% drawFieldOfVIew(cfg)
55
%
66
% draws a red rectangle on the screen to materialize the field of view of
77
% the participant. This can be used during debugging to help design the
88
% stimuli if you know the FOV of the participant will be obstructed by
99
% something
1010

11+
if nargin < 2
12+
centerOnScreen = true;
13+
end
14+
15+
fov = [];
16+
1117
if isfield(cfg.screen, 'effectiveFieldOfView') && ...
12-
numel(cfg.screen.effectiveFieldOfView) == 2
18+
numel(cfg.screen.effectiveFieldOfView) == 4
1319

1420
RED = [255 0 0];
1521
penWidth = 2;
1622

1723
fov = cfg.screen.effectiveFieldOfView;
1824

19-
fov = CenterRect( ...
20-
[0, 0, fov(1), fov(2)], ...
21-
cfg.screen.winRect);
25+
if centerOnScreen
26+
fov = CenterRect( ...
27+
fov, ...
28+
cfg.screen.winRect);
29+
end
2230

2331
Screen('FrameRect', ...
2432
cfg.screen.win, ...

src/initPTB.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
%
2323
%
2424

25+
% for octave: make sure information is not presented on prompt one screen at
26+
% a time
27+
more off;
28+
2529
checkPtbVersion();
2630

2731
cfg = getOsInfo(cfg);

src/screen/farewellScreen.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ function farewellScreen(cfg)
55
Screen('FillRect', cfg.screen.win, cfg.color.background, cfg.screen.winRect);
66
DrawFormattedText(cfg.screen.win, 'Thank you!', 'center', 'center', cfg.text.color);
77
Screen('Flip', cfg.screen.win);
8-
WaitSecs(cfg.mri.repetitionTime * 2);
8+
if isfield(cfg, 'mri')
9+
WaitSecs(cfg.mri.repetitionTime * 2);
10+
end
911

1012
end

0 commit comments

Comments
 (0)