Back to the main page.
Bug 1053 - fixsens breaks on EEG data
Status | CLOSED FIXED |
Reported | 2011-10-18 15:26:00 +0200 |
Modified | 2011-11-11 11:19:32 +0100 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Windows |
Importance: | P1 normal |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Anne van Hoogmoed - 2011-10-18 15:26:34 +0200
For some reason fixsens breaks on EEG data? probably related to previous fixsens bug? AFter this: trlnr = size(data_freq_odd_clean.trial,2); trlnew = data_freq_odd_clean.cfg.trl(1:3:trlnr,:); cfg = []; cfg.trl = trlnew; data_freq_3rd = ft_redefinetrial(cfg, data_freq_odd_clean); comes this: the input is raw data with 33 channels and 38 trials ??? Reference to non-existent field 'coilpos'. Error in ==> channelposition at 271 pnt = sens.coilpos; Error in ==> fixsens at 61 chanpos = channelposition(sens, 'channel', 'all'); Error in ==> ft_datatype_raw at 99 data.elec = fixsens(data.elec); Error in ==> ft_checkdata at 175 data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo); Error in ==> ft_redefinetrial at 115 data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback);
Anne van Hoogmoed - 2011-10-18 15:27:09 +0200
Created attachment 166 workspace with data
Jörn M. Horschig - 2011-10-18 16:40:29 +0200
Hey Anne, I fixed it, cause I also stumbled onto this. For JM: In channelposition, I renamed the field in line 56 to sens.coilpos instead of elecpos. The sens-struct is not returned anyway by that function, so it does not matter how it is called... well, it does matter for line 271 ;)
Robert Oostenveld - 2011-10-18 19:49:02 +0200
*** Bug 1052 has been marked as a duplicate of this bug. ***
Robert Oostenveld - 2011-10-18 19:56:39 +0200
(In reply to comment #2) The fix is incorrect, because bipolar electrode configurations can also contain a elec.tra. Note that your fix does not introduce a new problem, but only that not all problems are solved with it. Line 43 will also fail on new elec structures.
Robert Oostenveld - 2011-10-18 19:58:12 +0200
(In reply to comment #4) The section around line 43 also fails to reorder the output args. Please note that this is a bug that I introduced myself :-P
Robert Oostenveld - 2011-10-18 21:03:40 +0200
I fixed bug 1050, which is related. The function sensorposition is called in the new ft_datatype_sens, but not in any other function. That means that sensorposition does not have to deal with new elec/grad structures. I have also updated mbp> svn commit `cat out` Sending fileio/ft_read_headshape.m Sending fileio/ft_read_sens.m Adding fileio/private/ft_datatype_sens.m Sending forward/ft_average_sens.m Sending forward/ft_compute_leadfield.m Sending forward/ft_prepare_vol_sens.m Adding forward/private/ft_datatype_sens.m Sending ft_electroderealign.m Sending ft_freqcomparison.m Sending ft_headmovement.m Sending ft_neighbourplot.m Sending ft_prepare_layout.m Sending ft_prepare_localspheres.m Sending ft_prepare_neighbours.m Sending ft_prepare_sourcemodel.m Sending ft_scalpcurrentdensity.m Sending ft_sensorrealign.m Sending plotting/ft_plot_sens.m Adding plotting/private/ft_datatype_sens.m Sending private/head_surf.m Sending private/headsurface.m Sending utilities/ft_checkconfig.m Sending utilities/ft_datatype_freq.m Sending utilities/ft_datatype_mvar.m Sending utilities/ft_datatype_raw.m Sending utilities/ft_datatype_sens.m Sending utilities/ft_datatype_timelock.m Sending utilities/private/channelposition.m Transmitting file data ............................ Committed revision 4510. Note that I also made a test_bug1053 script with the elec in a mat file.