Skip to content

Commit ae7fdd6

Browse files
committed
fix bug not computing right nb of condition for the fixation position
1 parent 1b25d7a commit ae7fdd6

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

subfun/design/getDesignInput.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@
66
% (C) Copyright 2020 CPP visual motion localizer developpers
77

88
nbRepetitions = cfg.design.nbRepetitions;
9+
10+
if strcmpi(cfg.design.localizer, 'MT_MST')
11+
12+
% here we double the nb of repetitions (2 hemifields) if needed
13+
nbRepetitions = nbRepetitions * length(cfg.design.fixationPosition);
14+
15+
end
16+
917
nbEventsPerBlock = cfg.design.nbEventsPerBlock;
1018
maxNbPerBlock = cfg.target.maxNbPerBlock;
1119
nbBlocks = length(cfg.design.names) * nbRepetitions;
20+
1221
end

subfun/design/setFixationPosition.m

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,17 @@
99
% (C) Copyright 2022 CPP visual motion localizer developpers
1010

1111
% Get the parameter to compute the design with
12-
[nbRepetitions, nbEventsPerBlock, ~, nbBlocks] = getDesignInput(cfg);
12+
[~, ~, ~, nbBlocks] = getDesignInput(cfg);
1313

1414
% Output an "empty" matrix in case of no MT/MST localizer
1515
if ~strcmp(cfg.design.localizer, 'MT_MST')
1616

17-
blockFixationPosition = zeros(nbBlocks, nbEventsPerBlock);
17+
blockFixationPosition = zeros(nbBlocks, 1);
1818

1919
else % Compute the matrix with the fixation position if requested
2020

21-
% here we double the repetions if 2 hemifields
22-
nbRepetitions = nbRepetitions * length(cfg.design.fixationPosition);
2321

24-
if length(cfg.design.names) == 1
25-
26-
nbBlocksPerHemifield = nbRepetitions;
27-
28-
elseif length(cfg.design.names) == 2
29-
30-
nbBlocksPerHemifield = nbRepetitions * length(cfg.design.names);
31-
32-
end
22+
nbBlocksPerHemifield = nbBlocks / length(cfg.design.fixationPosition);
3323

3424
blockFixationPosition = repmat(cfg.design.fixationPosition(1), ...
3525
nbBlocksPerHemifield, ...

subfun/postInitializationSetup.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
%
99
% (C) Copyright 2020 CPP visual motion localizer developpers
1010

11-
cfg = deal(varargin{:});
12-
1311
cfg.dot.matrixWidth = cfg.screen.winWidth;
1412

1513
% Convert some values from degrees to pixels
@@ -26,6 +24,4 @@
2624
cfg.dot.number = round(cfg.dot.density * ...
2725
(cfg.dot.matrixWidth / cfg.screen.ppd)^2);
2826

29-
varargout = {cfg};
30-
3127
end

0 commit comments

Comments
 (0)