<div dir="ltr">Dear fieldtrip experts,<div>I am doing single-trial connectivity in the source space with EEG, and I moved recently to fieldtrip.</div><div>I am trying to use the eLoreta method to get single-trial estimates in the following way:</div><div><br></div><div><div>% eLORETA </div><div>cfg = []; </div><div>cfg.method                          = 'eloreta';</div><div>cfg.grid                                  = leadfield;</div><div>cfg.headmodel                       = headmodel;</div><div>cfg.eloreta.keepfilter              = 'yes';</div><div>cfg.eloreta.normalize               = 'yes';</div><div>cfg.eloreta.lambda                  = 0.05;                                      *(1)</div><div>cfg.eloreta.projectnoise            = 'yes';</div><div>eLO_source                          = ft_sourceanalysis(cfg,data);</div><div><br></div><div>% in the above line, "data" is the results of ft_timelockanalysis</div><div>% with cfg.covariance = 'yes';                                                  *(2)</div><div><br></div><div>% then I put the source positions from the MNI template I </div><div>% used for the sourcemodel (see: </div><div>% <a href="http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-">http://www.fieldtriptoolbox.org/tutorial/sourcemodel#subject-</a></div><div>% specific_grids_that_are_equivalent_across_subjects_in_normalized_space  </div><div>eLO_source.pos                      = template_grid.pos;</div><div>iPOS                                = eLO_source.pos;</div><div>iPOS(eLO_source.inside==0,:)        = NaN; % only points inside gray matter</div><div><br></div><div>% Then I select ROIs (here only one for simplicity) to extract single-trial source activity:</div><div>[v,I]  <span style="white-space:pre">                         </span>    = min(pdist2(iPOS, ROIs_mni , 'euclidean'));</div><div><br></div><div>% And I multiply the spatial filter for the EEG data in each trial</div><div>W            = eLO_source.avg.filter{I}; % filter at my ROI of interest</div><div>for tr = 1:size(data.trial,1)</div><div>       % loop over trials    </div><div>     trials{tr} = W * squeeze(data.trial(tr,:,:));                            *(3)</div><div>end</div></div><div><br></div><div>My 3 questions (marked at the right of the above code) are the following:</div><div><br></div><div>(0, not marked above): Is this approach correct?</div><div><br></div><div>(1) Is there a way to select the best lambda parameter (e.g., selecting the one that best approximates the</div><div>activity at the EEG channels level)?</div><div><br></div><div>(2) I am confused about the role of the covariance, since it doesn't seem to be used when source activity</div><div>is estimated using the set of spatial filters at the single trial (my lack of knowledge)</div><div><br></div><div>(3) Is the "trials{tr} = W * squeeze(data.trial(tr,:,:)); " approach correct to get time-series of source activity in a ROI?</div><div><br></div><div>I hope this was clear enough, looking forward for your feedback.</div><div><br></div><div>Best,<br>David</div><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(153,153,153);font-style:italic;font-family:Helvetica,Arial,sans-serif;font-size:12.8px">--------------------- </span><br style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px"><span style="color:rgb(153,153,153);font-style:italic;font-family:Helvetica,Arial,sans-serif;font-size:12.8px">David Pascucci</span><br style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px"><br style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px"><span style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px">Postdoctoral Fellow</span><br style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px"><span style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px">University of Fribourg</span><br style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px"><span style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px">Department of Psychology</span><br style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px"><span style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px">Rue de Faucigny 2</span><br style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px"><span style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px">1700 Fribourg</span><br style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px"><span style="color:rgb(153,153,153);font-family:Helvetica,Arial,sans-serif;font-size:12.8px">Switzerland</span><br></div></div></div></div></div>