Skip to content

Commit

Permalink
Fix ticket #16 : iterate manually and fix index order
Browse files Browse the repository at this point in the history
  • Loading branch information
eozd committed Aug 26, 2019
1 parent 4376997 commit 80fbbd9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/pspm_get_eyelink.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
% PsPM 3.0
% (C) 2008-2017 Tobias Moser (University of Zurich)

% $Id$
% $Rev$
% $Id: pspm_get_eyelink.m 802 2019-08-23 08:07:30Z esrefo $
% $Rev: 802 $

% initialise
% -------------------------------------------------------------------------
Expand Down Expand Up @@ -409,13 +409,15 @@
indices_to_expand_towards_left = find(diffmask == 1) + 1;
indices_to_expand_towards_right = find(diffmask == (-1));

for idx = indices_to_expand_towards_left
begidx = max(1, idx - 1);
endidx = max(1, idx - offset);
for ii = 1:numel(indices_to_expand_towards_left)
idx = indices_to_expand_towards_left(ii);
begidx = max(1, idx - offset);
endidx = max(1, idx - 1);
mask(begidx : endidx) = true;
end
ndata = numel(mask);
for idx = indices_to_expand_towards_right
for ii = 1:numel(indices_to_expand_towards_right)
idx = indices_to_expand_towards_right(ii);
begidx = min(ndata, idx + 1);
endidx = min(ndata, idx + offset);
mask(begidx : endidx) = true;
Expand Down

0 comments on commit 80fbbd9

Please sign in to comment.