Skip to content

Commit fbd03db

Browse files
committed
add wrapper functions for experiment start end farewell and stand by screen
1 parent 751dc67 commit fbd03db

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

farewellScreen.m

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

getExperimentEnd.m

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function cfg = getExperimentEnd(cfg)
2+
3+
drawFixation(cfg);
4+
endExpmt = Screen('Flip', cfg.screen.win);
5+
6+
disp(' ');
7+
ExpmtDur = endExpmt - cfg.experimentStart;
8+
ExpmtDurMin = floor(ExpmtDur / 60);
9+
ExpmtDurSec = mod(ExpmtDur, 60);
10+
disp(['Experiment lasted ', ...
11+
num2str(ExpmtDurMin), ' minutes', ...
12+
num2str(ExpmtDurSec), ' seconds']);
13+
disp(' ');
14+
15+
end

getExperimentStart.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function cfg = getExperimentStart(cfg)
2+
% Show the fixation cross
3+
drawFixation(cfg);
4+
vbl = Screen('Flip', cfg.screen.win);
5+
cfg.experimentStart = vbl;
6+
end

standByScreen.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function standByScreen(cfg)
2+
3+
Screen('FillRect', cfg.screen.win, cfg.color.background, cfg.screen.winRect);
4+
5+
DrawFormattedText(cfg.screen.win, ...
6+
cfg.task.instruction, ...
7+
'center', 'center', cfg.text.color);
8+
9+
Screen('Flip', cfg.screen.win);
10+
11+
% Wait for space key to be pressed
12+
pressSpaceForMe();
13+
14+
end

0 commit comments

Comments
 (0)