Thanks / warning in ft_topoplotER

Roemer van der Meij r.vandermeij at DONDERS.RU.NL
Wed Jan 20 12:52:14 CET 2010

Hi Andrea,

Always happy to help. And thank you for helping us squashing bugs!

Are you sure you are using the most recent fieldtrip version? There was
a bug several weeks ago that gave the warning (which used to be on line
214, but is now on line 215) even when cfg.highlight was not numerical.
(if it's numerical, it is assumed cfg.highlight is used in the old way).
If you have a version that is newer than 19-12-2009 (date of previous
bug fix), could you post the exact code you use to call ft_topoplotER?
This could give me a better idea on where in the code the problem lies.
Could you then also post the exact warning matlab spits out? (if it's
not a version problem, something complicated is going on and all
information is helpful). Thanks!

Concerning ft_clusterplot, you're not actually supposed to use the
highlighting options directly. As clusterplot tries to determine the
clustering automatically, this could possibly interfere with it's normal
functioning. Thanks for pointing this out. I now added a check for these
'forbidden' options and they will be removed automatically. The updated
clusterplot will be uploaded to the ftp-server somewhere late in the
evening today.

However, if you want to manage you're own clustering directly, you can
also do this using topoplotER/TFR. It might be a bit difficult, but you
have to put all the highlighting options in its own cell (including the
ones that were already in cells). There is 'hidden' documentation about
this in topoplotER (you won't see it with the help/doc command, but you
will if you edit the function), you can find it just below the normal
I copy-pasted it here for easy reference:
% It is possible to use multiple highlight-selections (e.g.: multiple
statistical clusters of channels)
% To do this, all the content of the highlight-options (including
cfg.highlight) should be placed in a cell-array
% (even if the normal content was already in a cell-array). Specific
marker settings (e.g. color, size) are defaulted when
% not present.
% Example (3 selections):
% cfg.highlight               = {'labels', 'labels', 'numbers'}
% cfg.highlightchannel    = {{'MZF03','MZC01','MRT54'}, [1:5], 'C*'}
% cfg.highlightsymbol    = {'o',[],'+'}          % the empty option will
be defaulted
% cfg.highlightcolor       = {'r',[0 0 1]};      % the missing option
will be defaulted
% cfg.highlightsize         = [];                      % will be set to
default, as will the missing cfg.highlightfontsize

Using these options you should be able to get the same individual plots
clusterplot can give you. If you do not want to see the other channels,
set cfg.marker = 'off';. On the use of the different routines,
topoplotTFR is identical to topoplotER, but is just present because of
our present naming-scheme. Clusterplot however, is a wrapper around
topoplotER/TFR designed to quickly and without much configuring plot
your statistical clusters (which requires statistics output as input).
By using the 'hidden' options above, you can make topoplotER/TFR do
exactly the same as clusterplot, but then you can specify your own clusters.

We are currently looking into your question number 3, as it appears
things go a little deeper there. There are at least some situations
where cfg.neighbours = [] apparently doesn't work, but we are still
figuring out why. For the moment, a really ugly and time consuming
workaround would be to make a for-loop over single channels, but it
would prevent the clustering over channels and should provide (per
channel) the exact same output as cfg.neighbours = [];

I hope all of the above helps. Thanks for bringing these bugs to our

Kind regards,


Andrea Ostendorf wrote:
> Dear Roemer, dear Jan-Mathijs,
> Thanks for your quick answers! Sorry for getting back so late.
> Dear Jan-Mathijs, thanks for the comment on the symbolic links. My
> colleagues and I, as well as other BESA users, use Windows at work so it
> would be nice to get news on your proposed OS-independent solution.
> Dear Roemer, yes, I was referring to ft_topoplotER. I forgot to mention this
> although I was aware of the fact. Thanks for the explanations!
> I am a bit confused because I still end up with the same warning (line 214
> of ft_topoplotER) even if I use
> cfg.highlightchannel  = 'all'; (or a numerical index vector)
> cfg.highlight = 'on';
> I used the same setting (with different data) for both ft_topoplotTFR and
> ft_clusterplot. Both call topoplotER, although the call looks a bit
> different.
> There is no problem in the case of ft_topoplotTFR. If I modify
> cfg.highlightchannel, I see a change.
> When using ft_clusterplot with this same setting, the significant channels
> appear to be highlighted but I observe no change upon modification of
> cfg.highlightchannel, and I get the warning in ft_topoplotER (line 214).
> On debugging, I see that the lines below l.606 in ft_topoplotER
> ("if ~strcmp(cfg.marker,'off')") are carried out only in my call of
> ft_topoplotTFR.
> Have I done anything wrong, or are the settings treated differently by both
> routines?
> Have a nice evening! And thanks a lot to both of you!
> All the best
> Andrea
>> 2) ft_clusterplot: Since cfg.highlight has changed, I keep getting a
>> warning
>> although I have now switched the setting to cfg.highlight = 'on'. Is there
>> a
>> possibility to implement something like the following example (taken from
>> the tutorial on cluster-based permutation tests on event-related fields)?
>> It looks as if you are referring to ft_topoplotER and not
>> ft_clusterplot. If that assumption is correct, than you can definitely
>> use something like:
>> cfg.highlight = find (pos_int==1|neg_int==-1);
>> However, cfg.highlight would then need to be changed into
>> cfg.highlightchannel. In the new highlighting configuration,
>> cfg.highlight is used to determine highlighting-method (like 'on',
>> 'labels', 'numbers'), while cfg.highlightchannel is meant to indicate
>> which channels your actually want to highlight. This can be a numerical
>> index vector (like above), channel-labels, channel-labels with wildcards
>> and anything else ft_channelselection can take as input.
>> The tutorial on the wiki hasn't been updated yet to reflect the changes
>> to topoplotER (I'll do that soon), but the following should work:
>> cfg.highlight            = 'on';
>> cfg.highlightchannel = find (pos_int==1|neg_int==-1);
>> (using all the defaults this should mark every channel in
>> cfg.highlightchannel with a '*' and every other channel with a 'o')
>> Hope this helps!
>> Best,
>> Roemer
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also and

Roemer van der Meij MSc
Scientific Programmer & Data-Analyst
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognition
P.O. Box 9104
6500 HE Nijmegen
The Netherlands
Tel: +31(0)24 3612631
E-mail: r.vandermeij at

The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also and
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the fieldtrip mailing list