<div dir="ltr"><div><div><div><div>Dear all,<br><br></div>I would like to analyze sources with the beamforming approach using the DICS method. I followed the steps in the tutorial and everything works well. However, the output of ft_sourceanalysis contains only NaNs. <br>
<br></div>I checked the TF data that I calculated in the step before but that looks fine, so I assume the error happens somewhere during ft_sourceanalysis. <br><br></div><div>That's how I calculate the TFRs:<br><br> cfg = []; <br>
cfg.toilim = [-0.5 -0.3]; % baseline activity <br> eval(['dataPre = ft_redefinetrial(cfg,Cond_',num2str(cond(j)),');']);<br> cfg.toilim = [0.1 1.0]; % task-related activity<br>
eval(['dataPost = ft_redefinetrial(cfg,Cond_',num2str(cond(j)),');']);<br> <br> % Combine the two datasets...<br> data = appenddata(cfg, dataPre, dataPost);<br> trialdesign = [ones(1,length(dataPost.trial)) ones(1,length(dataPre.trial))*2];<br>
<br> % ... and compute the CSD matrices...<br> cfg = [];<br> cfg.output = 'powandcsd';<br> cfg.channel = Channel.meg;<br> cfg.method = 'mtmfft'; <br> cfg.taper = 'dpss';<br>
cfg.foilim = [75 75];<br> cfg.tapsmofrq = 15; % amount of spectral smoothing = +/- 15 Hz<br> cfg.channelcmb = {Channel.meg Channel.meg};<br><br> % ... for the baseline and task part separately...<br>
eval(['freqPre.Cond_',num2str(cond(j)), ' = ft_freqanalysis(cfg,dataPre);']);<br> eval(['freqPost.Cond_',num2str(cond(j)), ' = ft_freqanalysis(cfg,dataPost);']);<br><br> % ... and for the whole trial<br>
eval(['freqAll.Cond_',num2str(cond(j)), ' = ft_freqanalysis(cfg,data);']);<br> eval(['freqAll.Cond_',num2str(cond(j)), '.trialdesign = trialdesign;']); % pre and post info<br>
</div><div><br></div><div>And that's how I calculate the sources:<br><br> cfg = []; <br> cfg.frequency = 75; <br> cfg.method = 'dics';<br> cfg.grid = grid; % Here it gives .pos, .inside, .outside to the structure<br>
cfg.vol = vol;<br> cfg.dim = template_grid.dim; % Here I give the dimension of the template grid<br> cfg.grad = Cond_101.hdr.grad;<br> cfg.lambda = '5%'; <br>
cfg.reducerank = 'no';<br> cfg.projectnoise = 'yes';<br> cfg.realfilter = 'yes';<br> cfg.keepfilter = 'yes'; % the output saves the computed inverse filter<br>
<br> eval(['SourceAll = ft_sourceanalysis(cfg, freqAll.Cond_',num2str(cond(k)),');'])<br> <br></div><div> % use the common filter here<br></div><div> cfg.grid.filter = SourceAll.avg.filter;<br>
eval(['sourcePre_con = ft_sourceanalysis(cfg, freqPre.Cond_',num2str(cond(k)),');']) <br> eval(['sourcePost_con = ft_sourceanalysis(cfg, freqPost.Cond_',num2str(cond(k)),');'])<br>
<br><br><br></div>I would really appreciate any help with that! Thanks a lot!<br><br></div>Best,<br><br>Andreas<br clear="all"><div><div><div><div><div><div><div><br>-- <br><div></div>
<div>Andreas Sauer</div><div>Max Planck Institute for Brain Research</div><div>Deutschordenstr. 46</div><div>60528 Frankfurt am Main</div><div>Germany</div><div><br></div><div>T: <a href="tel:%2B49%2069%2096769%20278" value="+496996769278" target="_blank">+49 69 96769 278</a></div>
<div>F: <a href="tel:%2B49%2069%2096769%20327" value="+496996769327" target="_blank">+49 69 96769 327</a></div>
<div>Email: <a href="mailto:andreas.sauer@brain.mpg.de" target="_blank">andreas.sauer@brain.mpg.de</a></div><div><a href="http://www.brain.mpg.de" target="_blank">www.brain.mpg.de</a></div>
</div></div></div></div></div></div></div></div>