<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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. <div><i><br></i><div><div>On Oct 21, 2013, at 4:31 AM, "<a href="mailto:smoratti@psi.ucm.es">smoratti@psi.ucm.es</a>" <<a href="mailto:smoratti@psi.ucm.es">smoratti@psi.ucm.es</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Leopold,<div><br></div><div>First, you have to regularise your MNE solution. Otherwise you get unstable results.</div><div>Second, the error occurs in mom = w*dat;</div><div>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.</div><div><br></div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div>________________________________________________________</div><div>Stephan Moratti, PhD<br><br></div><div>see also: <a href="http://web.me.com/smoratti/">http://web.me.com/smoratti/</a><br><br></div><div>Universidad Complutense de Madrid</div><div>Facultad de Psicología</div><div>Departamento de Psicología Básica I</div><div>Campus de Somosaguas</div><div>28223 Pozuelo de Alarcón (Madrid)</div><div>Spain</div><div><br></div><div>and</div><div><br></div><div>Center for Biomedical Technology</div><div>Laboratory for Cognitive and Computational Neuroscience</div><div>Parque Científico y Tecnológico de la Universidad Politecnica de Madrid<br>Campus Montegancedo</div><div>28223 Pozuelo de Alarcón (Madrid)</div><div>Spain<br><br><br>email: <a href="mailto:smoratti@psi.ucm.es">smoratti@psi.ucm.es</a><br>Tel.: +34 679219982</div></span>
</div>
<br><div><div>El 21/10/2013, a las 11:52, Zizlsperger Leopold escribió:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear all,<div>no suggestions so far? Am I missing something obvious?</div><div>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)</div><div>Would love to hear your ideas...</div><div>Best</div><div>Leo</div><div><br></div><div><br></div><div><br></div><div><br><div><div>On Oct 17, 2013, at 4:17 PM, Zizlsperger Leopold <<a href="mailto:zizlsperger@gmail.com">zizlsperger@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi all,<div>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): </div><div>In my example the two datasets have the structure:</div><div><br></div><div><div><i>disp(EEG1_HC35_GA_JD_ICA_Coh5cov);</i></div><div><i> avg: [32x7000 double]</i></div><div><i> var: [32x7000 double]</i></div><div><i> time: [1x7000 double]</i></div><div><i> dof: [32x7000 double]</i></div><div><i> label: {32x1 cell}</i></div><div><i> trial: [314x32x7000 double]</i></div><div><i> dimord: 'rpt_chan_time'</i></div><div><i> trialinfo: [314x32 double]</i></div><div><i> cfg: [1x1 struct]</i></div><div><i><br></i></div><div><i><br></i></div><div><div><i>disp(EEG1_HC35_GA_JD_ICA_Coh70cov);</i></div><div><i> avg: [32x7000 double]</i></div><div><i> var: [32x7000 double]</i></div><div><i> time: [1x7000 double]</i></div><div><i> dof: [32x7000 double]</i></div><div><i> label: {32x1 cell}</i></div><div><i> trial: [206x32x7000 double]</i></div><div><i> dimord: 'rpt_chan_time'</i></div><div><i> trialinfo: [206x32 double]</i></div><div><i> cfg: [1x1 struct]</i></div></div></div><div><br></div><div>When I try to do the sourceanalysis by:</div><div><br></div><div><i>cfg = [];</i></div><div><i>cfg.method = 'mne';</i></div><div><i>cfg.elec = elec_aligned;</i></div><div><i>cfg.grid = leadfield;</i></div><div><i>cfg.vol = vol;</i></div><div><i>cfg.mne.prewhiten = 'yes';</i></div><div><i>cfg.mne.lambda = 3;</i></div><div><i>cfg.mne.scalesourcecov = 'yes';</i></div><div><i>sourceCoh5 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh5cov);</i></div><div><i>sourceCoh70 = ft_sourceanalysis(cfg, EEG1_HC35_GA_JD_ICA_Coh70cov);</i></div><div><i><br></i></div><div><i>save source sourceCoh5 sourceCoh70;</i></div><div><br></div><div> I get the error:</div><div><br></div><div><i>the input is timelock data with 32 channels and 7000 timebins</i></div><div><i>using headmodel specified in the configuration</i></div><div><i>using electrodes specified in the configuration</i></div><div><i>determining source compartment (3)</i></div><div><i>projecting electrodes on skin surface</i></div><div><i>combining electrode transfer and system matrix</i></div><div><i>creating dipole grid based on user specified dipole positions</i></div><div><i>using headmodel specified in the configuration</i></div><div><i>using gradiometers specified in the configuration</i></div><div><i>8196 dipoles inside, 0 dipoles outside brain</i></div><div><i>the call to "ft_prepare_sourcemodel" took 0 seconds</i></div><div><i>estimating current density distribution for repetition 1</i></div><div><i>using pre-computed leadfields: some of the specified options will not have an effect</i></div><div><i>Warning: computing a unregularised minimum norm solution. This typically does not work</i></div><div><i>due to numerical accuracy problems </i></div><div><i>> In minimumnormestimate at 150</i></div><div><i> In ft_sourceanalysis at 856</i></div><div><i>??? Error using ==> mtimes</i></div><div><i>Inner matrix dimensions must agree.</i></div><div><i><br></i></div><div><i>Error in ==> minimumnormestimate at 226</i></div><div><i> mom = w * dat;</i></div><div><i><br></i></div><div><i>Error in ==> ft_sourceanalysis at 856</i></div><div><i> dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, optarg{:}); </i></div><div><i><br></i></div><div><br></div><div><br></div><div>Is this due to the different trial numbers of the datasets or does it point to another problem?</div><div>Thanks in advance</div><div>Best</div><div><br></div><div>Leo</div><div>RWTH Aachen Neurology</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></blockquote></div><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">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></blockquote></div><br></div></div>_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</blockquote></div><br></div></body></html>