[FieldTrip] ft_clusterplot error?

Stephen Whitmarsh stephen.whitmarsh at gmail.com
Sat Jan 19 11:04:46 CET 2019


Hi Jac,

I would start by plotting your (t)stats, and for simplicity doing that with
ft_singleplotER (cfg.param = 'stat') rather than ft_clusterplot.
Then try plotting the power-difference. This should not be more than a
subtraction of data_diff.powspctrm = data1.powspctrm - data2.powspctrm, .
No reshaping should be needed.
The problem is probably a mistake somewhere keeping track of
dimensions/latencies etc. which is tricky with clusters.
Also, make sure to clear your cfg before every function so you don't carry
the cfg of a previous function into the next. That will also help
readability and debugging.

HTH,
Stephen

On Fri, 18 Jan 2019 at 19:28, Jac Billington <J.Billington at leeds.ac.uk>
wrote:

> Dear experts,
>
>
> I've recently begun  using fieldtrip and have been following tutorials
> well. however, I have perhaps run into a problem with ft_clusterplot.
>
>
> An example output is located in dropbox here:
> https://www.dropbox.com/sh/64m3xpgco2uavky/AADT6-rXEdylVzHN1lY-q7SNa?dl=0
>
>
> My negative cluster labels don't seem to be located in a cluster per se,
> or in regions with a greater raw effect. This seems at odds with tutorial
> examples and papers. Apologies if I'm missing something, but can this be
> correct?
>
>
> I did have earlier errors ('  ft_error('unsupported dimord %s', dimord);')
> but I realised this was because dimensions of my stat.raweffect (64 5
> 200) were in conflict with collapsing time and frequency when running
> ft_freqstatistics. Reducing stat.raweefect to 64 1 solved this error, but
> I'm wondering if I have done something wrong.
>
>
> My code is posted below and I'd happily be poited to some papers if I'm
> misunderstanding this.
>
>
> Thank you in advance. Jac
>
>
>
>   % load data  (from ft_freqanalysis)
>         load(filename1);
>         con1= freqScaling
>         load(filename2);
>         con2=freqScaling;
>
>         %%%% run the stats:
>         cfg = [];
>         cfg.channel          =  'all';
>         cfg.latency          = [4 6];
>         cfg.frequency        = [8 12];
>         cfg.method           = 'montecarlo';
>         cfg.statistic        = 'ft_statfun_indepsamplesT';
>         cfg.correctm         = 'cluster';
>         cfg.clusteralpha     = 0.05;
>         cfg.clusterstatistic = 'maxsum';
>         cfg.minnbchan        = 2;
>         cfg.tail             = 0;
>         cfg.clustertail      = 0;
>         cfg.alpha            = 0.025;
>         cfg.numrandomization = 500;
>         cfg.avgoverchan = 'no'
>         cfg.avgovertime = 'yes'
>         cfg.avgoverfreq = 'yes'
>         % prepare_neighbours determines what sensors may form clusters
>         cfg_neighb.method    = 'distance';
>         cfg.neighbours       = ft_prepare_neighbours(cfg_neighb, elec);
>
>         design = zeros(1,size(con1.powspctrm,1) + size(con2.powspctrm,1));
>         design(1,1:size(con1.powspctrm,1)) = 1;
>         design(1,(size(con1.powspctrm,1)+1):(size(con1.powspctrm,1)+
> size(con2.powspctrm,1))) = 2;
>         cfg.design           = design;
>         cfg.ivar             = 1;
>
>
>         [stat] = ft_freqstatistics(cfg, con1, con2);
>
>
>
>        cfg=[]
>        cfg.keeptrials    = 'no'
>        cfg.latency          = [4 6];
>        cfg.frequency        = [8 12];
>        con1 = ft_freqdescriptives(cfg, con1);
>        con2  = ft_freqdescriptives(cfg, con2);
>
>        %%%% resize powerspec to avoid dimord error. Collapse freq/ time
>        con1rs=mean(con1.powspctrm,3)   %%% collapse time dim
>        con2rs=mean(con2.powspctrm,3)   %%% collapse time dim
>        con1rs=mean(con1rs,2)   %%% collapse freq
>        con2rs=mean(con2rs,2)
>        stat.raweffect = con1rs-con2rs
>
>        cfg.alpha  = 0.025;
>        cfg.zparam = 'raweffect';
>        cfg.zlim   = [-1 3];
>         cfg.layout = 'biosemi64.lay';
>        cfg.subplotsize = ([1 1]);
>         ft_clusterplot(cfg, stat);
>
>
> _______________________________________________
> 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/20190119/2f8416d1/attachment-0002.html>


More information about the fieldtrip mailing list