Back to the main page.

Bug 97 - if the user specifies cfg.trials=[] this should result in no trials being processed. Now all trials are processed

Status CLOSED FIXED
Reported 2010-06-30 15:28:00 +0200
Modified 2014-01-15 14:41:45 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 enhancement
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on: 2394
Blocks:
See also:

Jan-Mathijs Schoffelen - 2010-06-30 15:28:27 +0200

Selectdata is working in an unexpected way. If the user explicitly states cfg.trials = [], no trials are to be processed. The current functionality is that if isempty(selrpt), no selection of trials takes place, and thus all trials are processed subsequently. This is the result of keyval being used, but the output of keyval being inappropriately processed. Solution: if the user explicitly specifies a 'key', then use the next input argument as the corresponding 'value'. In such case [] has a definite meaning (rather than not being defined by the user)


Robert Oostenveld - 2013-12-02 09:15:06 +0100

As of recently the test_bug97 script fails with Error using ft_selectdata_old (line 133) ft_selectdata_old does not work when selecting 0 trials; please use ft_selectdata_new instead (use a cfg input, instead of key-value pairs, to ft_selectdata). This is after it doing cfg = []; cfg.trials = []; datax = ft_preprocessing(cfg, data); which is rather ambiguous. Since Jan-Mathijs seems to have been working on (and thinking about) this recently, I reopen this bug and assign it to him.


Jan-Mathijs Schoffelen - 2013-12-02 13:50:41 +0100

Oh no! the error was added by Eelke as an explicit error. CC'ing him to this.


Jan-Mathijs Schoffelen - 2013-12-02 14:35:50 +0100

fixed.