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

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Mon Jul 22 13:13:22 CEST 2024


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://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C96ecb411f05a4589f04708dcaa3f4ca9%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638572436043524848%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3pV9%2FFwu1bitSYYzjX3KDBZ6yUydJ8PcqCgqbHJmdqE%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C96ecb411f05a4589f04708dcaa3f4ca9%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638572436043524848%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=ldH4OvRNFUZaWhxqPd0QN%2FfBQUeHcxkXUDACZkt8T7w%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240722/6c285a78/attachment.htm>


More information about the fieldtrip mailing list