Skip to content

Commit b59460e

Browse files
committed
mh fix
1 parent 0fa4a36 commit b59460e

16 files changed

+117
-125
lines changed

src/dot/decomposeMotion.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
% - angleMotion: in degrees
77
% - horVector: horizontal component of motion
88
% - vertVector: vertical component of motion
9-
9+
1010
horVector = cos(pi * angleMotion / 180);
1111
vertVector = -sin(pi * angleMotion / 180);
1212
end

src/dot/setDotDirection.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
directionAllDots = nan(cfg.dot.number, 1);
1414

1515
% Coherent dots
16-
16+
1717
if numel(dots.direction) == 1
1818
dots.direction = ones(sum(dots.isSignal), 1) * dots.direction;
1919
elseif numel(dots.direction) ~= sum(dots.isSignal)
2020
error(['dots.direction must have one element' ...
21-
'or as many element as there are coherent dots'])
21+
'or as many element as there are coherent dots']);
2222
end
23-
23+
2424
directionAllDots(dots.isSignal) = dots.direction;
2525

2626
if strcmp(cfg.design.motionType, 'radial')
@@ -29,7 +29,7 @@
2929
end
3030

3131
% Random direction for the non coherent dots
32-
32+
3333
directionAllDots(~dots.isSignal) = rand(sum(~dots.isSignal), 1) * 360;
3434
directionAllDots = rem(directionAllDots, 360);
3535

src/errors/errorDistanceToScreen.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
function errorDistanceToScreen(cfg)
2-
2+
33
errorStruct.message = sprintf([
44
'Distance to monitor seems too small.\n' ...
55
'It should be in centimeters.\n' ...
66
'cfg.screen.monitorDistance = %f'], cfg.screen.monitorDistance);
7-
7+
88
errorStruct.identifier = 'computeFOV:wrongDistanceToScreen';
99

1010
error(errorStruct);
1111
end
12-

src/fixation/initFixation.m

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,48 @@
1111
% cfg.fixation.xDisplacement
1212
% cfg.fixation.yDisplacement
1313
%
14-
% for cfg.fixation.type == 'bestFixation'
14+
% for cfg.fixation.type == 'bestFixation'
1515
% Code adapted from:
1616
% "What is the best fixation target?"
1717
% DOI 10.1016/j.visres.2012.10.012
1818
%
1919
% Contains a fixation cross and a dot
2020
%
21-
22-
21+
2322
% Convert some values from degrees to pixels
2423
cfg.fixation = degToPix('width', cfg.fixation, cfg);
2524
cfg.fixation = degToPix('xDisplacement', cfg.fixation, cfg);
2625
cfg.fixation = degToPix('yDisplacement', cfg.fixation, cfg);
27-
26+
2827
% Prepare fixation cross
2928
xLine = [-cfg.fixation.widthPix cfg.fixation.widthPix 0 0] / 2;
3029
yLine = [0 0 -cfg.fixation.widthPix cfg.fixation.widthPix] / 2;
31-
30+
3231
cfg.fixation.xCoords = xLine + cfg.fixation.xDisplacementPix;
3332
cfg.fixation.yCoords = yLine + cfg.fixation.yDisplacementPix;
34-
33+
3534
cfg.fixation.allCoords = [cfg.fixation.xCoords; cfg.fixation.yCoords];
36-
37-
35+
3836
switch cfg.fixation.type
39-
37+
4038
case 'bestFixation'
41-
39+
4240
% Code adapted from:
4341
% What is the best fixation target?
4442
% DOI 10.1016/j.visres.2012.10.012
45-
43+
4644
cfg.fixation.outerOval = [ ...
4745
cfg.screen.center(1) - cfg.fixation.widthPix / 2, ...
4846
cfg.screen.center(2) - cfg.fixation.widthPix / 2, ...
4947
cfg.screen.center(1) + cfg.fixation.widthPix / 2, ...
5048
cfg.screen.center(2) + cfg.fixation.widthPix / 2];
51-
49+
5250
cfg.fixation.innerOval = [ ...
5351
cfg.screen.center(1) - cfg.fixation.widthPix / 6, ...
5452
cfg.screen.center(2) - cfg.fixation.widthPix / 6, ...
5553
cfg.screen.center(1) + cfg.fixation.widthPix / 6, ...
5654
cfg.screen.center(2) + cfg.fixation.widthPix / 6];
57-
55+
5856
end
59-
57+
6058
end

