Back to the main page.

Bug 3437 - ft_selectdata breaks on double latency parameters

Status CLOSED FIXED
Reported 2018-07-09 17:24:00 +0200
Modified 2019-08-10 12:37:01 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P5 blocker
Assigned to:
URL:
Tags:
Depends on:
Blocks:
See also:

Stephen Whitmarsh - 2018-07-09 17:24:57 +0200

Hi there, I don't know why this error only occurs now, as it seems logically broken: On line 971 ft_selectdata checks whether the selected time period fall within the range of the time-axis: elseif numel(cfg.latency)==2 % the [min max] range can be specifed with +inf or -inf, but should % at least partially overlap with the time axis of the input data mintime = min(alltimevec); maxtime = max(alltimevec); if all(cfg.latency<mintime) || all(cfg.latency>maxtime) ft_error('the selected time range falls outside the time axis in the data'); end However, if indeed latency is selected as e.g.: cfg.latency = [-1 2], then wouldn't the comparison of cfg.latency < mintime, not specify the first input of cfg.latency, and the second in the second part of the evaluation? I.e.: if all(cfg.latency(1)<mintime) || all(cfg.latency(2)>maxtime) ft_error('the selected time range falls outside the time axis in the data'); end Again, this is old code, right? So don't understand why only now I get an error. But it does now. Best, Stephen


Robert Oostenveld - 2018-07-09 18:00:37 +0200

if the whole time specification is to the left of the time-axis, or the whole time-specification is to the right, there is no overlap. Please specify an example that demonstrates the error you think exists.


Jan-Mathijs Schoffelen - 2018-11-02 09:47:35 +0100

Is this still an issue, Stephen? If not, I suggest to close


Stephen Whitmarsh - 2018-11-02 09:50:08 +0100

Ok, I suggest to close and if I encounter it again, I know where to find it.


Robert Oostenveld - 2019-08-10 12:37:01 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue on https://github.com/fieldtrip/fieldtrip/issues.