Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/drawFieldOfVIew.m
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
% (C) Copyright 2020 CPP_PTB developers

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

if nargin < 2
centerOnScreen = true;
end

fov = [];

if isfield(cfg.screen, 'effectiveFieldOfView') && ...
numel(cfg.screen.effectiveFieldOfView) == 2
numel(cfg.screen.effectiveFieldOfView) == 4

RED = [255 0 0];
penWidth = 2;

fov = cfg.screen.effectiveFieldOfView;

fov = CenterRect( ...
[0, 0, fov(1), fov(2)], ...
cfg.screen.winRect);
if centerOnScreen
fov = CenterRect( ...
fov, ...
cfg.screen.winRect);
end

Screen('FrameRect', ...
cfg.screen.win, ...
Expand Down
4 changes: 4 additions & 0 deletions src/initPTB.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
%
%

% for octave: make sure information is not presented on prompt one screen at
% a time
more off;

checkPtbVersion();

cfg = getOsInfo(cfg);
Expand Down
4 changes: 3 additions & 1 deletion src/screen/farewellScreen.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ function farewellScreen(cfg)
Screen('FillRect', cfg.screen.win, cfg.color.background, cfg.screen.winRect);
DrawFormattedText(cfg.screen.win, 'Thank you!', 'center', 'center', cfg.text.color);
Screen('Flip', cfg.screen.win);
WaitSecs(cfg.mri.repetitionTime * 2);
if isfield(cfg, 'mri')
WaitSecs(cfg.mri.repetitionTime * 2);
end

end