[FieldTrip] Errors with ft_clusterplot

Marion Vincent marion.vincent at univ-lille.fr
Wed Jun 3 10:37:44 CEST 2020


Dear Fieldtrip users, 

I'm having some issues when trying to plot the results of my statistical analysis (with cluster-based permutation) with the clusterplot function.

First, the computation is very long (half an hour for 4 channels..) so I was wondering if it is "normal". Or should the calculation be faster? 

Second, the function stops after a while, saying the layout is no detected (cf. code below). This seems strange to me as it is able to compute the first 4 subplot, and so the layout was found. Do you have any idea why ?

Finally, in the clusterplot function: 
does the alpha parameter needs to correspond to the clusteralpha or to the alpha from the statistics part? 

Thanks a lot, 

Marion 

--- ERROR ---

reading layout from file biosemi128.lay
the call to "ft_prepare_layout" took 0 seconds
There are 2 clusters smaller than alpha (0.05)
Positive cluster: 1, pvalue: 0.000999 (*), t = 0.30957 to 1
Negative cluster: 1, pvalue: 0.020979 (x), t = 0 to 0.40039
making subplots...
making subplot 1 from 101
making subplot 2 from 101
making subplot 3 from 101
making subplot 4 from 101
Error using ft_prepare_layout (line 927)
no layout detected, please specify cfg.layout



------- Here's the code : ------- 

% Set parameters
avg_time = 'no';
avg_freq = 'yes';

% prepare the 'design' matrix for the statistical evaluation
nsubj = length(condA);
design = [1:nsubj 1:nsubj ; ones(1,nsubj) ones(1,nsubj)*2]; % on compare 2 condtions  donc seulement 2 conditions !

% load neighbours
load(fullfile(results_path,'neighboursAVPred.mat'))


%--- Statisctics parameters with cluster
cfg                  = [];
cfg.feedback         = 'yes'
cfg.neighbours       = neighbours;
cfg.channels         = {'all'};
cfg.latency          = 'all';
cfg.avgovertime       = avg_time;
cfg.frequency        = 'all';
cfg.avgoverfreq      = avg_freq;
cfg.method           = 'montecarlo';
cfg.clusterthreshold = 'nonparametric_common';
cfg.correctm         = 'cluster';
cfg.clusteralpha     = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.minnbchan        = 2;
cfg.tail             = 0; % 2-sided
cfg.clustertail      = 0;
cfg.alpha            = 0.025;
cfg.numrandomization = 1000;
cfg.statistic        = 'ft_statfun_depsamplesT';
cfg.design           = design;
cfg.uvar             = 1; 
cfg.ivar             = 2;


statPw = ft_freqstatistics(cfg, condA{:}, condB{:}); % the 2 conditions to compare, obtained from previous code 

% clusterplot
cfg = [];
cfg.zlim = [-5 5];
cfg.alpha = 0.05; % cluster alpha
cfg.layout = 'biosemi128.lay';

ft_clusterplot(cfg,statPw);


More information about the fieldtrip mailing list