<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Knut-André, 
<div class=""><br class="">
</div>
<div class="">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:</div>
<div class=""><br class="">
</div>
<div class="">G.dimord = ‘rpt_chan_freq_time’;</div>
<div class="">G.powspctrm = permute(shiftdim(tf_datamatrix,-1),[4 1 2 3]);</div>
<div class="">G.freq = frex;</div>
<div class="">G.time = <the time-axis, consisting of a vector with the number of points along the fourth dimension of the powspctrm matrix>;</div>
<div class="">G.label = {‘harry_hole’};</div>
<div class=""><br class="">
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br class="">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 4 Dec 2023, at 10:21, Knut-André Skaug via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Hello,<span class="Apple-converted-space"> </span><o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Thank you for providing this toolbox.<span class="Apple-converted-space"> </span><o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
My question pertains to the data format in order to run permutation testing on time-frequency data in source space.<o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
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.<o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
The time-frequency data matrix have dimensions: Frequency x Time x Trials.<o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Thus, there are no channels in this matrix.<span class="Apple-converted-space"> </span><o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
I’ve tried to set the data structure to be:<span class="Apple-converted-space"> </span><o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
G.dimord = ‘freq_time_rpt’;<o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
G.powspctrm = tf_datamatrix;<o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
G.freq = frex;<o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
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.<o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
How can I carry out cluster-based permutation testing on my two time-frequency matrices, Condition A and Condition B?<o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Kind regards<span class="Apple-converted-space"> </span><o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Knut<span class="Apple-converted-space"> </span><o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
 <o:p class=""></o:p></div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C01%7Cfieldtrip%40science.ru.nl%7C5f2160f21fb84097279708dbf633982d%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638374473666049920%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1JAc9uuxohGhLG1ZHCslTDloAgWbwxioK8Aj5MtLOMo%3D&reserved=0" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="oBEcc7uuILgcBY5yTG0OWAM0Nidh5CftyNgCtJx65OmhJzmRgysLN6wB/S864gK3dRaHeihUdHg8a7FfU6JkpAdthmIDqwSmJhOmmuTmZ12dkmp5BBakH5SK+o4RS0L1XbZasVoBLT1JpTnPI6dD19gQYH2vodwGiEvV1Y/Ax7I=" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C01%7Cfieldtrip%40science.ru.nl%7C5f2160f21fb84097279708dbf633982d%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638374473666049920%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Js0nkOQQcKXDbEOzE8Rg%2B7YPpRGIUXQ31ixEO6N%2FiK8%3D&reserved=0" originalsrc="https://doi.org/10.1371/journal.pcbi.1002202" shash="m8M9w9TTigUABaCpJspMK9n/xCBglJSn2s6rxb2MBjS0nfDA6KUllEwFhyGWEi4xNQSBXQZ1Vjt5XfbKEbx7WsANHAqLUzapVnR0ll14TlOyekhI7IUGYMCH/mWrZyMZKNFh4tXOmX9Bdj7m+SFv7LB9QSXb/byBuqkFH15FnlQ=" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://doi.org/10.1371/journal.pcbi.1002202</a></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>