# [FieldTrip] How to find out dimensions of clusters without using ft_clusterplot

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Thu Aug 4 20:24:54 CEST 2022

```Dear Jan,

Allow me to first be a bit pedantic, and point you to the following: https://www.fieldtriptoolbox.org/faq/how_not_to_interpret_results_from_a_cluster-based_permutation_test/

and also to

https://www.fieldtriptoolbox.org/faq/how_can_i_determine_the_onset_of_an_effect/

Strictly speaking, one cannot talk about a cluster being significant, the test leads to a statistically significant result, which is a binary decision: the null hypothesis of exchangeability can be rejected.

This being said, if you want to explore the extent of a given cluster, i.e. the individual data points that exceed a certain a priori threshold of the test statistic, and which happen to cluster together in space-time-frequency, you can knock yourself out by creatively exploring the stat.posclusterslabelmat matrix. This is an indexed matrix, which reflects the ‘cluster’ to which the given datapoint belongs. (0 means not part of a cluster). So, if you want to explore e.g. the temporal extent of the first cluster, you can do something like this:

t = sum(stat.posclusterslabelmat==1, 3)>0; % gives a boolean vector with ‘1’s  for the time points at which at least one channel-frequency point was suprathreshold.

For the other dimensions (space / freq) you need to sum across the 1st/2nd dimension.

Hope this helps,
Jan-Mathijs

> On 25 Jul 2022, at 17:05, Jan Ostrowski via fieldtrip <fieldtrip at science.ru.nl> wrote:
>
> Hello everyone,
>
> I was wondering whether there is a built-in option to get the dimensions of clusters in time-frequency data after conducting cluster-based permutation testing using ft_freqstatistics.
>
> In my particular case, one positive cluster can be found that is significant. The output from ft_freqstatistics looks like this:
>
>             prob: [60×40×31 double]
>             posclusters: [1×32 struct]
>             posclusterslabelmat: [60×40×31 double]
>             posdistribution: [1×2000 double]
>             negclusters: [1×25 struct]
>             negclusterslabelmat: [60×40×31 double]
>             negdistribution: [1×2000 double]
>             cirange: [60×40×31 double]
>             stat: [60×40×31 double]
>             ref: [60×40×31 double]
>             dimord: 'chan_freq_time'
>             freq: [1×40 double]
>             label: {60×1 cell}
>             time: [1×31 double]
>             cfg: [1×1 struct]
>
> I use the following configuration for ft_clusterplot, while my statistical results are limited to the average of a frequency interval (so that it has the dimensions 60x1x31):
>
>                   alpha: 0.0500
>                  parameter: 'stat'
>                 subplotsize: [3 3]
>                 highlightsizeseries: [8 8 8 8 8]
>                 highlightcolorpos: 'green'
>                highlighcolorneg: 'red'
>                 fontsize: 20
>                 colormap: [200×3 double]
>                layout: 'easycapM11.lay'
>
> When using ft_clusterplot on this output, only then do  I get information on the time interval. However, there is no log in which is stated which electrodes are part of the cluster.
>
> Is there any way to obtain that information without running the cluster plot function, or do I need to extract this information manually?
>
>
> Appreciate any help on this!
>
> Best,
> Jan
>
> --
> Jan Ostrowski, M.Sc.
> Department of Systems Neuroscience
> University Medical Center Hamburg-Eppendorf
> Martinistr. 52
> Building W34, Room 320b
> D-20246 Hamburg, Germany
>
> --
>
> _____________________________________________________________________
>
> Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg | https://urldefense.com/v3/__http://www.uke.de__;!!HJOPV4FYYWzcc1jazlU!9BqkCJvwVng3dBDikkgsnox7yI-AGfZ4rDzc5c_lQvN4O_EZYVXH_NU-1LZNjJeSjt34VvG-Q5cnr5JjQEK5HRDYOIvgRoxc-_6bNw\$ Vorstandsmitglieder: Prof. Dr. Burkhard Göke (Vorsitzender), Joachim Prölß, Prof. Dr. Blanche Schwappach-Pignataro, Marya Verdel
> _____________________________________________________________________
>
> SAVE PAPER - THINK BEFORE PRINTING
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9BqkCJvwVng3dBDikkgsnox7yI-AGfZ4rDzc5c_lQvN4O_EZYVXH_NU-1LZNjJeSjt34VvG-Q5cnr5JjQEK5HRDYOIvgRozlKLXpbA\$

```