[FieldTrip] cfg.highlight won't mark some sig. clusters (ft_topoplotTFR)

Bruno Mansur brunommansur at gmail.com
Sun Jun 6 17:26:25 CEST 2021


Dear list members,

I want to plot the results of a cluster-based permutation test. I know from
'*neg_clusters_pvals*' that there are two negative clusters *between -0.2
and 1 sec* with a *p < 0.025*, so they should be marked with an 'X' over
the relevant channels in the plot. They do not appear in the plot, though...

If I use another latency (e.g cfg.latency = [*3 4*];), the significant
clusters get marked correctly (my epochs range from -0.2 to 6 s, so I'm
breaking it down into smaller latencies). If I use the same latency ([-0.2
1] and increase the cfg. alpha substantially (e.g cfg.alpha = 0.1) the
clusters marks are to be seen in the plot.

Does anyone know why the significant clusters are not being highlighted in
the plot, although they're present in the data and the same code works for
other latencies and alpha values?

Find attached two figures with the outputs using two different latencies.
In '-0-2_to_1.jpg' you can see that no electrodes were highlighted and
cfg.latency = [*-0.2 1*];

In '3_to_4.jpg' you can find many electrodes maked with an '*' and
cfg.latency = [*3 4*];

I would really appreciate any help,

Bellow you can find some of my code:

% 2. Permutation test

cfg = [];
cfg.channel          = {'EEG'};
cfg.latency          = [lat_x{1} lat_x{2}];%  [*-0.2 1*];
cfg.frequency        = [lat_x{1} lat_x{2}];% [8 12];
cfg.method           = 'montecarlo';
cfg.statistic        = 'ft_statfun_depsamplesT';
cfg.correctm         = 'cluster';
cfg.clusteralpha     = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.minnbchan        = 2;
cfg.tail             = 0;
cfg.clustertail      = 0;
cfg.correcttail      = 'alpha';
cfg.alpha            = 0.05;
cfg.numrandomization = 500;
cfg.randomseed       = 2;


% 5. Plot with ft_topoplotTFR

cfg = [];
cfg.operation = 'subtract';
cfg.parameter = 'powspctrm';
contrast    = ft_math(cfg, OGT_ogt_avg, OGT_low_avg);

% define parameters for plotting
timestep      = 0.05;
sampling_rate = 1/timestep;
sample_count  = length(stat.time);% == 25
j = [lat_x{1}:timestep:lat_x{2}];% [-0.2:0.05:1]
m = [1:timestep*sampling_rate:sample_count];

% get relevant values NEGATIVE
neg_cluster_pvals = [stat.negclusters(:).prob];
neg_clust = find(neg_cluster_pvals < 0.025);
neg       = ismember(stat.negclusterslabelmat, neg_clust);

[i1,i2] = match_str(contrast.label, stat.label);

*Then I try to plot my results for every 0.05 s:*

figure;
for k = 1:length(m)-1%
    subplot(4,6,k);
    cfg            = [];
    cfg.xlim       = [j(k) j(k+1)];

    if isempty(stat.negclusters) == 0% If there are neg clusters
        neg_int        = zeros(numel(contrast.label),1);
        neg_int(i1)    = all(neg(i2, m(k):m(k+1)), 2);
    else
        % Do nothing
    end

    if isempty(stat.posclusters) == 0% If there are pos clusters
        pos_int        = zeros(numel(contrast.label),1);
        pos_int(i1)    = all(pos(i2, m(k):m(k+1)), 2);
    else
        % Do nothing
    end
    cfg.highlight  = 'on';
    if isempty(stat.negclusters) == 0 & isempty(stat.posclusters) == 0% If
there are neg and pos clusters
        cfg.highlightchannel = find(pos_int | neg_int);
    elseif isempty(stat.negclusters) == 0 & isempty(stat.posclusters) == 1%
If there are neg clusters
        cfg.highlightchannel = find(neg_int);
    elseif isempty(stat.negclusters) == 1 & isempty(stat.posclusters) == 0%
If there are pos clusters
        cfg.highlightchannel = find(pos_int);
    else% If there are NONE
        disp('Nothing here...')
    end
    cfg.comment    = 'xlim';
    cfg.commentpos = 'title';
    cfg.layout     = 'acticap-64ch-standard2.mat';
    cfg.title      = freqs_x{1};
    *ft_topoplotTFR*(cfg, contrast);
end


-- 
*Bruno *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210606/55746e11/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3_to_4.jpg
Type: image/jpeg
Size: 186725 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210606/55746e11/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: -0.2_to_1.jpg
Type: image/jpeg
Size: 214619 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210606/55746e11/attachment-0003.jpg>


More information about the fieldtrip mailing list