<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear Lorenzo and others,<div class="">I’ve just looked into this, can reproduce the issue (same result with two different conditions/activity-baseline) </div><div class=""><br class=""></div><div class="">The issue arises because power is calculated based on the filter and the covariance of the input data (following VanVeen or a slight change for precomputed filters), yet in the example below no covariance is precomputed for activity/baseline timelock structures (only for the common dataset) and in that case fieldtrip creates an identity matrix for both activity and baseline (around line 713 in ft_sourceanalysis). </div><div class="">there is actually a warning about this, yet just from this warning (No covariance matrix found - will assume identity covariance matrix (mininum-norm solution)) it might to hard to get that this explains the results:</div><div class=""><br class=""></div><div class="">in essence from what I understand, the input data is ignored in the formula (for those interested this is line 278 in beamformer_lcmv) to compute the time series power, because the covariance is an identity matrix, and only the filter determines what ends up in the .pow field. and as the filter is the same for activity and baseline, the difference between the .pow output is zero.</div><div class=""><br class=""></div><div class="">now, computing covariances for the to-be-beamed segments (add a cfg.covariance = ‘yes’ to the timelock step for baseline and activity in the example) produces different power values (just tested with a simple auditory ERF dataset). </div><div class=""><br class=""></div><div class="">I suppose this is desired behavior (the identity matrix covariance), otherwise I would suggest to produce an error. </div><div class=""><br class=""></div><div class="">how well the ERF/timeseries is reconstructed of course depends on the data (time window) you use to create the filters. still it seems to me using the .mom field or creating virtual sensors yields better (in a sense of more focused) results. I still wonder why virtual sensors/.mom averages and .pow results are quite different, maybe one of the more knowledgeable ft developers could comment on at some point, but this might exceed the limit of this list…</div><div class=""><br class=""></div><div class="">cheers</div><div class="">philipp </div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 12 Jan 2016, at 15:46, Lorenzo Magazzini <<a href="mailto:lorenzomagazzini@gmail.com" class="">lorenzomagazzini@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi,<br class=""></div><div class=""><br class=""></div><div class="">I hope someone can help me to understand the use of the lcmv beamformer, because either I am using it incorrectly, or I misunderstood the meaning of its output.</div><div class=""><br class=""></div><div class="">I am trying to get source-level power estimates of 'baseline' and 'active' time-windows. I first compute a common filter, and then apply it separately to the two conditions. I thought the power estimates would be stored, voxel-wise, in the '.avg.pow' field of the ft_sourceanalysis output. However, the values I get in the '.pow' field for the analysis of 'baseline' and 'active' windows are identical. Furthermore, the '.pow' values are identical to the '.noise' values when using <font class="" face="monospace, monospace">cfg.projectnoise = 'yes';</font>.</div><div class=""><br class=""></div><div class="">I have checked if the sensor-level data that passed on to ft_sourceanalysis is different between baseline and active - it is.</div><div class=""><br class=""></div><div class="">Also, if I do the following...</div><div class="">1. reconstruct virtual sensors by applying the common filter separately to baseline and active, </div><div class="">2. average the single-trial (virtual sensor) power estimates, </div><div class="">3. replace the '.pow' value for each voxel, </div><div class="">...then the contrast between baseline and active is correct.</div><div class=""><br class=""></div><div class="">Can anyone please help me figure out what I'm doing wrong here? Below I copied part of the code.</div><div class=""><br class=""></div><div class="">Many thanks in advance!</div><div class=""><br class=""></div><div class="">Lorenzo</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class=""><font class="Apple-style-span" face="monospace, monospace">%compute the leadfield</font></div><div class=""><font class="Apple-style-span" face="monospace, monospace">cfg = [];</font></div><div class=""><font class="Apple-style-span" face="monospace, monospace">cfg.channel = {'MEG'};</font></div><div class=""><font class="Apple-style-span" face="monospace, monospace">cfg.grid = sourcemodel;</font></div><div class=""><font class="Apple-style-span" face="monospace, monospace">cfg.vol = hdm;</font></div><div class=""><font class="Apple-style-span" face="monospace, monospace">cfg.grad = grad;</font></div><div class=""><font class="Apple-style-span" face="monospace, monospace">cfg.normalize = 'yes';</font></div><div class=""><font class="Apple-style-span" face="monospace, monospace">leadfield = ft_prepare_leadfield(cfg);</font></div></div><div class=""><br class=""></div><div class=""><font class="" face="monospace, monospace">%compute covariance matrix</font></div><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div class=""><div class=""><font class="" face="monospace, monospace">cfg = [];</font></div><div class=""><font class="" face="monospace, monospace">cfg.channel = {'MEG'};</font></div><div class=""><font class="" face="monospace, monospace">cfg.removemean = 'no';</font></div><div class=""><font class="" face="monospace, monospace">cfg.covariance = 'yes';</font></div><div class=""><font class="" face="monospace, monospace">cfg.covariancewindow = [-1.5 1.5];</font></div><div class=""><font class="" face="monospace, monospace">tlck = ft_timelockanalysis(cfg, data);</font></div></div><div class=""><font class="" face="monospace, monospace"><br class=""></font></div><div class=""><div class=""><font class="" face="monospace, monospace">%get the common spatial filter</font></div><div class=""><font class="" face="monospace, monospace">cfg = [];</font></div><div class=""><font class="" face="monospace, monospace">cfg.method = 'lcmv';</font></div><div class=""><font class="" face="monospace, monospace">cfg.grid = leadfield;</font></div><div class=""><font class="" face="monospace, monospace">cfg.vol = hdm;</font></div><div class=""><font class="" face="monospace, monospace">cfg.grad = grad;</font></div><div class=""><font class="" face="monospace, monospace">cfg.lcmv.fixedori = 'yes';</font></div><div class=""><font class="" face="monospace, monospace">cfg.lcmv.keepfilter = 'yes';</font></div><div class=""><font class="" face="monospace, monospace">cfg.lcmv.projectnoise = 'yes';</font></div><div class=""><font class="" face="monospace, monospace">cfg.lcmv.lambda = '5%';</font></div><div class=""><font class="" face="monospace, monospace">src = ft_sourceanalysis(cfg, tlck);</font></div><div class=""><font class="" face="monospace, monospace"><br class=""></font></div><div class=""><font class="" face="monospace, monospace">%store the filter</font></div><div class=""><font class="" face="monospace, monospace">wts = src.avg.filter;</font></div></div><div class=""><br class=""></div><div class=""><div class=""><font class="" face="monospace, monospace">%separate baseline and active windows of bandpass-filtered data</font></div><div class=""><font class="" face="monospace, monospace">cfg = [];</font></div><div class=""><font class="" face="monospace, monospace">cfg.toilim = [-1.5 -0.3];</font></div><div class=""><font class="" face="monospace, monospace">data_bsln = ft_redefinetrial(cfg, data);</font></div><div class=""><font class="" face="monospace, monospace">cfg = [];</font></div><div class=""><font class="" face="monospace, monospace">cfg.toilim = [0.3 1.5];</font></div><div class=""><font class="" face="monospace, monospace">data_actv = ft_redefinetrial(cfg, data);</font></div></div><div class=""><font class="" face="monospace, monospace"><br class=""></font></div><div class=""><div class=""><font class="" face="monospace, monospace">%timelock analysis of baseline and active</font></div><div class=""><font class="" face="monospace, monospace">cfg = [];</font></div><div class=""><font class="" face="monospace, monospace">cfg.channel = {'MEG'};</font></div><div class=""><font class="" face="monospace, monospace">cfg.keeptrials = 'yes';</font></div><div class=""><font class="" face="monospace, monospace">tlck_bsln = ft_timelockanalysis(cfg, data_bsln);</font></div><div class=""><font class="" face="monospace, monospace">tlck_actv = ft_timelockanalysis(cfg, data_actv);</font></div></div><div class=""><font class="" face="monospace, monospace"><br class=""></font></div><div class=""><font class="" face="monospace, monospace">%get source-power estimates of bsln and actv separately using the pre-computed common filter (wts)</font></div><div class=""><div class=""><font class="" face="monospace, monospace">cfg = [];</font></div><div class=""><font class="" face="monospace, monospace">cfg.method = 'lcmv';</font></div><div class=""><font class="" face="monospace, monospace">cfg.vol = hdm;</font></div><div class=""><font class="" face="monospace, monospace">cfg.grid = leadfield; </font></div><div class=""><font class="" face="monospace, monospace">cfg.grid.filter = wts;</font></div><div class=""><font class="" face="monospace, monospace">% cfg.keepfilter = 'no';</font></div><div class=""><font class="" face="monospace, monospace">cfg.lcmv.fixedori = 'yes';</font></div><div class=""><font class="" face="monospace, monospace">cfg.projectnoise = 'yes';</font></div><div class=""><font class="" face="monospace, monospace">cfg.lambda = '5%';</font></div><div class=""><font class="" face="monospace, monospace">cfg.keeptrials = 'yes';</font></div></div><div class=""><div class=""><font class="" face="monospace, monospace">src_bsln = ft_sourceanalysis(cfg, tlck_bsln);</font></div></div><div class=""><font class="" face="monospace, monospace">src_actv = ft_sourceanalysis(cfg, tlck_actv);</font><br class=""></div><div class=""><font class="" face="monospace, monospace"><br class=""></font></div><div class=""><font class="" face="monospace, monospace"><br class=""></font></div></div>
_______________________________________________<br class="">fieldtrip mailing list<br class=""><a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</div></blockquote></div><br class=""></div></body></html>