Skip to content

Commit 6441d6a

Browse files
committed
update help sections
1 parent 6c78920 commit 6441d6a

File tree

11 files changed

+108
-54
lines changed

11 files changed

+108
-54
lines changed

src/aperture/apertureTexture.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
% (C) Copyright 2020 CPP_PTB developers
33

44
function [cfg, thisEvent] = apertureTexture(action, cfg, thisEvent)
5-
% [cfg, thisEvent] = apertureTexture(action, cfg, thisEvent)
5+
%
6+
% USAGE::
7+
%
8+
% [cfg, thisEvent] = apertureTexture(action, cfg, thisEvent)
69
%
710
%
811

src/aperture/eccenLogSpeed.m

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

33
function [cfg] = eccenLogSpeed(cfg, time)
4-
% vary CurrScale so that expansion speed is log over eccentricity
4+
%
5+
% Vary CurrScale so that expansion speed is log over eccentricity
56
% cf. Tootell 1997; Swisher 2007; Warnking 2002 etc
7+
%
8+
%
69

710
TR = cfg.mri.repetitionTime;
811
cycleDuration = TR * cfg.volsPerCycle;

src/aperture/smoothOval.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
% (C) Copyright 2020 CPP_PTB developers
33

44
function smoothOval(win, color, rect, fringe)
5-
% SmoothOval(WindowPtr, Color, Rect, Fringe)
6-
%
75
% Draws a filled oval (using the PTB parameters) with a transparent fringe.
86
%
7+
% USAGE::
8+
%
9+
% SmoothOval(WindowPtr, Color, Rect, Fringe)
10+
%
11+
%
912

1013
alphas = linspace(0, 255, fringe);
1114

src/aperture/smoothRect.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
% (C) Copyright 2020 CPP_PTB developers
33

44
function smoothRect(win, color, rect, fringe)
5-
% SmoothRect(WindowPtr, Color, Rect, Fringe)
65
%
76
% Draws a filled rect (using the PTB parameters) with a transparent fringe.
87
%
8+
% USAGE::
9+
%
10+
% SmoothRect(WindowPtr, Color, Rect, Fringe)
11+
%
912

1013
alphas = linspace(0, 255, fringe);
1114

src/dot/decomposeMotion.m

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

33
function [horVector, vertVector] = decomposeMotion(angleMotion)
4-
% [horVector, vertVector] = decomposeMotion(angleMotion)
54
%
6-
% decompose angle of start motion into horizontal and vertical vector
5+
% Decompose angle of start motion into horizontal and vertical vector.
6+
%
7+
% USAGE::
8+
%
9+
% [horVector, vertVector] = decomposeMotion(angleMotion)
10+
%
11+
% :param angleMotion: in degrees
12+
% :type angleMotion: scalar
13+
%
14+
% :returns: - :horVector: horizontal component of motion
15+
% - :vertVector: vertical component of motion
16+
%
717
%
8-
% - angleMotion: in degrees
9-
% - horVector: horizontal component of motion
10-
% - vertVector: vertical component of motion
1118

1219
horVector = cos(pi * angleMotion / 180);
1320
vertVector = -sin(pi * angleMotion / 180);

src/dot/dotMotionSimulation.m

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

33
function relativeDensityContrast = dotMotionSimulation(cfg, thisEvent, nbEvents, doPlot)
4-
% relativeDensityContrast = dotMotionSimulation(cfg, thisEvent, nbEvents, doPlot)
54
%
6-
% to simulate where the dots are more dense on the screen
7-
% relativeDensityContrast : hard to get it below 0.10
5+
% To simulate where the dots are more dense on the screen
6+
% relativeDensityContrast : hard to get it below 0.10.
7+
%
8+
% USAGE::
9+
%
10+
% relativeDensityContrast = dotMotionSimulation(cfg, thisEvent, nbEvents, doPlot)
11+
%
812

913
close all;
1014

src/dot/initDots.m

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

3-
function [dots] = initDots(cfg, thisEvent)
4-
% [dots] = initDots(cfg, thisEvent)
3+
function dots = initDots(cfg, thisEvent)
54
%
6-
% % Dot life time in seconds
7-
% cfg.dot.lifeTime
8-
% % Number of dots
9-
% cfg.dot.number
10-
% Proportion of coherent dots.
11-
% cfg.dot.coherence
5+
% Initialize dots for RDK
126
%
13-
% % Direction (an angle in degrees)
14-
% thisEvent.direction
15-
% % Speed expressed in pixels per frame
16-
% thisEvent.speed
7+
% USAGE::
178
%
9+
% dots = initDots(cfg, thisEvent)
10+
%
11+
% :param cfg:
12+
% :type cfg: structure
13+
% :param thisEvent:
14+
% :type thisEvent: structure
15+
%
16+
% :returns: - :dots: (structure)
17+
%
18+
%
19+
% - ``cfg.dot.lifeTime``: dot life time in seconds
20+
% - ``cfg.dot.number``: number of dots
21+
% - ``cfg.dot.coherence``: proportion of coherent dots.
22+
%
23+
% - ``thisEvent.direction``: direction (an angle in degrees)
24+
% - ``thisEvent.speed``: speed expressed in pixels per frame
25+
%
26+
% - ``dots.direction``
27+
% - ``dots.isSignal``: signal dots (1) and those are noise dots (0)
28+
% - ``dots.directionAllDots``
29+
% - ``dots.lifeTime``: in frames
30+
% - ``dots.speeds``: ``[ndots, 2]`` ; horizontal and vertical speed ; in pixels per frame
31+
% - ``dots.speedPixPerFrame``
1832
%
19-
% dots.direction
20-
% dots.isSignal : signal dots (1) and those are noise dots (0)
21-
% dots.directionAllDots
22-
% dots.lifeTime : in frames
23-
% dots.speeds : [ndots, 2] ; horizontal and vertical speed ; in pixels per frame
24-
% dots.speedPixPerFrame
2533

