<div dir="ltr"><div><div><div><div><div>Dear Eelke and Jörn,<br><br></div>thanks for the super quick responses! And sorry for the double post... <br><br></div>I tried Eelke's suggestion and that holds. So, I have only NaNs in the fields for the dipole locations outside the brain.<br>
However, if I continue and calculate the contrast between pre and post and plot it I don't see any activation. <br><br></div>I will try your suggestion, Jörn, as well and see whether it has to do with the re-definition. <br>
<br></div>Thanks again for your suggestions!<br><br></div>Best,<br><br>Andreas<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/6/4 Eelke Spaak <span dir="ltr"><<a href="mailto:eelke.spaak@donders.ru.nl" target="_blank">eelke.spaak@donders.ru.nl</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Andreas,<br>
<br>
How many NaNs do you get exactly and in which field? If it is some<br>
NaNs in source.avg.pow, then it is quite normal: the estimates for<br>
dipole locations which were flagged as outside the brain are always<br>
NaN, as they are not scanned. The following should hold:<br>
<br>
sum(isnan(source.avg.pow)) == numel(source.outside)<br>
&&<br>
sum(~isnan(source.avg.pow)) == numel(source.inside)<br>
<br>
Best,<br>
Eelke<br>
<div><div class="h5"><br>
On 4 June 2013 11:42, Andreas Sauer <<a href="mailto:sauer.mpih@googlemail.com">sauer.mpih@googlemail.com</a>> wrote:<br>
> Dear all,<br>
><br>
> I would like to analyze sources with the beamforming approach using the DICS<br>
> method. I followed the steps in the tutorial and everything works well.<br>
> However, the output of ft_sourceanalysis contains only NaNs.<br>
><br>
> I checked the TF data that I calculated in the step before but that looks<br>
> fine, so I assume the error happens somewhere during ft_sourceanalysis.<br>
><br>
> That's how I calculate the TFRs:<br>
><br>
>         cfg = [];<br>
>         cfg.toilim = [-0.5 -0.3]; % baseline activity<br>
>         eval(['dataPre =<br>
> ft_redefinetrial(cfg,Cond_',num2str(cond(j)),');']);<br>
>         cfg.toilim = [0.1 1.0]; % task-related activity<br>
>         eval(['dataPost =<br>
> 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))<br>
> 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)), ' =<br>
> ft_freqanalysis(cfg,dataPre);']);<br>
>         eval(['freqPost.Cond_',num2str(cond(j)), ' =<br>
> ft_freqanalysis(cfg,dataPost);']);<br>
><br>
>         % ... and for the whole trial<br>
>         eval(['freqAll.Cond_',num2str(cond(j)), ' =<br>
> ft_freqanalysis(cfg,data);']);<br>
>         eval(['freqAll.Cond_',num2str(cond(j)), '.trialdesign =<br>
> trialdesign;']); % pre and post info<br>
><br>
> 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<br>
> the structure<br>
>         cfg.vol           = vol;<br>
>         cfg.dim           = template_grid.dim; % Here I give the dimension<br>
> 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<br>
> filter<br>
><br>
>         eval(['SourceAll = ft_sourceanalysis(cfg,<br>
> freqAll.Cond_',num2str(cond(k)),');'])<br>
><br>
>         % use the common filter here<br>
>         cfg.grid.filter = SourceAll.avg.filter;<br>
>         eval(['sourcePre_con = ft_sourceanalysis(cfg,<br>
> freqPre.Cond_',num2str(cond(k)),');'])<br>
>         eval(['sourcePost_con = ft_sourceanalysis(cfg,<br>
> freqPost.Cond_',num2str(cond(k)),');'])<br>
><br>
><br>
><br>
> I would really appreciate any help with that! Thanks a lot!<br>
><br>
> Best,<br>
><br>
> Andreas<br>
><br>
> --<br>
> Andreas Sauer<br>
> Max Planck Institute for Brain Research<br>
> Deutschordenstr. 46<br>
> 60528 Frankfurt am Main<br>
> Germany<br>
><br>
> T: +49 69 96769 278<br>
> F: +49 69 96769 327<br>
> Email: <a href="mailto:andreas.sauer@brain.mpg.de">andreas.sauer@brain.mpg.de</a><br>
> <a href="http://www.brain.mpg.de" target="_blank">www.brain.mpg.de</a><br>
><br>
</div></div>> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
> <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div></div><div>Dipl.-Psych. Andreas Sauer</div><div>Max Planck Institute for Brain Research</div><div>Deutschordenstraße 46</div><div>60528 Frankfurt am Main</div><div>Germany</div>
<div><br></div><div>T: +49 69 96769 278</div><div>F: +49 69 96769 327</div><div>Email: <a href="mailto:sauer.mpih@gmail.com" target="_blank">sauer.mpih@gmail.com</a></div><div><a href="http://www.brain.mpg.de" target="_blank">www.brain.mpg.de</a></div>

</div>