[FieldTrip] ft_clusterplot() to Plot Clusters at All Frequency Bands

u3564255 at connect.hku.hk u3564255 at connect.hku.hk
Sat May 20 20:17:39 CEST 2023


Dear FIELDTRIP LIST,

I would like to consult you about how to use ft_clusterplot() to plot clusters at all frequency bands (e.g., theta and alpha) after cluster-based permutation tests.


A. Goal of Permutation Test
I hope to compare two conditions and identify clusters for five frequency bands (e.g., theta, delta, alpha, beta, and gamma). The experiment adopted a within subject design where 11 subjects are exposed to trials of both conditions. So I followed the instructions under the section "Within subject experiments" (https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/tutorial/cluster_permutation_freq/*within-subjects-experiments__;Iw!!HJOPV4FYYWzcc1jazlU!8Z1b3UdiBLk2aeBDQlpcbEQ6FbwoQ5GqDRyP7Yq5V0N6PLpTRFqRvf3uZV1K8RocmdPlNb-41MiEM2fSvilD-q0X4IE_$ ) to perform permutation tests on the two conditions.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


B. Results of Permutation Test
The test reports that there are quite a number of clusters.

...
found 36 positive clusters in observed data
found 11 negative clusters in observed data
computing clusters for the thresholded test statistic computed from the randomized design
computing clusters in randomization 500 from 500
...

The structure of the statistics results ("stat") looks like this:

>> stat =

>>> struct with fields:

>>>>>>>>> prob: [30×100×101 double]
>>>>>>>>> posclusters: [1×36 struct]
>>>>>>>>> posclusterslabelmat: [30×100×101 double]
>>>>>>>>> posdistribution: [1.9646e+03 762.3575 833.7333 720.9224 655.7105 814.9708 258.9502 533.9392 649.8626 970.1599 497.6544 381.2407 1.2933e+03 992.1687 … ]
>>>>>>>>> negclusters: [1×11 struct]
>>>>>>>>> negclusterslabelmat: [30×100×101 double]
>>>>>>>>> negdistribution: [-1.9270e+03 -439.7888 -394.6326 -257.5007 -3.1617e+03 -1.5213e+03 -981.3342 -821.9707 -1.7823e+03 -1.8166e+03 -471.6444 -614.8437 … ]
>>>>>>>>> cirange: [30×100×101 double]
>>>>>>>>> mask: [30×100×101 logical]
>>>>>>>>> stat: [30×100×101 double]
>>>>>>>>> ref: [30×100×101 double]
>>>>>>>>> dimord: 'chan_freq_time'
>>>>>>>>> elec: [1×1 struct]
>>>>>>>>> freq: [1.1111 1.9444 3.0556 3.8889 5 6.1111 6.9444 8.0556 8.8889 10 11.1111 11.9444 13.0556 13.8889 15 16.1111 16.9444 18.0556 18.8889 … ]
>>>>>>>>> label: {30×1 cell}
>>>>>>>>> time: [0 0.0100 0.0200 0.0300 0.0400 0.0500 0.0600 0.0700 0.0800 0.0900 0.1000 0.1100 0.1200 0.1300 0.1400 0.1500 0.1600 0.1700 0.1800 … ]
>>>>>>>>> cfg: [1×1 struct]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


C. Problem

>>> cfg = []; cfg.alpha  = 0.025;
>>> cfg.parameter = 'stat';
>>> cfg.zlim   = [-4 4];
>>> cfg.layout = lay;  % "lay" stores my layout file.
>>> ft_clusterplot(cfg, stat);

When I try to visualise the clusters using ft_clusterplot() as in the code right above, I encountered the error below:

>>> Error using ft_clusterplot
>>> if you input time-frequency data this only works if either frequency or time is a singleton dimension

I read a highly relevant thread (https://mailman.science.ru.nl/pipermail/fieldtrip/2021-June/040906.html), and tried to follow the recommendation to plot clusters with ft_multiplotTFR() and ft_topoplotTFR() as in the code right below, but the plots do not show highlighted clusters.


>>> cfg = []; cfg.alpha  = 0.025;
>>> cfg.parameter = 'stat';
>>> cfg.zlim   = [-4 4];
>>> cfg.toi    = [0 0.6];
>>> cfg.layout = lay;
>>> ft_clusterplot(cfg, stat);
>>> cfg.ylim = [3 7];

>>> cfg.maskparameter = 'mask';
>>> cfg.maskstyle = 'outline';

>>> ft_multiplotTFR(cfg, stat);
>>> ft_topoplotTFR(cfg, stat);


D. Reiteration of Goal of Permutation Test
I hope to compare the two conditions, and identify clusters for each frequency band (i.e., delta (1-2 Hz), theta (3-7 Hz), alpha (8-13 Hz), beta (13-30 Hz), and gamma (30-100 Hz)) in the time window of interest from 0 ms to 6000 ms.

Even if the existing functions of Fieldtrip cannot allow plotting cluster-based permutation results of a frequency band, I would like to know how I can identify clusters simply by examining different fields of the permutation test result.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I will be very appreciative of your help. Thank you so much in advance!!! Also, thank you so much for reading this to this point.

Best regards,
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230520/3de7a9c1/attachment.htm>


More information about the fieldtrip mailing list