Back to the main page.

Bug 1637 - planar gradient computation is wrong

Reported 2012-08-08 15:02:00 +0200
Modified 2014-03-12 12:21:37 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Jörn M. Horschig
Depends on:
See also:

Jörn M. Horschig - 2012-08-08 15:02:14 +0200

Created attachment 297 top: really crappy version (rev 6430), bottom: qualitatively fix (rev 6431) I had strange results when re-analyzing and checked the code with the tutorial data. Given that we know how the planar gradient should look like this is a good way to compare. I attached the crappy planar gradient version (rev. 6340) I tried to fix it, and changed megplanar_sincos, but results still look a bit different (bottom version of the attached file). The fix I provided now definitely fix something, but more might be broken. At least, it's qualitatively the same again, which makes sense given that I fixed a wrong channel order. The problem I fixed only occurs if channel labels get mixed up,

Jörn M. Horschig - 2012-09-19 16:45:49 +0200

I made a test script and hopefully fixed that nasty bug svn ci ../ft_megplanar.m megplanar_sincos.m -m "bugfix-#1637- does not depend on channel order anymore, cause channel order is forced within the function to tbe the same" Sending ft_megplanar.m Sending private/megplanar_sincos.m Transmitting file data .. Committed revision 6478. didn't commit the test file(s) yet, because I cd to a private directory, which is not a smartass idea ;) gonna fix this tomorrow

Jörn M. Horschig - 2012-09-20 11:07:16 +0200

fixed one additional bug that I introduced (note to myself, never commit when you'are about to go home) the result does, however, still not look like in the tutorial. cannot find anything wrong with megplanar_sincos nor megplanar, though... more strangely, when not using a layout for plotting, the planar data looks like in the bugged version (the upper part of the picture I uploaded). when using ctf151.lay it seems qualitatively close enough

Jörn M. Horschig - 2012-09-20 16:03:37 +0200

JM joined in finding the bug, and we could indeed find that channelpositions in ft_combineplanar were wrongly combined. Thus, grad.label and grad.chanpos were not synced anymore. svn ci ft_combineplanar.m -m "bugfix-#1637-fixed a critical bug in ft_combineplanar that lead to wrong channelpositions" Sending ft_combineplanar.m Transmitting file data . Committed revision 6499.

Jörn M. Horschig - 2012-09-20 16:04:04 +0200

added Robert to keep him up-to-date about this