Back to the main page.

Bug 2664 - error with comp input into ft_sourceanalysis

Status CLOSED FIXED
Reported 2014-07-31 08:59:00 +0200
Modified 2019-08-10 12:29:11 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to: Eelke Spaak
URL:
Tags:
Depends on:
Blocks: 2518
See also:

Eelke Spaak - 2014-07-31 08:59:15 +0200

Post on mailing list: On 30 July 2014 22:24, Roey Schurr <roeysc@gmail.com> wrote: > Dear fieldtrippers, > > I'm writing you regarding an error I encountered upon computing an inverse > solution in mne method: > > Reference to non-existent field 'topo'. > > Error in ft_datatype_comp (line 92) > if size(comp.topo,1)==size(comp.topo,2) > > Error in ft_checkdata (line 342) > data = ft_datatype_comp(data); > > Error in ft_sourceanalysis (line 161) > data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}, > 'feedback', > 'yes'); > > The problem stems from a change (made in 2014-05-27) in "ft_sourceanalysis", > and can be bypassed by changing the order of data types in line 161 of > "ft_sourceanalysis": > > instead of > data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}, > 'feedback', 'yes'); > write > data = ft_checkdata(data, 'datatype', {'timelock', 'freq', 'comp'}, > 'feedback', 'yes'); > > Now, I am sure there was a good reason for making this change, so I am > guessing the fault is mine in the way I try computing the inverse solution > (which did work until this change of ft_sourceanalysis). The relevant piece > of code is: > > cfg = struct; > cfg.method = 'mne'; > cfg.elec = elec; > cfg.grid = gridVar; > cfg.vol = vol; > cfg.rawtrial = 'yes'; > cfg.hdmfile = headModelPath; > cfg.mne.lambda = '5%'; > cfg.keepfilter = 'yes'; > cfg.rawtrial = 'no'; > cfg.singletrial = 'no'; > cfg.keeptrials = 'yes'; > source = ft_sourceanalysis(cfg, data) > > I am also not sure why the data is thought to be a "comp" data. A possible > cause for the problem is that the raw EEG records I work with are in TRC > format which has to be transformed into a fieldtrip compatible format. So > the "data" struct in the code has the following fields: > > data = > label: {1x19 cell} > fsample: 256 > trial: {1x12 cell} > time: {1x12 cell} > interpolatedElectrodes: {1x12 cell} > > Any ideas regarding the suggested bypass or the deeper cause of the error > will be greatly appreciated. > > Thank you for your time, > Best, > > roey > > _______________________________________________ > fieldtrip mailing list > fieldtrip@donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


Eelke Spaak - 2014-07-31 09:18:43 +0200

Hmm this is a tough one. For now I have implemented a temporary fix by indeed reversing the order in the ft_checkdata call, moving comp to the back. However, the underlying issue is with ft_checkdata and the juggling between different data types. Discussion for that problem should happen at bug 2518 (and likely at the FT meeting when Robert is back). bash-4.1$ svn commit ft_sourceanalysis.m test/test_bug2664.m Sending ft_sourceanalysis.m Adding test/test_bug2664.m Transmitting file data .. Committed revision 9759.


Robert Oostenveld - 2019-08-10 12:29:11 +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 describing the issue on https://github.com/fieldtrip/fieldtrip/issues.