<div dir="ltr">Dear fieldtrippers,<div><br></div><div>I'm writing you regarding an error I encountered upon computing an inverse solution in mne method:</div><div><br></div><div><div><font color="#ff0000">Reference to non-existent field 'topo'.</font></div>
<div><font color="#ff0000"><br></font></div><div><font color="#ff0000">Error in ft_datatype_comp (line 92)</font></div><div><font color="#ff0000"> if size(comp.topo,1)==size(comp.topo,2)</font></div><div><font color="#ff0000"><br>
</font></div><div><font color="#ff0000">Error in ft_checkdata (line 342)</font></div><div><font color="#ff0000"> data = ft_datatype_comp(data);</font></div><div><font color="#ff0000"><br></font></div><div><font color="#ff0000">Error in ft_sourceanalysis (line 161)</font></div>
<div><font color="#ff0000">data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}, 'feedback',</font></div><div><font color="#ff0000">'yes');</font></div></div><div>
<br></div><div>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":</div><div><br></div>
<div>instead of</div><div> data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}, 'feedback', 'yes');<br></div><div>write</div><div> data = ft_checkdata(data, 'datatype', {<b>'timelock', 'freq', 'comp'</b>}, 'feedback', 'yes');</div>
<div><br></div><div>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:</div>
<div><br></div><div><div>cfg = struct;</div><div>cfg.method = 'mne';</div><div>cfg.elec = elec;</div><div>cfg.grid = gridVar;</div><div>cfg.vol = vol;</div><div>cfg.rawtrial = 'yes';</div><div>cfg.hdmfile = headModelPath;</div>
<div>cfg.mne.lambda = '5%';<br></div><div>cfg.keepfilter = 'yes';<br></div><div>cfg.rawtrial = 'no';</div><div>cfg.singletrial = 'no';</div><div>cfg.keeptrials = 'yes';</div></div><div>
source = ft_sourceanalysis(cfg, data)<br></div><div><br></div><div>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:</div>
<div><br></div><div><div>data = </div><div> label: {1x19 cell}<br></div><div> fsample: 256</div><div> trial: {1x12 cell}</div><div> time: {1x12 cell}</div><div> interpolatedElectrodes: {1x12 cell}</div></div><div>
<br></div><div>Any ideas regarding the suggested bypass or the deeper cause of the error will be greatly appreciated.</div><div><br></div><div>Thank you for your time,</div><div>Best,</div><div><br></div><div>roey</div></div>