<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi  Tara,<br>
</p>
<p><br>
</p>
<p>indeed the powspctrm fields are the same.<br>
</p>
<p>However, in the code the field 'powspctrm' is missing alltogether so that size(freqCTR_plana_cmb) is simply 1 as that is the size of the structure not the powspctrm field.<br>
</p>
<p><br>
</p>
<p>As Ana is using the ft_statfun_indepsamplesT.m , the design matrix should have the length equivalent to number of trials across both conditions and each trial coded as either 1 or 2 depending on which condition it belongs to.<br>
</p>
<p>(see <a href="http://www.fieldtriptoolbox.org/walkthrough/">http://www.fieldtriptoolbox.org/walkthrough/</a> for more detailed description of design matrix)<br>
</p>
<p><br>
</p>
<p>Ana's code as far as I can see would lead to an unintended design matrix, containing 0s, which also results in the warning "Not all replications are used ..."<br>
</p>
<p><br>
</p>
<p>Best,<br>
</p>
<p>Sophie<br>
</p>
<p><br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> on behalf of Tara van Viegen <taravanviegen@gmail.com><br>
<b>Sent:</b> Monday, February 4, 2019 12:19 PM<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] Help with between-trials single subject permutation (ft_freqstatistics output is stat.sta NaN NaN NaN ....)</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi both,
<div><br>
</div>
<div>I don't think that causes the problem, because from my understanding the powspctrm fields are the same size for both TFR structures.<br>
<br>
Ana, are there NaNs in your powspctrm? (Just trying to figure out if there might already be an issue
<i>before </i>the call to ft_freqstatistics).<br>
<br>
Best,</div>
<div>Tara</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Feb 4, 2019 at 10:35 AM Arana, S.L. (Sophie) <<a href="mailto:S.Arana@donders.ru.nl">S.Arana@donders.ru.nl</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Ana,<br>
</p>
<p><br>
</p>
<p>I see one small mistake in your code, that might be causing your error message. It is in the way you define your design matrix. It should be<br>
</p>
<div style="color:rgb(33,33,33); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">
<br>
</div>
<div style="color:rgb(33,33,33); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">
design = zeros(1,size(freqCTR_planar_cmb.powspctrm,1) + size(freqEXP_planar_cmb.powspctrm,1));</div>
<div style="color:rgb(33,33,33); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px; background-color:rgb(255,255,255)">
design(1,1:size(freqCTR_planar_cmb.powspctrm,1)) = 1;​<br>
</div>
<p><br>
</p>
<div style="color:rgb(33,33,33); font-family:"Segoe UI","Segoe WP","Segoe UI WPC",Tahoma,Arial,sans-serif; font-size:15px; background-color:rgb(255,255,255)">
design(1,(size(freqCTR_planar_cmb.powspctrm,1)+1):(size(<strong style="color:rgb(255,0,0); text-decoration:none solid rgb(255,0,0)"><span style="color:rgb(255,0,0); text-decoration:none solid rgb(255,0,0)">freqCTR_planar_cmb.powspctrm</span></strong>,1)+...<br>
</div>
<div style="color:rgb(33,33,33); font-family:"Segoe UI","Segoe WP","Segoe UI WPC",Tahoma,Arial,sans-serif; font-size:15px; background-color:rgb(255,255,255)">
size(freqEXP_planar_cmb.powspctrm,1))) = 2;<br>
</div>
<p><br>
</p>
<p>Hope this will fix your issue.<br>
</p>
<p><br>
</p>
<p>Best,<br>
</p>
<p>Sophie<br>
</p>
<div>
<div style="font-family:Tahoma; font-size:13px; background-color:rgb(255,255,255)">
<div style="margin:0px"><font face="Tahoma, sans-serif"><span style="font-size:13.3333px">___________________</span></font></div>
<div style="font-size:16px; margin:0px"><span style="font-size:10pt; font-family:Tahoma,sans-serif">M.Sc. Sophie L. Arana</span></div>
</div>
<div style="font-family:Tahoma; background-color:rgb(255,255,255); font-size:13.3333px">
<font face="Times New Roman" size="2"><span style="font-size:16px">
<div style="margin:0px"><font face="Tahoma,sans-serif" size="2"><span style="font-size:10pt"> </span></font></div>
</span></font></div>
<div style="font-family:Tahoma; background-color:rgb(255,255,255); font-size:13.3333px">
<font face="Times New Roman" size="2"><span style="font-size:16px">
<div style="margin:0px"><font face="Tahoma,sans-serif" size="2"><span style="font-size:10pt">Doctoral researcher</span></font></div>
</span></font></div>
<div style="font-family:Tahoma; background-color:rgb(255,255,255); font-size:13.3333px">
<font face="Times New Roman" size="2"><span style="font-size:16px">
<div style="margin:0px"><font face="Tahoma,sans-serif" size="2"><span style="font-size:10pt">Neurobiology of Language - MPI for Psycholinguistics</span></font></div>
</span></font></div>
<div style="font-family:Tahoma; background-color:rgb(255,255,255); font-size:13.3333px">
<font face="Times New Roman" size="2"><span style="font-size:16px">
<div style="margin:0px"><span style="font-size:10pt; font-family:Tahoma,sans-serif"> </span></div>
</span></font></div>
<div style="font-family:Tahoma; background-color:rgb(255,255,255); font-size:13.3333px">
<font face="Times New Roman" size="2"><span style="font-size:16px">
<div style="margin:0px"><font face="Tahoma,sans-serif" size="2"><span style="font-size:10pt">Max Planck Institute for Psycholinguistics</span></font></div>
</span></font></div>
<div style="font-family:Tahoma; background-color:rgb(255,255,255); font-size:13.3333px">
<font face="Times New Roman" size="2"><span style="font-size:16px">
<div style="margin:0px"><font face="Tahoma,sans-serif" size="2"><span style="font-size:10pt">PO Box 310, 6500 AH Nijmegen</span></font></div>
</span></font></div>
<div style="font-family:Tahoma; background-color:rgb(255,255,255); font-size:13.3333px">
<font face="Times New Roman" size="2"><span style="font-size:16px">
<div style="margin:0px"><font face="Tahoma,sans-serif" size="2"><span lang="fr-CH" style="font-size:10pt">Netherlands</span></font></div>
</span></font></div>
<div style="font-family:Tahoma; background-color:rgb(255,255,255); font-size:13.3333px">
<font face="Times New Roman" size="2"><span style="font-size:16px">
<div style="margin:0px"><font face="Tahoma,sans-serif" size="2"><span lang="fr-CH" style="font-size:10pt"> </span></font></div>
</span></font></div>
<div style="font-family:Tahoma; background-color:rgb(255,255,255); font-size:13.3333px">
<font face="Times New Roman" size="2"><span style="font-size:16px">
<div style="margin:0px"><font face="Tahoma,sans-serif" size="2"><span lang="fr-CH" style="font-size:10pt">T +31 24-3610887</span></font></div>
</span></font></div>
<div style="font-family:Tahoma; background-color:rgb(255,255,255); font-size:13.3333px">
<font face="Times New Roman" size="2"><span style="font-size:16px">
<div style="margin:0px"><font face="Tahoma,sans-serif" size="2"><span lang="fr-CH" style="font-size:10pt">E </span></font><a href="https://email.gwdg.de/owa/redir.aspx?C=vAwsHEoGIsQ-2a4fJkW7ELQAQ-WiQ9bLBwPShd-w11hUpFFgiRDVCA..&URL=mailto%3asophie.arana%40mpi.nl" id="gmail-m_-3640205514479428859LPNoLP" target="_blank"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Tahoma,sans-serif" size="2"><span lang="fr-CH" style="font-size:10pt">sophie.arana@mpi.nl</span></font></span></font></a><br>
</div>
</span></font></div>
</div>
<p><br>
</p>
<div style="color:rgb(33,33,33)">
<hr style="display:inline-block; width:98%">
<div id="gmail-m_-3640205514479428859divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> fieldtrip <<a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a>>
 on behalf of Ana Pesquita <<a href="mailto:anapesquita@gmail.com" target="_blank">anapesquita@gmail.com</a>><br>
