[FieldTrip] problem with source reconstruction of ERP

Rojas, Don Don.Rojas at ucdenver.edu
Mon Oct 21 17:18:57 CEST 2013


Based on past experience, I'd think that Stephan's suggestion is a good one to resolve the inner matrix dimension agreement error. You may have a pre-prepared leadfield with a different number of channels than the number you supply for the source solution. Check your cfg.elec.label field and see if it is the same length as the 1st dimension of EEG1_HC35_GA_JD_ICA_Coh5cov.avg. You might have left an ECG, EMG or EOG channel in the call to ft_prepare_leadfield.

On Oct 21, 2013, at 4:31 AM, "smoratti at psi.ucm.es<mailto:smoratti at psi.ucm.es>" <smoratti at psi.ucm.es<mailto:smoratti at psi.ucm.es>> wrote:

Dear Leopold,

First, you have to regularise your MNE solution. Otherwise you get unstable results.
Second, the error occurs in mom = w*dat;
I guess w is the MNE kernel or inverse operator and dat your data. You may debug the code (by opening minimumnormestimate and put a stop button at line 226). Then, investigate the dimensions of w and dat. Maybe something went wrong on the way (head model, lead field, etc.). Maybe less electrodes in the lead field as in data or so. But knowing the dimensions of w and dat should help to figure out the problem.


________________________________________________________
Stephan Moratti, PhD

see also: http://web.me.com/smoratti/

Universidad Complutense de Madrid
Facultad de Psicología
Departamento de Psicología Básica I
Campus de Somosaguas
28223 Pozuelo de Alarcón (Madrid)
Spain

and

Center for Biomedical Technology
Laboratory for Cognitive and Computational Neuroscience
Parque Científico y Tecnológico de la Universidad Politecnica de Madrid
Campus Montegancedo
28223 Pozuelo de Alarcón (Madrid)
Spain


email: smoratti at psi.ucm.es<mailto:smoratti at psi.ucm.es>
Tel.:    +34 679219982

El 21/10/2013, a las 11:52, Zizlsperger Leopold escribió:

Dear all,
no suggestions so far? Am I missing something obvious?
In the meantime I "cut" the timelock data to contain the same number of trials but that did not resolve the issue either (I got the same error, see below)
Would love to hear your ideas...
Best
Leo




On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold <zizlsperger at gmail.com<mailto:zizlsperger at gmail.com>> wrote:

Hi all,
I need your help with a problem with calculating the inverse solution in source reconstruction. I create source / volume conduction model using the FieldTrip default MRI and the tutorial documentation, my EEG electrodes align well, too. The problem appears when I try to process my functional timelocked data (demean=yes, covariance=yes):
In my example the two datasets have the structure:

disp(EEG1_HC35_GA_JD_ICA_Coh5cov);
          avg: [32x7000 double]
          var: [32x7000 double]
         time: [1x7000 double]
          dof: [32x7000 double]
        label: {32x1 cell}
        trial: [314x32x7000 double]
       dimord: 'rpt_chan_time'
    trialinfo: [314x32 double]
          cfg: [1x1 struct]


disp(EEG1_HC35_GA_JD_ICA_Coh70cov);
          avg: [32x7000 double]
          var: [32x7000 double]
         time: [1x7000 double]
          dof: [32x7000 double]
        label: {32x1 cell}
        trial: [206x32x7000 double]
       dimord: 'rpt_chan_time'
    trialinfo: [206x32 double]
          cfg: [1x1 struct]

When I try to do the sourceanalysis by:

cfg        = [];
cfg.method = 'mne';
cfg.elec = elec_aligned;
cfg.grid   = leadfield;
cfg.vol    = vol;
cfg.mne.prewhiten = 'yes';
cfg.mne.lambda    = 3;
cfg.mne.scalesourcecov = 'yes';
sourceCoh5  = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov);
sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov);

save source sourceCoh5 sourceCoh70;

 I get the error:

the input is timelock data with 32 channels and 7000 timebins
using headmodel specified in the configuration
using electrodes specified in the configuration
determining source compartment (3)
projecting electrodes on skin surface
combining electrode transfer and system matrix
creating dipole grid based on user specified dipole positions
using headmodel specified in the configuration
using gradiometers specified in the configuration
8196 dipoles inside, 0 dipoles outside brain
the call to "ft_prepare_sourcemodel" took 0 seconds
estimating current density distribution for repetition 1
using pre-computed leadfields: some of the specified options will not have an effect
Warning: computing a unregularised minimum norm solution. This typically does not work
due to numerical accuracy problems
> In minimumnormestimate at 150
  In ft_sourceanalysis at 856
??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> minimumnormestimate at 226
  mom = w * dat;

Error in ==> ft_sourceanalysis at 856
        dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:});



Is this due to the different trial numbers of the datasets or does it point to another problem?
Thanks in advance
Best

Leo
RWTH Aachen Neurology







_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20131021/e8f7c4e5/attachment.html>


More information about the fieldtrip mailing list