<div dir="ltr"> Hi Jens, <div> Thank you for your response. I figured out where the problem resided.  It seems to me that the 'PCC' temporarily does not work with the option "rawtrial = 'yes'".  So, the output from using "keeptrials = 'yes'" does not contain the pow and mom information for individual trials.  However, this information can be reconstructed for each trial using the ft_sourcedescriptive function with "keeptrials = 'yes' ".  </div><div> For source analysis of time series (e.g., lcmv and eloreta), individual trial information can be obtained by setting "keeptrials = 'yes' and rawtrial = 'yes' ". No need for the ft_sourcedescriptive function.  </div><div> I don't know if this was only my case or someone else also had come across the same situation. </div><div><br></div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-04 10:47 GMT-05:00 "Jens Klinzing, Universität Tübingen" <span dir="ltr"><<a href="mailto:jens.klinzing@uni-tuebingen.de" target="_blank">jens.klinzing@uni-tuebingen.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div bgcolor="#FFFFFF" text="#000000">Hi Xie,<br>
are you sure your output does not contain trial data? <br>
<br>
If you look in source.avg.mom you should see a cell array containing for
 each inside source point another cell array with as many entries as 
there are trials (I know it is confusing because you expect .avg to 
contain averages, but it may not). The field .csd (cross-spectral 
density) should contain only one (complex-valued) entry per source point
 since it is averaged across trials (or calculated on the average over 
all trials, not sure right now).<br>
<span>

</span><br>
By the way: In case you get errors in downstream functions with your 
current output (e.g. when using ft_sourcegrandaverage) check the 
bugzilla on PCC output containing the spatial filter (e.g. 
<a class="m_-1660973796607920191moz-txt-link-freetext" href="http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2861" target="_blank">http://bugzilla.<wbr>fieldtriptoolbox.org/show_bug.<wbr>cgi?id=2861</a> or 3184). <br>
If you don't really need the filter you can use cfg.keepfilter = 'no' on
 ft_sourceanalysis or remove the filter and filterdimord fields when 
calling functions that would otherwise fail.<br>
<br>
Best,<br>
Jens<br>
<blockquote style="border:0px none" type="cite">
  <div style="margin:30px 25px 10px 25px" class="m_-1660973796607920191__pbConvHr"><div style="width:100%;border-top:2px solid #edf1f4;padding-top:10px">   <div style="display:inline-block;white-space:nowrap;vertical-align:middle;width:49%">
        <a href="mailto:xiew1202@gmail.com" style="color:#485664!important;padding-right:6px;font-weight:500;text-decoration:none!important" target="_blank">Xie Wanze</a></div>   <div style="display:inline-block;white-space:nowrap;vertical-align:middle;width:48%;text-align:right">     <font color="#909AA4"><span style="padding-left:6px">Samstag,
 31. Dezember 2016 15:09</span></font></div>    </div></div>
  <div style="color:#909aa4;margin-left:24px;margin-right:24px" class="m_-1660973796607920191__pbConvBody"><div><div class="h5"><div dir="ltr">Dear Fieldtrip 
community, <div>I have a question about using the "keeptrials" option 
when do the source analysis with the beamformer ('PCC') method.   The 
issue I met was that the cfg.keeptrials = 'yes' did not work, i.e., the 
calculation was not done for all the trials but generated averaged 
output.  </div><div> Has anyone met this issue before? And does anyone 
know how to fix it?</div><div> It did not work for my data nor for the 
data I downloaded from the FT database. I attached the codes that I 
copied from the FT website using the FT's example data. </div><div> I 
would like to keep the trials information in the source analysis because
 I plan to do the source space connectivity analysis later, which needs 
the individual trials information. Or maybe the "crsspctrm" matrix.</div><div><br></div><div>Codes:</div><div><br></div><div> <span>cfg </span><span>                  </span><span>= [];</span></div>








<p class="m_-1660973796607920191gmail-p1"><span class="m_-1660973796607920191gmail-s1">cfg.frequency         = 
freq.freq;</span></p>
<p class="m_-1660973796607920191gmail-p1"><span class="m_-1660973796607920191gmail-s1">cfg.method            = 
'pcc';</span></p>
<p class="m_-1660973796607920191gmail-p1"><span class="m_-1660973796607920191gmail-s1">cfg.grid              = lf;</span></p>
<p class="m_-1660973796607920191gmail-p1"><span class="m_-1660973796607920191gmail-s1">cfg.headmodel         = hdm;</span></p>
<p class="m_-1660973796607920191gmail-p1"><span class="m_-1660973796607920191gmail-s1">cfg.keeptrials        = 
'yes';</span></p>
<p class="m_-1660973796607920191gmail-p1"><span class="m_-1660973796607920191gmail-s1">cfg.pcc.lambda        = 
'10%';</span></p>
<p class="m_-1660973796607920191gmail-p1"><span class="m_-1660973796607920191gmail-s1">cfg.pcc.projectnoise  = 
'yes';</span></p>
<p class="m_-1660973796607920191gmail-p1"><span class="m_-1660973796607920191gmail-s1">cfg.pcc.keepfilter    = 
'yes';</span></p>
<p class="m_-1660973796607920191gmail-p1"><span class="m_-1660973796607920191gmail-s1">cfg.pcc.fixedori      = 
'yes';</span></p>
<p class="m_-1660973796607920191gmail-p1"><span class="m_-1660973796607920191gmail-s1">source = 
ft_sourceanalysis(cfg, freq);</span></p><p class="m_-1660973796607920191gmail-p1"><br></p><p class="m_-1660973796607920191gmail-p1">Output ("source"):</p><p class="m_-1660973796607920191gmail-p1">    freq: 10</p><p class="m_-1660973796607920191gmail-p1">    cumtapcnt: [268x1 double]</p><p class="m_-1660973796607920191gmail-p1"> 
         tri: [16000x3 double]</p><p class="m_-1660973796607920191gmail-p1">       inside: 
[8004x1 logical]</p><p class="m_-1660973796607920191gmail-p1">          pos: [8004x3 double]</p><p class="m_-1660973796607920191gmail-p1">       method: 'average'</p><p class="m_-1660973796607920191gmail-p1">       
   avg: [1x1 struct]</p><p class="m_-1660973796607920191gmail-p1">          cfg: [1x1 struct] </p><div> </div></div>

</div></div><div>______________________________<wbr>_________________<br>fieldtrip 
mailing list<br><a class="m_-1660973796607920191moz-txt-link-abbreviated" href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br><a class="m_-1660973796607920191moz-txt-link-freetext" href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a></div></div>
</blockquote>
<br>
</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>