Back to the main page.

Bug 1043 - channelposition.m about line 73: subesequent code to FIXME fails Yokogawa systems

Status CLOSED WORKSFORME
Reported 2011-10-14 18:14:00 +0200
Modified 2011-11-11 11:19:46 +0100
Product: FieldTrip
Component: fileio
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P1 normal
Assigned to:
URL:
Tags:
Depends on:
Blocks:
See also:

Tilmann Sander-Thommes - 2011-10-14 18:14:49 +0200

A block of code was added recently and marked as FIXME in channelposition.m about line 73. The FIXME states that the code does not work for mixed gradiometer and magnetometer systems. All Yokogawa MEG systems are mixed systems and the code creates duly an error: ??? Error using ==> channelposition at 86 Failed to extract the positions of the channels. This is most likely due to the balancing matrix being rank deficient. Please replace data.grad with the original grad-structure obtained after reading the header. The FIXME states that the code tries to identify if two channels use the same coil. This is certainly not the case for Yokogawa systems: Each coil is per definition only assigned to a single channel. I am happy to help in fixing this block of code, but would like to disable it immediately until it is fixed as I am testing Yokogawa input routines at present. Regards, Till


Jan-Mathijs Schoffelen - 2011-10-17 20:00:40 +0200

Hi Till, We have 1 yokogawa160 dataset as a test set at the Donders Centre, and for this one it seems to just work. Did you do additional stuff such as denoising or component rejection?


Tilmann Sander-Thommes - 2011-10-18 11:03:15 +0200

Created attachment 165 MEG average file from PTB Berlin: fairly noisy N20m


Tilmann Sander-Thommes - 2011-10-18 11:07:03 +0200

Hi Jan-Mathijs, I add the file, which produces the crash. It is from our MEG system. The problem is related to Bug 804: At present all reference channels are added to the grad-structure and for Yokogawa systems the reference channels do not have a valid position information (it is always zero, see attached file channels 126-128). I want to remove the reference channels from the grad-structure anyway and then the problem disappears. But if the FIXME code block is ever used for Yokogawa440 systems then it will not work as they are mixed planar/axial gradiometer systems. Regards, Till


Johanna - 2011-10-18 11:22:45 +0200

I have some Yokogawa440 data from Kauro's visit. I should ask him first, but maybe that can be shared to assist with debugging for that system setup?


Tilmann Sander-Thommes - 2011-10-18 11:31:16 +0200

I have data from Kaoru as well and would add the yokogawa440 system to the cases in channelposition dealing with axial or planar grads: 'yokogawa440' and 'yokogawa440_planar'. Yours, Till


Tilmann Sander-Thommes - 2011-10-21 12:17:02 +0200

I think the bug can be closed as channelposition.m works only with the old grad structure and I was not able to reproduce the crash using the new Yokogawa toolbox and corresponding code in FT.


Robert Oostenveld - 2011-10-21 15:07:40 +0200

(In reply to comment #2) > Created attachment 165 [details] > MEG average file from PTB Berlin: fairly noisy N20m I copied the data to /home/common/matlab/fieldtrip/data/test/bug1043/chki250110.0100.fs1khz.corr_ch_names-ave.ave where it can be used for regression testing. I had a look at the test_bug1043 and noticed that it does not use this data set. I have added the following cd /home/common/matlab/fieldtrip/data/test/bug1043 cfg = []; cfg.dataset = 'chki250110.0100.fs1khz.corr_ch_names-ave.ave'; data = ft_preprocessing(cfg); and with the latest FT version from SVN get >> data = ft_preprocessing(cfg); ??? Error using ==> channelposition at 97 Failed to extract the positions of the channels. This is most likely due to the balancing matrix being rank deficient. Please replace data.grad with the original grad-structure obtained after reading the header. Error in ==> ft_datatype_sens at 95 [chanpos, chanori, chanlab] = channelposition(sens, 'channel', 'all'); Error in ==> ft_read_header at 1452 hdr.grad = ft_datatype_sens(hdr.grad); Error in ==> ft_preprocessing at 360 hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);


Robert Oostenveld - 2011-10-21 15:15:25 +0200

If I change channelposition around line 82 to only execute this complicated piece of code to undo the balancing into if all(numcoils==numcoils(1)) % do the complicated stuff else % just determine the minimum along the rows of the dist matrix end then it simply works (even with the current old reader functions). I have commited the test_bug1043 script and the improved channelposition function in revision 4555 and 4556. (the bug remains closed)


Robert Oostenveld - 2011-11-11 11:19:46 +0100

I closed all bugs that were recently resolved.