[FieldTrip] Help with source reconstruction
Schoffelen, J.M. (Jan Mathijs)
janmathijs.schoffelen at donders.ru.nl
Fri Aug 9 09:49:35 CEST 2024
Hi Sara,
Mi dispiace, but I don’t fully understand why you are asking what you are asking for. A dipole fit model is underdetermined, i.e. there are fewer parameters than measurement points, so the model will always be less than data, in which case it makes sense to look at things such as residual variance (because it can be used as the objective measure to evaluate which is the ‘winning’ model). An mne model is (highly) overdetermined, i.e. there are more parameters than measurement points, so the model will always fit the data perfectly (up to the optionally prespecified noise matrix), so there will be no meaningful residual that can be used to evaluate the model.
If you want to more or less do what you ask for, you probably want to multiply your sensor data with the identity matrix from which you subtracted the inverse operator pre-multiplied with the leadfield:
Xhat = (I - leadfield * inverse-operator) * X
In FieldTrip terminology
Xhat = (eye(nchan) - cat(2,sourcemodel.leadfield{:})*cat(1,source.avg.filter{:})))*X;
X can be a matrix of single trial sensor data, i.e. data.trial{#}, or an evoked average, i.e. timelock.avg, or a single sensor level fourier matrix, i.e. squeeze(freq.fourierspctrm(#,:,:))
Best wishes,
Jan-Mathijs
> On 8 Aug 2024, at 18:22, Sara Cinelli via fieldtrip <fieldtrip at science.ru.nl> wrote:
>
> Hello,
> I would like to ask how to reconstruct the potential at the electrodes from the output given by the function ft_sourceanalysis in which I used the model 'mne'. The output is the following: time, cfg, dim, inside, pos, unit, method, avg. Inside avg there are 2 fields: mom and pow. My intention was to have the same output of ft_dipolefitting, which reconstructs the channel potential and then calculates the residual variance (with the function rv).
> Thank you,
>
> Sara
> _______________________________________________
> fieldtrip mailing list
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C843d83fc3ed74e871abb08dcb847d020%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638587865795173167%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=8E1fRIG2e6Zujw2BPu9jzcTsP79GWXkCFa9Q6YZLcnc%3D&reserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C843d83fc3ed74e871abb08dcb847d020%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638587865795173167%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=Xe8hZFca%2BToHpm2P8CGAbDuIYxHDUZBBnI7UGqrNsRk%3D&reserved=0
More information about the fieldtrip
mailing list