Back to the main page.

Bug 2841 - ft_preprocessing doesn't select channels anymore

Status CLOSED FIXED
Reported 2015-02-13 11:57:00 +0100
Modified 2015-07-15 13:31:11 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P5 major
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also:

Pim Mostert - 2015-02-13 11:57:58 +0100

Since a couple of days, it appears that ft_preprocessing doesn't select the channels anymore as specified in cfg.channel. % length(data.label) > 300 cfg = []; cfg.channel = ft_channelselection('MEG', data.label); % length(cfg.channel) == 274 newdata = ft_preprocessing(cfg, data) % length(newdata.label) > 300 I'm pretty sure this worked just fine before. Is it a new policy, or just a bug? Thanks, Pim


Robert Oostenveld - 2015-02-13 12:17:11 +0100

This works fine: >> cfg = []; >> cfg.dataset = 'Subject01.ds'; >> cfg.channel = 'ML*'; >> data1 = ft_preprocessing(cfg) data1 = hdr: [1x1 struct] label: {71x1 cell} time: {1x266 cell} trial: {1x266 cell} fsample: 300 sampleinfo: [266x2 double] grad: [1x1 struct] cfg: [1x1 struct] But here it fails: >> cfg = []; >> cfg.channel = 'MLC*'; data2 = hdr: [1x1 struct] fsample: 300 grad: [1x1 struct] sampleinfo: [266x2 double] trial: {1x266 cell} time: {1x266 cell} label: {71x1 cell} cfg: [1x1 struct] Definitely a bug!


Robert Oostenveld - 2015-02-13 12:30:40 +0100

in revision 10217 another way of data selection was introduced, see https://code.google.com/p/fieldtrip/source/diff?spec=svn10217&r=10217&format=side&path=/trunk/ft_preprocessing.m In principle the data selection should work the same as before, but the call to rollback_provenance causes cfg.channel to be replaced by all channels that were selected by ft_selectdata (i.e. 'all'). The call to keepfields should also copy cfg.channel over into tmpcfg, and the subsequent code in which the channels are selected is obsolete. I fixed it. mac011> svn commit ft_preprocessing.m Sending ft_preprocessing.m Transmitting file data . Committed revision 10231.


Jan-Mathijs Schoffelen - 2015-02-13 13:17:09 +0100

Pim, je wordt zo onderhand mijn persoonlijke bug-vanger! Dank maar weer, en excuses voor het gepruts.


Robert Oostenveld - 2015-07-15 13:31:11 +0200

closed several bugs at once that were recently fixed