<div dir="ltr">Dear Bruno,<div><br></div><div>As far as I know, ft_clusterplot cannot handle the given data structure of your stat output variable. You may consider using ft_multiplotTFR with the mask created by the ft_freqstatistics by adding the mask to the struct data you have for plotting.</div><div><br></div><div>For instance; </div><div>%% Prior to calling plot functions;</div><div>your_TFR_data_to_be_plotted.mask = your_stat_variable.mask</div><div>cfg = []; </div><div>cfg.layout = your_layout; </div><div>cfg.maskparameter = 'mask';</div><div>cfg.maskstyle = 'outline'; </div><div>ft_multiplotTFR(cfg,your_TFR_data_to_be_plotted)</div><div><br></div><div><br></div><div>Hope I am not mistaken and it helps,</div><div>Best,</div><div>Mustafa</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Bruno Mansur via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>>, 1 Haz 2021 Sal, 17:35 tarihinde şunu yazdı:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Dear fieldtrip list members,</div><div><br></div><div>I'm trying to perform a <b>cluster based permutation test</b> on <b>time-frequency</b> data obtained from 'FT_FREQANALYSIS'.</div><div><br></div><div>I execute the following command for it:</div><div><br></div><div>% 2. Permutation test<br><br>cfg = [];<br>cfg.channel           = {'EEG'};<br>cfg.latency            = [0 1.8];<br>cfg.frequency        = 'all';% all frequencies from 2 to 48<br>cfg.method            = 'montecarlo';<br>cfg.statistic            = 'ft_statfun_depsamplesT';<br>cfg.correctm          = 'cluster';<br>cfg.clusteralpha     = 0.05;<br>cfg.clusterstatistic  = 'maxsum';<br>cfg.minnbchan       = 2;<br>cfg.tail                    = 0;<br>cfg.clustertail         = 0;<br>cfg.alpha                = 0.05;<br>cfg.numrandomization = 500;<br><br>% 3. Find the channel neighbours for spatial clustering<br><br>cfg_neighb.method    = 'distance';<br>cfg.neighbours       = ft_prepare_neighbours(cfg_neighb, Tfr_Ogt_ogt{1,1});<br><br>ft_neighbourplot(cfg_neighb, Tfr_Ogt_ogt{1:1})% to check neighbours<br><br>%------------------------<br><br>% 4. Setting the design for the cluster permutation test<br><br>Nsubj  = 33;<br>design = zeros(2, Nsubj*2);<br>design(1,:) = [1:Nsubj 1:Nsubj];<br>design(2,:) = [ones(1,Nsubj) ones(1,Nsubj)*2];<br><br>cfg.design = design;<br>cfg.uvar   = 1;<br>cfg.ivar   = 2;<br><br>[stat] = ft_freqstatistics(cfg, Tfr_Ogt_ogt{:}, Tfr_Ogt_low{:});<br><br>% ------------------------------------------------------------------------</div><div><br></div><div>Until here I get no error messages and the 'stat' variable seems to have been created (I got 14 negative clusters). Though <b>when I try plotting it, I get the following error message</b>;<br></div><div><br></div><div>Input:<br>% 5. Plot with ft_clusterplot:<br><br>cfg = [];<br>cfg.alpha  = 0.05;<br>cfg.parameter = 'stat';<br>cfg.zlim   = 'maxmin';<br>cfg.layout = 'acticap-64ch-standard2.mat';<br>ft_clusterplot(cfg, stat);</div><div><br></div><div>Output:</div><div><br></div><div>>> cfg = [];<br>cfg.alpha  = 0.05;<br>cfg.parameter = 'stat';<br>cfg.zlim   = 'maxmin';<br>cfg.layout = 'acticap-64ch-standard2.mat';<br>ft_clusterplot(cfg, stat);<br>the input is freq data with 64 channels, 48 frequencybins and 37 timebins<br>reading layout from file acticap-64ch-standard2.mat<br>the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB<br><b>Error using ft_clusterplot (line 153)<br>if you input time-frequency data this only works if either frequency or time is a singleton dimension</b></div><div><br></div><div>Does anyone know what I can do to plot my data correctly? I would really appreciate any inputs.<br></div><div><br></div><div>Best,</div><div><br>-- <br><div dir="ltr"><div dir="ltr"><b>Bruno</b></div></div></div></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><b>Mustafa Yavuz </b><div><br></div><div><div style="color:rgb(136,136,136)">M.Sc. in Neuroscience</div><div style="color:rgb(136,136,136)">RA in HUBAL Neuroimaging Unit </div><div style="color:rgb(136,136,136)">Department of Neuroscience </div><div style="color:rgb(136,136,136)">İstanbul University </div></div></div></div>