<div dir="ltr"><div>Hi Elena,<br><br>Thanks for the link - that is indeed a very nice and complete tutorial! A link in the current beamformer tutorial would be helpful for the next time I think - I will put one there.<br><br></div>And yes, I see now that although the documentation is as follows:<br><div><span style="font-family:monospace,monospace">% cfg.rawtrial = 'no' or 'yes' <b>construct filter from single trials</b>, apply to single trials. Note that you also may want to set cfg.keeptrials='yes' to keep all trial information, <span style="color:rgb(255,0,0)">especially if using in combination with grid.filter</span></span><br><br>(I find the red part inconsistent) it does take the pre-specified filter when provided, which is suggested somewhat implicitly further down in the code:<br><br><span style="font-family:monospace,monospace">if strcmp(cfg.rawtrial,'yes') && isfield(cfg,'grid') && ~isfield(cfg.grid,'filter')<br> warning('Using each trial to compute its own filter is not currently recommended. Use this option only with precomputed filters in grid.filter');<br>end</span><br><br></div><div>So that really clears it up. I will suggest an edit to the documentation, for the sake of clarification, and next time I run my beamformer I will remove the loop over trials :-)<br><br></div><div>Thanks again,<br></div><div>Stephen<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 7 July 2017 at 10:31, Elena Orekhova <span dir="ltr"><<a href="mailto:orekhova.elena.v@gmail.com" target="_blank">orekhova.elena.v@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Stephen,<br></div>I followed the tutorial in <a href="http://www.fieldtriptoolbox.org/tutorial/salzburg" target="_blank">http://www.fieldtriptoolbox.or<wbr>g/tutorial/salzburg</a>, but used 'dics' (see below). <br></div>I think that in the example below the sourceavg.<span class="m_-4211160704882402395m_8706990425559925294gmail-me1">avg</span>.<span class="m_-4211160704882402395m_8706990425559925294gmail-kw2">filter was indeed used and my results look nice.<br></span><div><br></div><div>Elena<br></div><div><pre class="m_-4211160704882402395m_8706990425559925294gmail-code m_-4211160704882402395m_8706990425559925294gmail-matlab"><span class="m_-4211160704882402395m_8706990425559925294gmail-mark">cfg</span>=<span class="m_-4211160704882402395m_8706990425559925294gmail-br0">[</span><span class="m_-4211160704882402395m_8706990425559925294gmail-br0">]</span>;
<span class="m_-4211160704882402395m_8706990425559925294gmail-mark">cfg</span>.<span class="m_-4211160704882402395m_8706990425559925294gmail-me1">method</span>=<span class="m_-4211160704882402395m_8706990425559925294gmail-co2">'lcmv'</span>;
<span class="m_-4211160704882402395m_8706990425559925294gmail-mark">cfg</span>.<a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html" target="_blank"><span class="m_-4211160704882402395m_8706990425559925294gmail-kw2">grid</span></a>=<a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html" target="_blank"><span class="m_-4211160704882402395m_8706990425559925294gmail-kw2">grid</span></a>;
<span class="m_-4211160704882402395m_8706990425559925294gmail-mark">cfg</span>.<a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html" target="_blank"><span class="m_-4211160704882402395m_8706990425559925294gmail-kw2">grid</span></a>.<a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/filter.html" target="_blank"><span class="m_-4211160704882402395m_8706990425559925294gmail-kw2">filter</span></a>=sourceavg.<span class="m_-4211160704882402395m_8706990425559925294gmail-me1">avg</span>.<a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/filter.html" target="_blank"><span class="m_-4211160704882402395m_8706990425559925294gmail-kw2"><wbr>filter</span></a>;
<span class="m_-4211160704882402395m_8706990425559925294gmail-mark">cfg</span>.<span class="m_-4211160704882402395m_8706990425559925294gmail-me1"><span class="m_-4211160704882402395m_8706990425559925294gmail-mark">rawtrial</span></span> = <span class="m_-4211160704882402395m_8706990425559925294gmail-co2">'yes'</span>;
<span class="m_-4211160704882402395m_8706990425559925294gmail-mark">cfg</span>.<span class="m_-4211160704882402395m_8706990425559925294gmail-me1">vol</span>=hdm;
sourcepreS1=ft_sourceanalysis<span class="m_-4211160704882402395m_8706990425559925294gmail-br0">(</span><span class="m_-4211160704882402395m_8706990425559925294gmail-mark"><wbr>cfg</span>, avgpre<span class="m_-4211160704882402395m_8706990425559925294gmail-br0">)</span>;
sourcepstS1=ft_sourceanalysis<span class="m_-4211160704882402395m_8706990425559925294gmail-br0">(</span><span class="m_-4211160704882402395m_8706990425559925294gmail-mark"><wbr>cfg</span>, avgpst<span class="m_-4211160704882402395m_8706990425559925294gmail-br0">)</span>;</pre><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 6 July 2017 at 18:03, Stephen Whitmarsh <span dir="ltr"><<a href="mailto:stephen.whitmarsh@gmail.com" target="_blank">stephen.whitmarsh@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Elena!<br><br></div>Thanks! But I do wonder.. did you check whether the common filter (specified in the cfg) was used or whether a filter was calculated for each trial separately (which does not make sense in my case)?<br><br></div>Best,<br></div>Stephen<br></div><div class="m_-4211160704882402395HOEnZb"><div class="m_-4211160704882402395h5"><div class="gmail_extra"><br><div class="gmail_quote">On 6 July 2017 at 16:57, Elena Orekhova <span dir="ltr"><<a href="mailto:orekhova.elena.v@gmail.com" target="_blank">orekhova.elena.v@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Just recently had the same problem. <br></div>It worked with cfg.rawtrial='yes'.<br><br></div>Best,<br></div>Elena<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-4211160704882402395m_5194166427672348947h5">On 4 July 2017 at 18:03, Stephen Whitmarsh <span dir="ltr"><<a href="mailto:stephen.whitmarsh@gmail.com" target="_blank">stephen.whitmarsh@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-4211160704882402395m_5194166427672348947h5">
<div>
<div dir="ltr">
<div>
<div>
<div>Hi everyone,<br>
<br>
<span style="font-family:arial,helvetica,sans-serif">I am now trying to use the DICS method for sourceanalysis, with 'powandcsd' output from ft_freqanalysis as its input and using a precomputed filter and leadfield. However, I would like to keep my separate
trial estimates in the final source analysis, and while the documentation suggests I should be able to get that with cfg.keeptrials, but this doesn't have the expected effect.<br>
<br>
</span></div>
<span style="font-family:arial,helvetica,sans-serif">I previously made workaround using PCC on fourier data instead (see below), I think to deal with this issue. I was wondering if this is still the recommended option, i.e. workaround? Alternatively, and perhaps
preferably, would someone have a suggestion for a solution consistent with the DICS implementation?</span><br>
<br>
</div>
Thanks for your time,<br>
</div>
Stephen<br>
<div>
<div><span style="font-family:monospace,monospace"><br>
</span></div>
<div><span style="font-family:monospace,monospace">% source analysis<br>
</span></div>
<div><span style="font-family:monospace,monospace">cfg.method = 'pcc';<br>
...<br>
cfg.keeptrials = 'yes';<br>
cfg.pcc.keepmom = 'yes';<br>
cfg.pcc.fixedori = 'no';<br>
source_control = ft_sourceanalysis(cfg, FFT); <br>
<br>
and then:<br>
<br>
% project moment and tapers<br>
cfg = [];<br>
cfg.projectmom = 'no';<br>
cfg.keeptrials = 'yes';<br>
cfg.powmethod = 'lambda1';<br>
source = ft_sourcedescriptives(cfg,sour<wbr>ce);<br>
</span><br>
<br>
</div>
</div>
</div>
</div>
<br></div></div><span>______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br></span></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>