Back to the main page.
Bug 2559 - ft_databrowser crashes on plotting timelock averaged component data
Status | CLOSED FIXED |
Reported | 2014-05-02 16:16:00 +0200 |
Modified | 2019-08-10 12:29:45 +0200 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Windows |
Importance: | P5 normal |
Assigned to: | Eelke Spaak |
URL: | |
Tags: | |
Depends on: | |
Blocks: | 2314 |
See also: | http://bugzilla.fcdonders.nl/show_bug.cgi?id=1887http://bugzilla.fcdonders.nl/show_bug.cgi?id=2539http://bugzilla.fcdonders.nl/show_bug.cgi?id=2518 |
Jim Herring - 2014-05-02 16:16:01 +0200
Plotting timelock averaged independent components used to work fine in the past but ft_databrowser now crashes on line 266: "Reference to non-existent field 'trial'. Error in ft_databrowser (line 273) if strcmp(cfg.continuous, 'yes') && (numel(data.trial) > 1)" The problem seems to be that earlier on line 246 ft_checkdata is called and converts the .avg field into a .trial field for raw data, but not for timelocked comp data. % check if the input data is valid for this function data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is because ft_checkdata recognizes the data as being comp (and timelock) due to the presence of unmixing and topolabel which I guess were removed previously after calling ft_timelockanalysis (related to bug2518). I will create a testscript that produces the error.
Jim Herring - 2014-05-02 16:25:50 +0200
Adding test_bug2559.m Transmitting file data . Committed revision 9467.
Jim Herring - 2014-05-16 11:09:46 +0200
According to ft_datatype_comp, a comp datatype should contain the following fields: time, trial, label, topo, unmixing. Time-locked component data does not contain a trial field, I therefore propose to update ft_datatype to also check for the presence of a trial field (which it currently does not).
Jim Herring - 2014-05-21 15:03:01 +0200
ft_checkdata can now handle 'timelock+comp' but ft_databrowser still crashes when plotting timelock+comp data IF cfg.viewmode is 'component' or not specified (if not specified it is set to 'component' automatically as hascomp==1). The problem here lies with ft_databrowser detecting the data as containing component information and ft_checkdata removing all the component fields. ft_databrowser then tries to plot data that has been removed. Now it depends whether we would like to plot timelock+comp data as comp or raw data, i.e. with or without topographies. In the former case timelock+comp should be converted to comp instead of raw, in the latter case ft_databrowser should not set cfg.viewmode to 'component' if hascomp==1. In any case I'm not sure if it is a good idea that ft_databrowser sets the default based on hascomp on the input data as the input data can be changed by ft_checkdata. If used at all, this decision should be based on the output of ft_checkdata.
Eelke Spaak - 2014-08-06 12:30:40 +0200
I did some shuffling around in ft_checkdata and related functions a while ago, this seems also to have resolved this bug.