<b>Sent:</b> Friday, February 1, 2019 9:30 PM<br>
<b>To:</b> <a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a><br>
<b>Subject:</b> [FieldTrip] Help with between-trials single subject permutation (ft_freqstatistics output is stat.sta NaN NaN NaN ....)</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hello,<br>
</div>
<div dir="ltr"><br>
</div>
<div>My name is Ana and I have recently started using Fieldtrip.</div>
<div>I am trying to adapt the <span class="gmail-m_-3640205514479428859gmail-gr_ gmail-m_-3640205514479428859gmail-gr_121 gmail-m_-3640205514479428859gmail-gr-alert gmail-m_-3640205514479428859gmail-gr_spell gmail-m_-3640205514479428859gmail-gr_inline_cards gmail-m_-3640205514479428859gmail-gr_disable_anim_appear gmail-m_-3640205514479428859gmail-ContextualSpelling gmail-m_-3640205514479428859gmail-ins-del gmail-m_-3640205514479428859gmail-multiReplace" id="gmail-m_-3640205514479428859gmail-121" style="display:inline; color:rgb(33,37,41); border-bottom:2px solid transparent">fieldtrip</span><span style="color:rgb(33,37,41)"> tutorial
 -</span> '<span style="color:rgb(33,37,41)">Cluster-based permutation tests on time-frequency data' - to my particular case (</span> <a href="http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_freq/" target="_blank">http://www.fieldtriptoolbox.org/tutorial/cluster_permutation_freq/</a>)<span style="color:rgb(33,37,41)">.</span></div>
<div><span style="color:rgb(33,37,41)"><br>
</span></div>
<div><span style="color:rgb(33,37,41)">I have data from one MEG subject recorded in an Elekta Neuromag system and would like to do a within trials analysis on that subject (experimental trials vs. control trials). However,   my </span><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">ft_freqstatistics
 outputs a matrix stat.stat full of NaNs. </font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">I am hoping to get some help with identifying the error in my pipeline.</font></div>
<div><span style="color:rgb(33,37,41)"><br>
</span></div>
<div><span style="color:rgb(33,37,41)">These are my steps:</span></div>
<div><span style="color:rgb(33,37,41)"><br>
</span></div>
<div><span style="color:rgb(33,37,41)"><b>1. I start by loading the two data structures corresponding to the Exp and Ctr trials (selecting only the gradiometer channels).</b></span></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><u><i>Data fields</i></u></font><span style="color:rgb(33,37,41)">:</span>  </div>
<div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">data_Exp = </font></div>
<div><span style="color:rgb(33,37,41)">struct with fields:</span></div>
<div><span style="color:rgb(33,37,41)">label: {202×1 cell}</span><br>
</div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">trialinfo: [90×1 double]</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">sampleinfo: [90×2 double]</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">trial: {1×90 cell}</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">time: {1×90 cell}</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg: [1×1 struct]</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">fsample: 1.0000e+03</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"> grad: [1×1 struct]</font></div>
<div><br>
</div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">
<div>data_Ctr = </div>
<div>struct with fields:</div>
<div>label: {202×1 cell}</div>
<div>trialinfo: [90×1 double]</div>
<div>sampleinfo: [90×2 double]</div>
<div>trial: {1×90 cell}</div>
<div>time: {1×90 cell}</div>
<div>cfg: [1×1 struct]</div>
<div>fsample: 1.0000e+03</div>
<div>grad: [1×1 struct]</div>
</font></div>
<div style="color:rgb(33,37,41)"><br>
</div>
</div>
<div><b>3. Run the frequency analysis on both data structures. </b></div>
<div>
<div><i style="color:rgb(33,37,41)"><u>CFG</u></i><span style="color:rgb(33,37,41)">:</span>  <font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><br>
</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg = [];</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.output = 'pow';</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.channel = {'MEGGRAD','-MEG1843', '-MEG2122'};</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.taper = 'hanning';</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.method = 'mtmconvol';</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.foi          = 10;%2:2:30;%1:30</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">numfoi = length(cfg.foi);</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.t_ftimwin    =  ones(length(cfg.foi),1).* 0.5;%1;</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.toi          = [-1 : 0.05: 3.6];</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.keeptrials = 'yes'; </font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">tfr_data_Exp = ft_freqanalysis(cfg, data_Exp);   </font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><br>
</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg = [];</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.output = 'pow';</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.channel = {'MEGGRAD','-MEG1843', '-MEG2122'};</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.taper = 'hanning';</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.method = 'mtmconvol';</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.foi          = 10; %2:2:30;</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">numfoi = length(cfg.foi);</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.t_ftimwin    =  ones(length(cfg.foi),1).* 0.5;</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.toi          = [-1 : 0.05: 3.6];</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.keeptrials = 'yes'; </font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">tfr_data_Ctr = ft_freqanalysis(cfg, data_Ctr);</font></div>
</div>
<div><br>
</div>
<div><u style="color:rgb(33,37,41)"><i>Data fields:</i></u> </div>
<div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">e.g. (and similar to the structure of </font> tfr_data_Exp<span style="color:rgb(33,37,41)">)</span><span style="color:rgb(33,37,41)"> </span></div>
</div>
<div>
<div>tfr_data_Ctr = </div>
<div>  struct with fields:</div>
<div>       label: {202×1 cell}</div>
<div>       dimord: 'rpt_chan_freq_time'</div>
<div>       freq: 10.0000</div>
<div>       time: [1×93 double]</div>
<div>       powspctrm: [90×202×1×93 double]</div>
<div>      cumtapcnt: [90×1 double]</div>
<div>      grad: [1×1 struct]</div>
<div>       trialinfo: [90×1 double]</div>
<div>      cfg: [1×1 struct]</div>
</div>
<div> <br>
</div>
<div><b><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">3. Combine planar gradiometers of the time-frequency data (e.g. tfr_data_Exp)</font></b></div>
<div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><i><u>CFG</u></i>:</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg = [];</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.method = 'sum';</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">freqEXP_planar_cmb = ft_combineplanar(cfg,tfr_data_Exp);</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><br>
</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg = [];</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg.method = 'sum';</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">freqCTR_planar_cmb = ft_combineplanar(cfg,tfr_data_Ctr);</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><br>
</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"><u><i>Data fields:</i></u></font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">e.g. (and similar to the structure of </font><span style="color:rgb(33,37,41)">freqEXP_planar_cm)</span><span style="color:rgb(33,37,41)"> </span></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">
<div>freqCTR_planar_cmb = </div>
<div>struct with fields:</div>
<div>label: {102×1 cell}</div>
<div>dimord: 'rpt_chan_freq_time'</div>
<div>freq: 10.0000</div>
<div>time: [1×93 double]</div>
<div>powspctrm: [90×102×1×93 double]</div>
<div>cumtapcnt: [90×1 double]</div>
<div>grad: [1×1 struct]</div>
<div>trialinfo: [90×1 double]</div>
<div>cfg: [1×1 struct]</div>
</font></div>
<div><br>
</div>
</div>
<div><b>4. <font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"> Combine planar gradiometers also for the initial data structures (i.e. </font><span style="color:rgb(33,37,41)">data_Exp</span><span style="color:rgb(33,37,41)"> )</span></b></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">
<div><i><u>CFG</u></i>:<span style="color:rgb(34,34,34); font-family:Arial,Helvetica,sans-serif">  </span>  <br>
</div>
<div>cfg = [];</div>
<div>cfg.method = 'sum';</div>
<div>data_Exp_cmb = ft_combineplanar(cfg,data_Exp);</div>
<div><br>
</div>
<div><u><i>Data fields:</i></u>  <br>
</div>
<div>
<div>data_Exp_cmb = </div>
<div>struct with fields:</div>
<div>label: {102×1 cell}</div>
<div>trialinfo: [90×1 double]</div>
<div>sampleinfo: [90×2 double]</div>
<div>trial: {1×90 cell}</div>
<div>time: {1×90 cell}</div>
<div>cfg: [1×1 struct]<br>
</div>
<div>fsample: 1.0000e+03</div>
<div>grad: [1×1 struct]</div>
</div>
<div><br>
</div>
</font></div>
<div><span style="color:rgb(33,37,41)"><b>5. Prepare neighbours, design, and run ft_freqstatistics</b></span></div>
<div>
<div><i style="color:rgb(33,37,41)"><u>CFG</u></i><span style="color:rgb(33,37,41)">:</span>  <br>
</div>
<div>cfg = [];</div>
<div>cfg.channel          = {'MEGGRAD','-MEG1843', '-MEG2122'};</div>
<div>cfg.latency          = 'all';</div>
<div>cfg.frequency        = 10;</div>
<div>cfg.method           = 'montecarlo';</div>
<div>cfg.statistic        = 'ft_statfun_indepsamplesT';</div>
<div>cfg.correctm         = 'cluster';</div>
<div>cfg.clusteralpha     = 0.05;</div>
<div>cfg.clusterstatistic = 'maxsum';</div>
<div>cfg.minnbchan        = 2;</div>
<div>cfg.tail             = 0;<br>
</div>
<div>cfg.clustertail      = 0;</div>
<div>cfg.alpha            = 0.025;</div>
<div>cfg.numrandomization = 500;</div>
<div>% prepare_neighbours determines what sensors may form clusters</div>
<div>cfg_neighb.method    = 'distance';</div>
<div>cfg_neighb.template  = 'neuromag306plan.mat';</div>
<div>cfg.neighbours       = ft_prepare_neighbours(cfg_neighb, <b>data_Exp_cmb</b>);</div>
<div><br>
</div>
<div>design = zeros(1,size(freqCTR_planar_cmb.powspctrm,1) + size(freqEXP_planar_cmb.powspctrm,1));</div>
<div>design(1,1:size(freqCTR_planar_cmb.powspctrm,1)) = 1;<br>
</div>
<div>design(1,(size(freqCTR_planar_cmb.powspctrm,1)+1):(size(freqCTR_planar_cmb,1)+...</div>
<div>size(freqEXP_planar_cmb.powspctrm,1))) = 2;</div>
<div><br>
</div>
<div>cfg.design           = design;</div>
<div>cfg.ivar             = 1;</div>
<div><br>
</div>
<div>[stat] = ft_freqstatistics(cfg, <b>freqCTR_planar_cmb, freqEXP_planar_cmb</b>);</div>
</div>
<div><span style="color:rgb(33,37,41)"><br>
</span></div>
<div><u style="color:rgb(33,37,41)"><i>Data fields:</i></u>  <span style="color:rgb(33,37,41)"><br>
</span></div>
<div>
<div>stat.stat is a matrix full of NaN</div>
<div><br>
</div>
<div>stat.prob is a matrix of just ones</div>
</div>
<div><br>
</div>
<div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">stat = </font></div>
<div><span style="color:rgb(33,37,41)">struct with fields:</span><br>
</div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">stat: [102×1×93 double]</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">prob: [102×1×93 double]</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cirange: [102×1×93 double]</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">mask: [102×1×93 logical]</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">ref: [102×1×93 double]</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">dimord: 'chan_freq_time'</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">freq: 10.0000</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">grad: [1×1 struct]</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">label: {102×1 cell}</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">time: [1×93 double]</font></div>
<div><font color="#212529" face="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol">cfg: [1×1 struct]</font></div>
</div>
<div><br>
</div>
<div><b><u>Warning:</u></b></div>
<div>When running the ft_frestatistics I get the repeated warning:</div>
<div><br>
</div>
<div>(...)</div>
<div>
<div>Warning: Not all replications are used for the computation of the statistic. </div>
<div>Warning: Not all replications are used for the computation of the statistic. </div>
<div>Warning: Not all replications are used for the computing statistic 498 from 0</div>
<div>Warning: Not all replications are used for the computation of the statistic. </div>
<div>Warning: Not all replications are used for the computation of the statistic. </div>
<div>Warning: Not all replications are used for the computing statistic 500 from 0</div>
</div>
<div>(...)</div>
<div><br>
</div>
<div><br>
</div>
<div>Many many thanks!</div>
<div><br>
</div>
<div>Ana</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote>
</div>
</div>
</div>
</body>
</html>