Back to the main page.
Bug 2518 - ensure that component data can be used as input in sourceanalysis, dipolefitting and all other functions
Status | ASSIGNED |
Reported | 2014-04-02 20:19:00 +0200 |
Modified | 2014-08-01 05:00:19 +0200 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P5 normal |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | 252026102664 |
Blocks: | |
See also: | http://bugzilla.fcdonders.nl/show_bug.cgi?id=2539http://bugzilla.fcdonders.nl/show_bug.cgi?id=1887http://bugzilla.fcdonders.nl/show_bug.cgi?id=2559 |
Robert Oostenveld - 2014-04-02 20:19:11 +0200
as discussed in relation to the bug reported by Tyler and here http://fieldtrip.fcdonders.nl/development/meeting/20140402 We should support for component data in source reconstruction functions: - dipolefitting and mne should in principle work already. - yet, the functions may become confused because of the mixed representation of the component data (in a freq/tlck structure). - identify which functions should support this, but currently don't do it well. - ensure that the data is unambiguous, i.e. only keep topo/topolabel and remove anything else. We should have three test functions: a) for comp data in all functions that analyze raw time series (e.g. time and freq analysis) b) for comp input to ft_dipolefitting c) for comp input to ft_sourceanalysis
Robert Oostenveld - 2014-04-02 21:41:39 +0200
I started with a test script: - resampledata keeps the topo, probably because dataout=datain. - timelockanalysis and freqanalysis loose the topo. - some others are also loosing the data. I will work through all functions consistently...
Robert Oostenveld - 2014-04-02 22:02:13 +0200
(In reply to Robert Oostenveld from comment #1) (In reply to Robert Oostenveld from comment #1) I made a test script and improved the handling of component data in multiple functions that should support it. Sending ft_appenddata.m Sending ft_channelnormalise.m Sending ft_freqanalysis.m Sending ft_megrealign.m Sending ft_preprocessing.m Sending ft_timelockanalysis.m Adding test/test_bug2518a.m Transmitting file data ....... Committed revision 9336. for these functions I don't really know whether and how they should work ft_channelrepair ft_combineplanar for these functions it could in principle work ft_megplanar ft_scalpcurrentdensity the following functions have not been seriously considered yet ft_connectivityanalysis ft_megrealign ft_mvaranalysis
Robert Oostenveld - 2014-05-21 22:02:59 +0200
As already suspected in http://bugzilla.fcdonders.nl/show_bug.cgi?id=1887#c12 there were still a few functions that did not work properly with raw+comp. These showed up as regression error in test_bug2518a, and were fixed. roboos@mentat001> svn commit Sending ft_appenddata.m Sending ft_preprocessing.m Sending ft_redefinetrial.m Sending ft_rejectvisual.m Sending test/test_bug2518a.m Transmitting file data ..... Committed revision 9577.
Joseph Dien - 2014-08-01 04:13:23 +0200
Hi, it appears that the modifications to support comp input to ft_dipolefitting (fieldtrip-20140731) has resulted in it no longer accepting non-comp input. From what I can follow, ft_dipolefitting has a call: % check if the input data is valid for this function data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}, 'feedback', 'yes'); that checks to see if the data is one of these three valid types. however, ft_checkdata is set up to assume that it can successfully convert data to the comp type as it has no fail condition. elseif isequal(dtype(iCell), {'comp'}) && israw data = keepfields(data, {'label', 'topo', 'topolabel', 'unmixing', 'elec', 'grad', 'cfg'}); % these are the only relevant fields data = ft_datatype_comp(data); israw = 0; iscomp = 1; okflag = 1; As such, when it tries to do so: if ~isfield(comp, 'unmixing') % in case the unmixing matrix is not present, construct the best estimate based on the mixing (topo) matrix % this is shared with the 2011 code if size(comp.topo,1)==size(comp.topo,2) comp.unmixing = inv(comp.topo); else comp.unmixing = pinv(comp.topo); end end it simply crashes: 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_dipolefitting (line 139) data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}, 'feedback', 'yes'); Error in test_ft_dipolefitting (line 55) [source] = ft_dipolefitting(cfg, data); One possible fix is to use a try-catch structure with a continue command so that if the initial conversion fails it will go on to the next acceptable data type ('timelock').
Joseph Dien - 2014-08-01 04:21:10 +0200
Created attachment 655 test case for ft_dipolefitting error
Joseph Dien - 2014-08-01 04:24:07 +0200
Created attachment 656 test case for ft_dipolefitting error