2634
dots.direction = thisEvent.direction(1);
2735

28-
% decide which dots are signal dots (1) and those are noise dots (0)
2936
dots.isSignal = rand(cfg.dot.number, 1) < cfg.dot.coherence;
3037

3138
dots.speedPixPerFrame = thisEvent.speedPix(1);
@@ -38,7 +45,7 @@
3845
lifeTime = Inf;
3946
end
4047

41-
% set position and directions fo the dots
48+
% set position and directions of the dots
4249
[dots.positions, dots.speeds, dots.time] = ...
4350
seedDots(dots, cfg, dots.isSignal);
4451

src/dot/setDotDirection.m

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

33
function directionAllDots = setDotDirection(positions, cfg, dots, isSignal)
4-
% directionAllDots = setDotDirection(positions, cfg, dots, isSignal)
54
%
6-
% creates some new direction for the dots
5+
% Creates some new direction for the dots.
76
%
8-
% coherent dots have a true value in the vector dots.isSignal and get
9-
% assigned a value equals to the one in dots.direction
7+
% USAGE::
108
%
11-
% all the other dots get a random value between 0 and 360.
9+
% directionAllDots = setDotDirection(positions, cfg, dots, isSignal)
1210
%
13-
% all directions are in end expressed between 0 and 360
11+
% :param positions:
12+
% :type positions:
13+
% :param cfg:
14+
% :type cfg:
15+
% :param dots:
16+
% :type dots:
17+
% :param isSignal:
18+
% :type isSignal:
19+
%
20+
% :returns: - :directionAllDots:
21+
%
22+
% Coherent dots have a true value in the vector ``isSignal``
23+
% and get assigned a value equals to the one in ``dots.direction``.
24+
%
25+
% All the other dots get a random value between 0 and 360.
26+
%
27+
% All directions are in end expressed between 0 and 360.
1428

1529
directionAllDots = dots.direction;
1630

src/eyeTracker.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
% - :cfg: (struct)
2222
%
2323
% - ``Calibration`` to initialize EyeLink and run calibration
24-
% - ``default calibration`` (default) will run a calibration with 6 points
25-
% - ``custom calibration`` (``cfg.eyeTracker.defaultCalibration = 'false'``) will run
26-
% a calibration with 6 points but the experimenter can choose their position
27-
% on the screen
24+
% - ``default calibration`` (default) will run a calibration with 6 points
25+
% - ``custom calibration`` (``cfg.eyeTracker.defaultCalibration = 'false'``) will run
26+
% a calibration with 6 points but the experimenter can choose their position
27+
% on the screen
2828
% - ``StartRecording``: to start eye movements recording
2929
% - ``Message``: will add a tag (e.g. ``Block_n1``) in the ET output file, the tag is a
3030
% string and it is input from `varargin`

src/keyboard/getResponse.m

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22

33
function responseEvents = getResponse(action, deviceNumber, cfg, getOnlyPress)
44
%
5-
% Wrapper function to use KbQueue. The queue will be listening to key presses
6-
% on a keyboard device:
5+
% Wrapper function to use ``KbQueue`` which is definitely what you should use
6+
% to collect responses. You can easily collect responses while running some
7+
% other code at the same time.
8+
%
9+
% The queue will be listening to key presses on a keyboard device:
710
% ``cfg.keyboard.responseBox`` or ``cfg.keyboard.keyboard`` are 2 main examples.
11+
%
812
% When no ``deviceNumber`` is set then it will listen to the default device.
13+
%
14+
% You can use it in a way so that it only takes responses from certain keys and
15+
% ignore others (like the triggers from an MRI scanner).
16+
%
917
% Check the ``CPP_getResponseDemo`` for a quick script on how to use it.
1018
%
1119
% USAGE::
@@ -44,9 +52,12 @@
4452
%
4553
% ``action`` options:
4654
%
47-
% - ``init`` to initialise the queue
55+
% - ``init`` to initialise the queue.
56+
% Initialize the buffer for key presses on a given device (you can also
57+
% specify the keys of interest that should be listened to).
4858
%
49-
% - ``start`` to start listening to keypresses
59+
% - ``start`` to start listening to the key presses (carefully insert into your
60+
% script - where do you want to start buffering the responses).
5061
%
5162
% - ``check`` checks all the key presses events since 'start', or since last 'check'
5263
% or 'flush' (whichever was the most recent)

0 commit comments

Comments
 (0)