src/keyboard/checkAbortGetResponse.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ function checkAbortGetResponse(responseEvents, cfg)
66
)
77
errorAbortGetReponse;
88
end
9-
end
9+
end

src/utils/computeFOV.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
% and D is the distance to the object.
1010
% The result obtained is in radians.
1111
%
12-
12+
1313
if cfg.screen.monitorDistance < 2
1414
errorDistanceToScreen(cfg);
1515
end

src/waitForTrigger.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ function waitForTrigger(varargin)
33
%
44
% Counts a certain number of triggers coming from the scanner before returning.
55
%
6-
% If you are not using the quietMode, it flips and waits for half a TR before starting to
7-
% check for the next trigger (unless this was the last trigger to wait for and in
8-
% this case it returns immediately).
6+
% If you are not using the quietMode, it flips and waits for half a TR before starting to
7+
% check for the next trigger (unless this was the last trigger to wait for and in
8+
% this case it returns immediately).
99
%
1010
% Will print the count down in the command line and on the PTB window if one is
1111
% opened.

tests/test_checkAbortGetResponse.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
end
88

99
function test_checkAbortGetResponseBasic()
10-
10+
1111
responseEvents(1).keyName = 'a';
1212
responseEvents(2).keyName = '2';
1313
responseEvents(3).keyName = 'ESCAPE';
14-
14+
1515
cfg.keyboard.escapeKey = 'ESCAPE';
16-
16+
1717
assertExceptionThrown(@()checkAbortGetResponse(responseEvents, cfg), ...
1818
'getResponse:abortRequested');
19-
20-
end
19+
20+
end

tests/test_computeFOV.m

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,23 @@
77
end
88

99
function test_computeFOVBasic()
10-
10+
1111
cfg.screen.monitorWidth = 25;
1212
cfg.screen.monitorDistance = 50;
13-
13+
1414
FOV = computeFOV(cfg);
15-
15+
1616
expectedFOV = 28.072;
17-
18-
assertElementsAlmostEqual(expectedFOV, FOV, 'absolute', 1e-3)
19-
17+
18+
assertElementsAlmostEqual(expectedFOV, FOV, 'absolute', 1e-3);
19+
2020
end
2121

2222
function test_computeFOVError()
23-
23+
2424
cfg.screen.monitorDistance = 1.2; % error as distance is most likely in meter
25-
25+
2626
assertExceptionThrown(@()computeFOV(cfg), ...
2727
'computeFOV:wrongDistanceToScreen');
28-
29-
end
3028

29+
end

tests/test_decomposeMotion.m

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,25 @@
77
end
88

99
function test_decomposeMotionBasic()
10-
10+
1111
[horVector, vertVector] = decomposeMotion(0);
1212
expectedOutput = [1, 0];
1313
assertEqual(expectedOutput, [horVector, vertVector]);
14-
14+
1515
[horVector, vertVector] = decomposeMotion(90);
1616
expectedOutput = [0, -1];
1717
assertElementsAlmostEqual(expectedOutput, [horVector, vertVector]);
18-
18+
1919
[horVector, vertVector] = decomposeMotion(180);
2020
expectedOutput = [-1, 0];
2121
assertElementsAlmostEqual(expectedOutput, [horVector, vertVector]);
22-
22+
2323
[horVector, vertVector] = decomposeMotion(270);
2424
expectedOutput = [0, 1];
2525
assertElementsAlmostEqual(expectedOutput, [horVector, vertVector]);
26-
26+
2727
[horVector, vertVector] = decomposeMotion(360);
2828
expectedOutput = [1, 0];
2929
assertElementsAlmostEqual(expectedOutput, [horVector, vertVector]);
30-
31-
32-
end
30+
31+
end

0 commit comments

Comments
 (0)