[FieldTrip] Question about dataformat when using cluster based permutation testing on time-frequency data

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Tue Feb 6 16:12:48 CET 2024


Yes, you need to add a singleton dimension, to ensure that the result will be rpt_chan_freq_time, even if there’s only a single channel.

Good luck,
JM

On 6 Feb 2024, at 13:29, Knut-André Skaug via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Hi Jan-Mathijs

Thank you for the suggestion.

Just so I can understand better: do you suggest to add a singleton to the datamatrix before permuting the dimensions?

I would like to use the cluster-correction method in fieldtrip at single-subject level to test between condition differences in time-frequency.

Would it be correct to permute: ‘rpt_freq_time’ ?

Kind regards
Knut



From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> On Behalf Of Schoffelen, J.M. (Jan Mathijs) via fieldtrip
Sent: Wednesday, December 6, 2023 9:16 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Cc: Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen at donders.ru.nl<mailto:janmathijs.schoffelen at donders.ru.nl>>
Subject: Re: [FieldTrip] Question about dataformat when using cluster based permutation testing on time-frequency data

Hi Knut-André,

I think that this can be solved if you do your best to be a bit more work into shaping your data structure into something that Fieldtrip likes:

G.dimord = ‘rpt_chan_freq_time’;
G.powspctrm = permute(shiftdim(tf_datamatrix,-1),[4 1 2 3]);
G.freq = frex;
G.time = <the time-axis, consisting of a vector with the number of points along the fourth dimension of the powspctrm matrix>;
G.label = {‘harry_hole’};

Best wishes,
Jan-Mathijs



On 4 Dec 2023, at 10:21, Knut-André Skaug via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Hello,

Thank you for providing this toolbox.

My question pertains to the data format in order to run permutation testing on time-frequency data in source space.

Because I have already extracted the time-frequency data matrix I wish to continue with the function ft_freqanalysis to run cluster-corrected permutation testing.

The time-frequency data matrix have dimensions: Frequency x Time x Trials.
Thus, there are no channels in this matrix.
I’ve tried to set the data structure to be:
G.dimord = ‘freq_time_rpt’;
G.powspctrm = tf_datamatrix;
G.freq = frex;

But this returns an error message when following the tutorial on cluster-based permutation testing – between trials – both on event-related fields and time-frequency data.

How can I carry out cluster-based permutation testing on my two time-frequency matrices, Condition A and Condition B?

Kind regards
Knut

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C2ec1369abe884e94f77b08dc272614bc%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638428291706280140%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=KBnbW5%2BUEvjtG%2FiHouM9JXg3s0Yw7741WlrycIFCQvM%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C2ec1369abe884e94f77b08dc272614bc%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638428291706280140%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=exjaETWK2S7zhJ1G46hBhhhEO5GlwPtGlH53%2FE3%2FwFQ%3D&reserved=0>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C2ec1369abe884e94f77b08dc272614bc%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638428291706280140%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=KBnbW5%2BUEvjtG%2FiHouM9JXg3s0Yw7741WlrycIFCQvM%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C2ec1369abe884e94f77b08dc272614bc%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638428291706280140%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=exjaETWK2S7zhJ1G46hBhhhEO5GlwPtGlH53%2FE3%2FwFQ%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240206/2a1bcc11/attachment.htm>


More information about the fieldtrip mailing list