[FieldTrip] NaNs as outpout of ft_sourceanalysis (DICS)

Andreas Sauer sauer.mpih at googlemail.com
Tue Jun 4 11:52:24 CEST 2013


Dear all,

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.

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.

That's how I calculate the TFRs:

        cfg = [];
        cfg.toilim = [-0.5 -0.3]; % baseline activity
        eval(['dataPre =
ft_redefinetrial(cfg,Cond_',num2str(cond(j)),');']);
        cfg.toilim = [0.1 1.0]; % task-related activity
        eval(['dataPost =
ft_redefinetrial(cfg,Cond_',num2str(cond(j)),');']);

        % Combine the two datasets...
        data = appenddata(cfg, dataPre, dataPost);
        trialdesign = [ones(1,length(dataPost.trial))
ones(1,length(dataPre.trial))*2];

        % ... and compute the CSD matrices...
        cfg = [];
        cfg.output     = 'powandcsd';
        cfg.channel    = Channel.meg;
        cfg.method     = 'mtmfft';
        cfg.taper      = 'dpss';
        cfg.foilim     = [75 75];
        cfg.tapsmofrq  = 15; % amount of spectral smoothing = +/- 15 Hz
        cfg.channelcmb = {Channel.meg Channel.meg};

        % ... for the baseline and task part separately...
        eval(['freqPre.Cond_',num2str(cond(j)), ' =
ft_freqanalysis(cfg,dataPre);']);
        eval(['freqPost.Cond_',num2str(cond(j)), ' =
ft_freqanalysis(cfg,dataPost);']);

        % ... and for the whole trial
        eval(['freqAll.Cond_',num2str(cond(j)), ' =
ft_freqanalysis(cfg,data);']);
        eval(['freqAll.Cond_',num2str(cond(j)), '.trialdesign =
trialdesign;']); % pre and post info

And that's how I calculate the sources:

        cfg               = [];
        cfg.frequency     = 75;
        cfg.method        = 'dics';
        cfg.grid          = grid; % Here it gives .pos, .inside, .outside
to the structure
        cfg.vol           = vol;
        cfg.dim           = template_grid.dim; % Here I give the dimension
of the template grid
        cfg.grad          = Cond_101.hdr.grad;
        cfg.lambda        = '5%';
        cfg.reducerank    = 'no';
        cfg.projectnoise  = 'yes';
        cfg.realfilter    = 'yes';
        cfg.keepfilter    = 'yes'; % the output saves the computed inverse
filter

        eval(['SourceAll = ft_sourceanalysis(cfg,
freqAll.Cond_',num2str(cond(k)),');'])

        % use the common filter here
        cfg.grid.filter = SourceAll.avg.filter;
        eval(['sourcePre_con = ft_sourceanalysis(cfg,
freqPre.Cond_',num2str(cond(k)),');'])
        eval(['sourcePost_con = ft_sourceanalysis(cfg,
freqPost.Cond_',num2str(cond(k)),');'])



I would really appreciate any help with that! Thanks a lot!

Best,

Andreas


-- 
Andreas Sauer
Max Planck Institute for Brain Research
Deutschordenstr. 46
60528 Frankfurt am Main
Germany

T: +49 69 96769 278
F: +49 69 96769 327
Email: andreas.sauer at brain.mpg.de <sauer.mpih at gmail.com>
www.brain.mpg.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130604/f3b0a13b/attachment-0001.html>


More information about the fieldtrip mailing list