<div dir="ltr"><div>Hi Alice,</div><div><br></div><div>FieldTrip is telling you that once it applies a pre-computed filter (as per your last two lines of code), it cannot guarantee you to apply weight normalization or a fixed orientation constraint, as this depends on how you computed your pre-computed filter (the one you call sourceAll).</div><div>For your code this is fine - it happens because you feed the same cfg structure to ft_sourceanalysis when you apply the filter as you do when computing it - and FieldTrip warns you that it is not doing anything with those options this time around (i.e., when applying it).</div><div><br></div><div>Hope this helps,</div><div>Britta<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 13, 2023 at 3:17 PM DREW , ALICE ALEXANDRA via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.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"><div style="text-align:left"><span style="font-family:arial,sans-serif">Hello, </span></div><div style="text-align:left"><font face="arial, sans-serif"><br></font></div><div style="text-align:left"><font face="arial, sans-serif">I am performing source localisation on EEG data using DICS. I am using the latest version of fieldtrip (20230309). In my analysis, I am contrasting two time windows of interest and I use the parameter: </font></div><div style="text-align:left"><font face="arial, sans-serif"><span style="white-space:pre-wrap;color:rgb(0,0,0)">cfg.dics.fixedori        =</span><span style="white-space:pre-wrap;color:rgb(170,4,249)">'yes'</span><span style="white-space:pre-wrap;color:rgb(0,0,0)">; </span></font></div><div style="text-align:left"><span style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="arial, sans-serif"><br></font></span></div><div style="text-align:left"><span style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="arial, sans-serif">However, when running the analysis the following Warning appears in my command window which indicates that this parameter is not being used. </font></span></div><div style="text-align:left"><span style="white-space:pre-wrap;color:rgb(0,0,0)"><font face="arial, sans-serif"><br></font></span></div><div style="text-align:left"><font face="arial, sans-serif"><span style="white-space:pre-wrap;color:rgb(0,0,0)">"</span>Warning: with precomputed spatial filters a fixed orientation constraint or weight normalization options are not applied"</font></div><div style="text-align:left"><font face="arial, sans-serif"><br></font></div><div style="text-align:left"><font face="arial, sans-serif">Does anyone know what may be causing this? Here is my code:</font></div><div><div style="padding:30px;color:rgb(0,0,0)"><div style="text-align:left"><span style="white-space:pre-wrap"><span style="color:rgb(2,128,9)"><font face="arial, sans-serif">%% Windows of interest</font></span></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg = [];</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.toilim = [-0.5 0];</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.keepsampleinfo=<span style="color:rgb(170,4,249)">'no'</span>; </font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        dataPre = ft_redefinetrial(cfg, data);</font></span></div><div></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.toilim = [0.19 0.69];</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        dataPost = ft_redefinetrial(cfg, data);</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        dataAll = ft_appenddata([], dataPre, dataPost); </font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><span style="color:rgb(2,128,9)"><font face="arial, sans-serif">        %% Frequency analysis</font></span></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg = [];</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.method    = <span style="color:rgb(170,4,249)">'mtmfft'</span>;</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.output    = <span style="color:rgb(170,4,249)">'powandcsd'</span>; </font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.taper     = <span style="color:rgb(170,4,249)">'hanning'</span>;</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.foilim    = [5 7];</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.pad       = 1;</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        freqPre = ft_freqanalysis(cfg, dataPre);</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        freqPost = ft_freqanalysis(cfg, dataPost);</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        freqAll = ft_freqanalysis(cfg, dataAll);</font></span></div><div></div><div style="text-align:left"><span style="white-space:pre-wrap"><span style="color:rgb(2,128,9)"><font face="arial, sans-serif">        %% Average over frequencies</font></span></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg=[];</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.avgoverfreq = <span style="color:rgb(170,4,249)">'yes'</span>;</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        freqPre = ft_selectdata(cfg, freqPre);</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        freqPost = ft_selectdata(cfg, freqPost);</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        freqAll = ft_selectdata(cfg, freqAll);</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        <span style="color:rgb(2,128,9)">% Source reconstruction for all trials</span></font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg=[];</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.method=<span style="color:rgb(170,4,249)">'dics'</span>;</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.headmodel=vol;</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.dics.keepfilter = <span style="color:rgb(170,4,249)">'yes'</span>;</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.dics.lambda       = <span style="color:rgb(170,4,249)">'5%'</span>;</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.dics.fixedori        =<span style="color:rgb(170,4,249)">'yes'</span>; </font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.dics.realfilter   = <span style="color:rgb(170,4,249)">'yes'</span>; </font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.sourcemodel  = grid;       </font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.dics.projectnoise = <span style="color:rgb(170,4,249)">'yes'</span>;</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.sourcemodel.leadfield   = grid.leadfield;</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        sourceAll=ft_sourceanalysis(cfg, freqAll);</font></span></div><div></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        <span style="color:rgb(2,128,9)">% DICS for each condition using the common filter</span></font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        cfg.sourcemodel.filter = sourceAll.avg.filter;</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        sourcePre=ft_sourceanalysis(cfg, freqPre);</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">        sourcePost=ft_sourceanalysis(cfg, freqPost);</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif"><br></font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">Thank you in advance!</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">All the best,</font></span></div><div style="text-align:left"><span style="white-space:pre-wrap"><font face="arial, sans-serif">Alice</font></span></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://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8jFHtnxMnfPWdZwpuffE0CmZYO-BE7E-lIbrkAzeppz0geMAjX93uIkmJgmuhjORrLpc2wFQ9IAYQ0HLfKZu9E8VzSE$" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>