Back to the main page.

Bug 2059 - cfg.channel in ft_topoplotER

Status ASSIGNED
Reported 2013-03-15 22:43:00 +0100
Modified 2013-03-18 13:30:40 +0100
Product: FieldTrip
Component: plotting
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also: http://bugzilla.fcdonders.nl/show_bug.cgi?id=1977

Anne van Hoogmoed - 2013-03-15 22:43:30 +0100

Created attachment 437 GA_loc_diff&lay_baby I've previously used cfg.channel to define which channels I wanted to have included in ft_topoplotER. This doesn't seem to work anymore, it just uses all channels in the layout. The script looks like this: cfg = []; cfg.channel = {'4','5','6','8','9','10','11','13','14','15','19','20','21','24','25','26'}; cfg.layout = lay_baby; cfg.xlim = [0.7 1.2]; cfg.zlim = [-6 6]; ft_topoplotER(cfg, GA_loc_diff); I've attachted the files. Thanks, Anne


Robert Oostenveld - 2013-03-16 08:07:22 +0100

thanks for the detailed bug report. I have confirmed the problem, with cfg = []; cfg.channel = {'4','5','6','8','9','10','11','13','14','15','19','20','21','24','25','26'}; cfg.layout = lay_baby; cfg.xlim = [0.7 1.2]; cfg.zlim = [-6 6]; cfg.channel = 'all'; figure ft_topoplotER(cfg, GA_loc_diff); cfg.channel = {'4','11','16','19','20','21'}; figure ft_topoplotER(cfg, GA_loc_diff); you would expect two different figures, but both are the same.


Robert Oostenveld - 2013-03-16 08:12:11 +0100

I identified the problem, but don't know yet how to solve it. For an unclear reason, the channelselection works differently in interactive and non-interactive mode. Probably this has been the case for a longer time. But recently we switched the interactive mode on by default, which explains that the figures now look different. @Anna, a workaround for the moment is to do cfg.interactive = 'no'


Robert Oostenveld - 2013-03-16 09:10:43 +0100

after some struggles with git and svn, I have updated the code The code change that solves this specific instance is in ft_prepare_layout. In the case of an input cfg.layout structure (as here), it would not make the selection of the channels. With other layout specifications (such as cfg.layout='CTF151.lay') it would. @Anne: The workaround is not needed any more. I have also added a test script that compares the figures. With cfg.interactive=yes/no the figure is now the same, with different channel selections the figure is now different. Please see http://code.google.com/p/fieldtrip/source/detail?r=7672 for low-level details. Due to the git struggles, the detailed commit log messages have disappeared. Still to do is to discuss in the FT meeting why there is some behavior in the topoplot_common function that depends on interactive=yes/no. That seems an explicit design choice, but I don't get it.


Jörn M. Horschig - 2013-03-18 12:41:43 +0100

similar issue for ft_multiplotTFR. Not sure how topoplot is calling ft_prepare_layout, but the fix does work with ft_multiplotTFR, see bug 2066. I mark this bug as blocking, because imho the same fix as used here should be applicable to multiplot


Jörn M. Horschig - 2013-03-18 12:42:40 +0100

(In reply to comment #4) Not sure how topoplot is calling ft_prepare_layout, but the fix does *not yet* work with ft_multiplotTFR And I need an edit function ;)


Jörn M. Horschig - 2013-03-18 13:29:52 +0100

*** Bug 2066 has been marked as a duplicate of this bug. ***


Jörn M. Horschig - 2013-03-18 13:30:40 +0100

duplicate bug, duplicate comment ;) I see the change you made to ft_prepare_layout and was wondering why it did not work for me. It turns out, your change is specific to when providing a layout but not when loading a layout from disk, so e.g. for cfg = []...; cfg.layout = 'EEG1010.lay', ft_xxxplot(cfg, data); still all channels would be plotted. I changed it such that the channelselection takes place at the end of ft_prepare_layout after the layout has been initialized for all cases. Also, I marked this as a duplicate of bug 2059, because it was caused by the same issue. Finally, I updated the test script of bug 2059 - and fixed a bug in that testcript ;) svn ci ft_prepare_layout.m test/test_bug2059.m -m "bugfix #2059 #2066 - subselection of channels when plotting works again for all cases, testscript extended" Sending ft_prepare_layout.m Sending test/test_bug2059.m Transmitting file data .. Committed revision 7690.