Skip to content

Commit 46f990f

Browse files
committed
mh autofix
1 parent 5fcf736 commit 46f990f

File tree

8 files changed

+32
-34
lines changed

8 files changed

+32
-34
lines changed

apertureTexture.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
case 'circle'
2828

2929
diameter = cfg.aperture.widthPix;
30-
30+
3131
xPos = cfg.screen.center(1);
3232
yPos = cfg.screen.center(2);
3333
if isfield(cfg.aperture, 'xPosPix')
@@ -40,7 +40,7 @@
4040
Screen('FillOval', cfg.aperture.texture, transparent, ...
4141
CenterRectOnPoint([0 0 repmat(diameter, 1, 2)], ...
4242
xPos, yPos));
43-
43+
4444
end
4545

4646
case 'draw'

computeFOV.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
%
66
% δ = 2 arctan ( d / 2D )
77
%
8-
% δ is the angular diameter, and d is the actual diameter of the object,
9-
% and D is the distance to the object.
10-
% The result obtained is in radians.
8+
% δ is the angular diameter, and d is the actual diameter of the object,
9+
% and D is the distance to the object.
10+
% The result obtained is in radians.
1111
%
1212

1313
FOV = ...
1414
180 / pi * ...
15-
2 * atan( cfg.screen.monitorWidth / (2 * cfg.screen.monitorDistance) );
15+
2 * atan(cfg.screen.monitorWidth / (2 * cfg.screen.monitorDistance));
1616

1717
end

dotTexture.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
cfg.color.background(1) * ones(cfg.screen.winRect([4 3])));
88

99
case 'make'
10-
10+
1111
dotType = 2;
1212

1313
Screen('FillRect', cfg.dot.texture, cfg.color.background);

drawFixation.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ function drawFixation(cfg)
22
% Define the parameters of the fixation cross in `cfg` and `expParameters`
33

44
if strcmp(cfg.fixation.type, 'cross')
5-
5+
66
smooth = 1;
7-
7+
88
Screen('DrawLines', ...
99
cfg.screen.win, ...
1010
cfg.fixation.allCoords, ...

initFixation.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
cfg.fixation = degToPix('yDisplacement', cfg.fixation, cfg);
99

1010
% Prepare fixation cross
11-
cfg.fixation.xCoords = [-cfg.fixation.widthPix cfg.fixation.widthPix 0 0]/2 + ...
11+
cfg.fixation.xCoords = [-cfg.fixation.widthPix cfg.fixation.widthPix 0 0] / 2 + ...
1212
cfg.fixation.xDisplacementPix;
13-
cfg.fixation.yCoords = [0 0 -cfg.fixation.widthPix cfg.fixation.widthPix]/2 + ...
13+
cfg.fixation.yCoords = [0 0 -cfg.fixation.widthPix cfg.fixation.widthPix] / 2 + ...
1414
cfg.fixation.yDisplacementPix;
1515
cfg.fixation.allCoords = [cfg.fixation.xCoords; cfg.fixation.yCoords];
1616

1717
end
1818

19-
end
19+
end

initializeDots.m

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
function [dots] = initializeDots(cfg, thisEvent)
2-
2+
33
direction = thisEvent.direction(1);
4-
4+
55
dots.lifeTime = cfg.dot.lifeTime;
6-
7-
speedPixPerFrame = thisEvent.speed(1);
8-
6+
7+
speedPixPerFrame = thisEvent.speed(1);
8+
99
% decide which dots are signal dots (1) and those are noise dots (0)
1010
dots.isSignal = rand(cfg.dot.number, 1) < cfg.dot.coherence;
11-
11+
1212
% for static dots
1313
if direction == -1
1414
speedPixPerFrame = 0;
1515
dots.lifeTime = cfg.eventDuration;
1616
dots.isSignal = ones(cfg.dot.number, 1);
1717
end
18-
18+
1919
% Convert from seconds to frames
2020
dots.lifeTime = ceil(dots.lifeTime / cfg.screen.ifi);
2121

@@ -24,27 +24,26 @@
2424
% [0,0] is the top / left of the square
2525
% [1,1] is the bottom / right of the square
2626
dots.positions = rand(cfg.dot.number, 2) * cfg.screen.winWidth;
27-
28-
% Set a N x 2 matrix that speed in X and Y
27+
28+
% Set a N x 2 matrix that speed in X and Y
2929
dots.speeds = nan(cfg.dot.number, 2);
30-
30+
3131
% Coherent dots
3232
[horVector, vertVector] = decompMotion(direction);
33-
dots.speeds(dots.isSignal,:) = ...
33+
dots.speeds(dots.isSignal, :) = ...
3434
repmat([horVector, vertVector], sum(dots.isSignal), 1);
35-
35+
3636
% If not 100% coherence, we get new random direction for the other dots
3737
direction = rand(sum(~dots.isSignal), 1) * 360;
3838
[horVector, vertVector] = decompMotion(direction);
3939
dots.speeds(~dots.isSignal, :) = [horVector, vertVector];
40-
40+
4141
% So far we were working wiht unit vectors convert that speed in pixels per
4242
% frame
4343
dots.speeds = dots.speeds * speedPixPerFrame;
44-
44+
4545
% Create a vector to update to dotlife time of each dot
4646
% Not all set to one so the dots will die at different times
4747
dots.time = floor(rand(cfg.dot.number, 1) * cfg.eventDuration / cfg.screen.ifi);
48-
49-
end
5048

49+
end

tests/test_setDefaultsPTB.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ function test_setDefaultsPTB()
6161
'monitorWidth', 42, ...
6262
'monitorDistance', 134));
6363

64-
6564
% fixation cross or dot
6665
expectedCFG.fixation.type = 'cross';
6766
expectedCFG.fixation.xDisplacement = 0;

updateDots.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function [dots] = updateDots(dots, cfg)
2-
2+
33
% Move the selected dots
44
dots.positions = dots.positions + dots.speeds;
55

@@ -8,19 +8,19 @@
88
% - an x position superior to winWidth
99
% - an x position superior to winHeight
1010
% - has exceeded its liftime
11-
N = any([...
11+
N = any([ ...
1212
dots.positions > cfg.screen.winWidth, ...
1313
dots.positions < 0, ...
1414
dots.time > dots.lifeTime, ...
15-
rand(cfg.dot.number,1) < cfg.dot.proportionKilledPerFrame ], 2) ;
16-
15+
rand(cfg.dot.number, 1) < cfg.dot.proportionKilledPerFrame], 2) ;
16+
1717
% If there is any such dot we relocate it to a new random position
1818
% and change its lifetime to 1
1919
if any(N)
2020
dots.positions(N, :) = rand(sum(N), 2) * cfg.screen.winWidth;
2121
dots.time(N, 1) = 1;
2222
end
23-
23+
2424
% Add one frame to the dot lifetime to each dot
2525
dots.time = dots.time + 1;
2626
end

0 commit comments

Comments
 (0)