[FieldTrip] How to identify clusters in space?

Eelke Spaak e.spaak at donders.ru.nl
Mon Jul 13 15:43:35 CEST 2020


Dear Stefan,

Let me provide a twofold answer.

(1) How to do cluster-based testing with regression coefficients? This
is already implemented in a "statfun", namely
ft_statfun_depsamplesregrT.

(2) How is clustering across the channel dimension achieved? I
deliberately say "the channel dimension", rather than "space", because
this is a special case of a spatial dimension. (Clustering across
regular 3D (e.g. volumetric source) space is again simple, as I'm sure
you're aware, since you mention that frequency and time are clear to
you.) The answer is that clustering across channels relies on a
so-called neighbourhood definition (cfg.neighbours in API), which
defines which channels are to be considered neighbours of which other
channels. Internally, the neighbours structure is converted into a 2D
logical matrix, which in turn is used to extend the clustering across
regular dimensions to the channel case.

Relevant code is
https://github.com/fieldtrip/fieldtrip/blob/master/private/findcluster.m
(general cluster finding) and
https://github.com/fieldtrip/fieldtrip/blob/master/private/combineClusters.m
(extend regular clustering to channel dimension; the m-file is for
reference only since usually this is achieved by the mex-file written
in C++: https://github.com/fieldtrip/fieldtrip/blob/master/src/combineClusters.cpp).
For context, it will also help to have a look at
https://github.com/fieldtrip/fieldtrip/blob/master/private/clusterstat.m
(which calls findcluster), and
https://github.com/fieldtrip/fieldtrip/blob/master/ft_statistics_montecarlo.m
(the "almost-highlevel" function, providing most of the API, called by
ft_xxxstatistics).

Best,
Eelke

On Wed, 8 Jul 2020 at 17:46, Stefan Arnau <arnau at ifado.de> wrote:
>
> Dear fieldtrip-list,
>
>
>
> I am currently trying to figure out a how to solve a specific problem related to cluster permutation statistics. I am quite often in a situation where I want to test a specific effect against zero.
>
>
>
> In case of within subject effects, I can create null-hypothesis data for each participant by performing the same kind of analysis with the factor of interest being permuted across trials. For each subject, I can then pass both datasets, the dataset created on the actual labels as well as the dataset created on permuted labels, to the ‘ft_timelockstatistics’ or the ‘ft_freqstatistics’ function in order to identify significant effects on the group level.
>
>
>
> For correlation analysis, there is the possibility to test between-subject correlations against zero using the ’ft_statfun_correlationT’ option in cfg.statistics. The ‘ft_timelockstatistics’ for example then takes care of correlating the data with the measure of interest and also performs the cluster-based permutation test.
>
>
>
> My problem now is that I don’t know how to perform such a test against zero on a group level when not working with correlations but, for example, with regression coefficients.
>
>
>
> In theory, I know how to create a H0-distribution of sum-t or number-of-points statistics obtained from clusters identified in permuted data and I also know how to correct the clusters in the real data accordingly. With “in theory” in mean that I know how to do it in time or in time-frequency space. The part that I don’t understand is how clustering is done additionally in space, that is across channels.
>
>
>
> It would be very helpful if someone could provide a minimum example of matlab code or refer me to the respective file or code-sequence in the fieldtrip code that specifically deals with identifying clusters in channel-by-time and/or channel-by-frequency-by-time data. Apart from the specific problem of testing a given group-level statistic against zero, this would of course also help me a lot to understand better how clustering in space behaves.
>
>
>
> Thanks in advance and best regards
>
>
>
> Stefan
>
> -->_______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202



More information about the fieldtrip mailing list