[FieldTrip] Error in Source Analysis Results
Schoffelen, J.M. (Jan Mathijs)
jan.schoffelen at donders.ru.nl
Wed Jan 13 09:13:02 CET 2021
Hi Jason,
Did you check whether the data variables tlckL, and tlckR make sense, as well as the leadfield?
In particular for the leadfield, once there is any NaN in there - which may easily happen if something went wrong with the computation, e.g. through occasional dipoles being located outside the headmodel - those NaNs will spread through the whole matrix, and thus to the output, causing everything to be NaN.
Another, more mundane, cause would be that ALL of your dipole positions are considered as ‘outside’ the volume conductor, which would explain that all ‘mom’s are empty, and all ‘pow’s are nan.
Best wishes,
Jan-mathijs
On 12 Jan 2021, at 23:40, Jason Leung <j59leung at gmail.com<mailto:j59leung at gmail.com>> wrote:
Hi Fieldtrip community,
I'm new to fieldtrip and am having difficulties trying to follow the MNE tutorial<https://www.fieldtriptoolbox.org/tutorial/minimumnormestimate/> to do source analysis for EEG data. Similar to the tutorial, I did the following to compute my source using a precomputed leadfield:
cfg = [];
cfg.sourcemodel = sourcemodel_and_leadfield;
cfg.headmodel = headmodel;
cfg.elec = elec_realigned;
cfg.method = 'mne';
cfg.mne.prewhiten = 'yes';
cfg.mne.lambda = 3;
cfg.mne.scalesourcecov = 'yes';
sourceL = ft_sourceanalysis(cfg, tlckL);
sourceR = ft_sourceanalysis(cfg, tlckR);
Running the above give me the following output with no errors:
the input is timelock data with 64 channels and 2432 timebins
the call to "ft_selectdata" took 0 seconds
using precomputed leadfields
the call to "ft_selectdata" took 0 seconds
estimating current density distribution for repetition 1
using precomputed leadfields
computing the solution where the noise covariance is used for regularisation
prewhitening the leadfields using the noise covariance
scaling the source covariance
The input data are real-valued, assuming sensor time-series: Computing the dipole moments
the call to "ft_sourceanalysis" took 1 seconds
the input is timelock data with 64 channels and 2432 timebins
the call to "ft_selectdata" took 0 seconds
using precomputed leadfields
the call to "ft_selectdata" took 0 seconds
estimating current density distribution for repetition 1
using precomputed leadfields
computing the solution where the noise covariance is used for regularisation
prewhitening the leadfields using the noise covariance
scaling the source covariance
The input data are real-valued, assuming sensor time-series: Computing the dipole moments
the call to "ft_sourceanalysis" took 1 seconds
However, when I looked at the sourceL and sourceR variables, I can see that each cell in the sourceL.avg.mom and sourceL.avg.noisecov variables are empty, and sourceL.avg.pow is just full of NaNs.
I would appreciate it if someone can give me some suggestions of what went wrong here. Thank you very much in advance!
Jason
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210113/e914d9ec/attachment.htm>
More information about the fieldtrip
mailing list