[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
Sun Jul 28 20:45:55 CEST 2024


Hi JM

Thanks for your suggestion.

I checked the design matrix, and it seems fine. I am still confused what could be the problem...

Kind regards
Nan
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) via fieldtrip <fieldtrip at science.ru.nl>
Sent: Monday, 22 July 2024 12:13 PM
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Cc: Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen at donders.ru.nl>
Subject: Re: [FieldTrip] why the significant clusters being highlighted not in the correct position_topography_cluster based permutation test


⚠ Caution: External sender

Hi NC,

Could it be that you mixed up the 1’s and 2’s in your design into ft_timelockstatistics, and that you are highlighting the sensors for which the opposite contrast yielded p-values < 0.025?

BW,
JM


On 18 Jul 2024, at 19:02, Chen, Nan via fieldtrip <fieldtrip at science.ru.nl> wrote:

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.
<image.png>
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
<image.png>

Kind regards
NC



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240728/7743f883/attachment.htm>


More information about the fieldtrip mailing list