[FieldTrip] why the significant clusters being highlighted not in the correct position_topography_cluster based permutation test

Chen, Nan nan-chen.22 at ucl.ac.uk
Thu Jul 18 19:02:38 CEST 2024


Hi community

I have tried to follow the tutorial "cluster-based permutation test on event-related fields":

However, I am encountering an issue with the topography figure

As shown in the attached picture, the highlighted marker does not seem to be in the correct location. It appears misaligned with the area of the most intense color.
[cid:93e131cd-e784-4fd2-a3d2-9527c69e467f]
I am just wondering if anyone have any clues? Thanks

Here is my code:
figure;
% define parameters for plotting
timestep = 0.01; %(in seconds)
sampling_rate = 300; %% double check this: preprocessing file
sample_count = length(stat.time);
j = [0.05:timestep:0.25]; % Temporal endpoints (in seconds) of the ERP average computed in each subplot
m = [1:timestep*sampling_rate:sample_count]; % temporal endpoints in M/EEG samples
% get relevant values
pos_cluster_pvals = [stat.posclusters(:).prob];
pos_clust = find(pos_cluster_pvals < 0.025);
pos = ismember(stat.posclusterslabelmat, pos_clust);
% First ensure the channels to have the same order in the average and in the statistical output.
% This might not be the case, because ft_math might shuffle the order
[i1,i2] = match_str(GA_FacevsNoise.label, stat.label);
% plot
for k = 1:20;
cfg.figure = subplot(4,5,k);
cfg.xlim = [j(k) j(k+1)];
cfg.zlim = [-5e-14 5e-14];
pos_int = zeros(numel(GA_FacevsNoise.label),1);
pos_int(i1) = all(pos(i2, m(k):m(k+1)), 2); % change i2 i1, try11111111111111111
cfg.highlight = 'on';
cfg.highlightchannel = find(pos_int);
cfg.comment = 'xlim';
cfg.commentpos = 'title';
cfg.layout = 'CTF275_helmet.mat';
cfg.figure = 'gca';
ft_topoplotER(cfg, GA_FacevsNoise);
end
[cid:f4d067c8-558f-441b-aba2-8afae83e9356]

Kind regards
NC



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240718/4bc95c47/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 196448 bytes
Desc: image.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240718/4bc95c47/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 196448 bytes
Desc: image.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240718/4bc95c47/attachment-0003.png>


More information about the fieldtrip mailing list