Skip to content

Commit 6c78920

Browse files
committed
update help sections
1 parent 1687753 commit 6c78920

File tree

14 files changed

+131
-54
lines changed

14 files changed

+131
-54
lines changed

src/fixation/drawFixation.m

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

33
function drawFixation(cfg)
4-
% Define the parameters of the fixation cross in `cfg` and `expParameters`
4+
%
5+
% Define the parameters of the fixation cross in `cfg`.
6+
%
7+
% USAGE::
8+
%
9+
% drawFixation(cfg)
10+
%
11+
% There are 3 types of fixations:
12+
%
13+
% - ``cross``
14+
% - ``dot``
15+
% - ``bestFixation``
16+
%
17+
% See initFixation for more info.
18+
%
519

620
switch cfg.fixation.type
721
case 'cross'
@@ -35,10 +49,6 @@ function drawFixation(cfg)
3549

3650
case 'bestFixation'
3751

38-
% Code adapted from:
39-
% What is the best fixation target?
40-
% DOI 10.1016/j.visres.2012.10.012
41-
4252
% Draw gap around fixation of 20% the size
4353
Screen('FillOval', ...
4454
cfg.screen.win, ...

src/fixation/initFixation.m

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

33
function cfg = initFixation(cfg)
4-
% cfg = initFixation(cfg)
54
%
6-
% prepare details for fixation "cross"
5+
% Prepare the details for fixation "cross".
6+
%
7+
% USAGE::
8+
%
9+
% cfg = initFixation(cfg)
710
%
811
% the fixation has a width defined by
9-
% cfg.fixation.width : in degrees of visual
12+
% ``cfg.fixation.width`` : in degrees of visual
1013
%
1114
% The horizontal and vertical offset (in degrees of visual) with respect to the center of the
12-
% screen is defined by
13-
% cfg.fixation.xDisplacement
14-
% cfg.fixation.yDisplacement
15+
% screen is defined by:
16+
%
17+
% - cfg.fixation.xDisplacement
18+
% - cfg.fixation.yDisplacement
1519
%
16-
% for cfg.fixation.type == 'bestFixation'
17-
% Code adapted from:
18-
% "What is the best fixation target?"
20+
% For cfg.fixation.type == 'bestFixation'
21+
%
22+
% Code adapted from: "What is the best fixation target?"
1923
% DOI 10.1016/j.visres.2012.10.012
2024
%
2125
% Contains a fixation cross and a dot
@@ -39,10 +43,6 @@
3943

4044
case 'bestFixation'
4145

42-
% Code adapted from:
43-
% What is the best fixation target?
44-
% DOI 10.1016/j.visres.2012.10.012
45-
4646
cfg.fixation.outerOval = [ ...
4747
cfg.screen.center(1) - cfg.fixation.widthPix / 2, ...
4848
cfg.screen.center(2) - cfg.fixation.widthPix / 2, ...

src/getExperimentEnd.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
% (C) Copyright 2020 CPP_PTB developers
22

33
function cfg = getExperimentEnd(cfg)
4+
%
5+
% Wrapper function that will show a fixation cross and display in the console the
6+
% whole experiment's duration in minutes and seconds
7+
%
48

59
drawFixation(cfg);
610
endExpmt = Screen('Flip', cfg.screen.win);

src/getExperimentStart.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
% (C) Copyright 2020 CPP_PTB developers
22

33
function cfg = getExperimentStart(cfg)
4-
% cfg = getExperimentStart(cfg)
54
%
6-
% Stores the onset time in cfg.experimentStart
5+
% Wrapper function that will show a fixation cross and collect a start timestamp
6+
% in ``cfg.experimentStart``
7+
%
8+
% USAGE::
9+
%
10+
% cfg = getExperimentStart(cfg)
11+
%
712

813
drawFixation(cfg);
914
vbl = Screen('Flip', cfg.screen.win);

src/initPTB.m

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

3-
function [cfg] = initPTB(cfg)
4-
% [cfg] = initPTB(cfg)
3+
function cfg = initPTB(cfg)
54
%
6-
% This will initialize PsychToolBox
7-
% - screen
8-
% - the windon opened takes the whole screen unless
9-
% cfg.screen.smallWin is set to true
10-
% - debug mode : skips synch test and warnings
11-
% - window transparency enabled by cfg.testingTranspScreen set to true
12-
% - gets the flip interval
13-
% - computes the pixel per degree of visual angle:
14-
% the computation for ppd assumes the windows takes the whole screenDistance
15-
% - set font details
16-
% - keyboard
17-
% - hides cursor
18-
% - sound
5+
% This will initialize PsychToolBox:
196
%
20-
% See the Readme for more details on the content of cfg
7+
% - screen
8+
% - the windon opened takes the whole screen unless
9+
% ``cfg.screen.smallWin`` is set to ``true``
10+
% - can skip synch test if you ask for it (nicely)
11+
% - window transparency enabled by ``cfg.testingTranspScreen`` set to ``true``
12+
% - gets the flip interval
13+
% - computes the pixel per degree of visual angle:
14+
% the computation for ppd assumes the windows takes the whole screen width
15+
% - set font details
16+
% - keyboard
17+
% - hides cursor
18+
% - sound
2119
%
20+
% USAGE::
21+
%
22+
% cfg = initPTB(cfg)
23+
%
24+
% See the set up page of the documentation for more details on the content of cfg
2225
%
2326
%
2427

src/keyboard/checkAbort.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
function checkAbort(cfg, deviceNumber)
44
%
5-
% Check for experiment abortion from operator. When no deviceNumber is set then it will check
6-
% the default device. When an abort key is detected this will set a global variable and throw a
5+
% Will quit your experiment if you press the key you have defined in
6+
% ``cfg.keyboard.escapeKey``.
7+
% When no deviceNumber is set then it will check the default device.
8+
% When an abort key is detected this will throw a
79
% specific error that can then be catched.
810
%
911
% USAGE::
1012
%
1113
% checkAbort(cfg, deviceNumber)
1214
%
13-
% Examples::
15+
% EXAMPLE::
1416
%
1517
% try
1618
%

src/keyboard/pressSpaceForMe.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
% (C) Copyright 2020 CPP_PTB developers
22

33
function pressSpaceForMe()
4-
% pressSpaceForMe()
54
%
65
% Use that to stop your script and only restart when the space bar is pressed.
6+
% This can be useful if as an experimenter you want to have one final check on
7+
% some set up before giving the green light.
8+
%
9+
% USAGE::
10+
%
11+
% pressSpaceForMe()
712
%
813

914
fprintf('\nPress space to continue.\n');

src/keyboard/testKeyboards.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
% (C) Copyright 2020 CPP_PTB developers
22

33
function testKeyboards(cfg)
4-
% testKeyboards(cfg)
54
%
65
% Checks that the keyboards asked for properly connected.
7-
% If no key is pressed on the correct keyboard after the timeOut time this exits with an error.
6+
%
7+
% If no key is pressed on the correct keyboard after the ``timeOut`` time,
8+
% this exits with an error.
9+
%
10+
% USAGE::
11+
%
12+
% testKeyboards(cfg)
13+
%
814

915
timeOut = 5;
1016

src/randomization/repeatShuffleConditions.m

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

33
function shuffledRepeats = repeatShuffleConditions(baseConditionVector, nbRepeats)
4-
% shuffledRepeats = repeatShuffleConditions(baseConditionVector, nbRepeats)
54
%
6-
% given baseConditionVector, a vector of conditions (coded as numbers), this will
7-
% create a longer vector made of nbRepeats of this base vector and make sure
8-
% that a given condition is not repeated one after the other
5+
% Given ``baseConditionVector``, a vector of conditions (coded as numbers),
6+
% this will create a longer vector made of ``nbRepeats`` of this base vector
7+
% and make sure that a given condition is not repeated one after the other.
8+
%
9+
% USAGE::
10+
%
11+
% shuffledRepeats = repeatShuffleConditions(baseConditionVector, nbRepeats)
12+
%
13+
% :param baseConditionVector:
14+
% :type baseConditionVector: vector
15+
% :param nbRepeats:
16+
% :type nbRepeats: integer
17+
%
18+
% :returns: - :shuffledRepeats: (vector) (dimension)
19+
%
920

1021
% TODO
1122
% - needs some input checks to make sure that there is actually a solution

src/randomization/setTargetPositionInSequence.m

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
% (C) Copyright 2020 CPP_PTB developers
22

33
function chosenPositions = setTargetPositionInSequence(seqLength, nbTarget, forbiddenPos)
4-
% chosenPositions = setTargetPositionInSequence(seqLength, nbTarget, forbiddenPos)
54
%
6-
% For a sequence of length seqLength where we want to insert nbTarget targets, this
7-
% will return nbTarget random position in that sequence and make sure that,
5+
% For a sequence of length ``seqLength`` where we want to insert ``nbTarget`` targets, this
6+
% will return ``nbTarget`` random position in that sequence and make sure that,
87
% they are not consecutive positions.
8+
%
9+
% USAGE::
10+
%
11+
% chosenPositions = setTargetPositionInSequence(seqLength, nbTarget, forbiddenPos)
12+
%
13+
% :param seqLength:
14+
% :type seqLength: integer
15+
% :param nbTarget:
16+
% :type nbTarget: integer
17+
% :param forbiddenPos:
18+
% :type forbiddenPos: vector of integers
19+
%
20+
% :returns: - :chosenPositions:
921

1022
REPLACE = false;
1123

0 commit comments

Comments
 (0)