Inverse Problem : Computing Kernel*DataFile

Hello,
The code bellow is from process_inverse_2018 .mat file.
I originally thought once inverse model is computed, the result of the kernel is sent to this function where in here source is computed by multipliying the kernel by the data at each point. However, I feel like this isn't the code that is computing because when I changed ResultsMat.ImageGridAmp output, the output of Display on cortex didnt change. I even added a line of a=3 on matlab to see if I can see the output on command line but I didnt.

Can you please tell me what is wrong and direct me to the correct code where Kernel*Measurment occures?

Also , what if instead of raw data we are looking at average spike, is there another code where kernel is multiplied by average spike ?

thank you for your helps

The piece of code you copied here is executed only when the option ComputeKernel is set to 1, which corresponds to the advanced minimum norm option “Full results”.

In most cases, ImagingKernel is multiplied with the data when the source file is loaded for display or computation.

Search the code for “ImagingKernel *” to see where else this variable is used (the tool “Find files” from Matlab - CTRL+SHIFT+F, with the option “include subfolders” is a good tool for this prupose).
You’ll find this: bst_memory.m (line 1957), in_bst.m (117) and in_bst_results (line 275)

1 Like

@Francois
Hello, I have consructed head model. I also obtained forward and inverse matrix,that is ImagingKernel and Gain, from OpenMEEG BEM and MN: EEG(Unconstr) in corresponding file, respectively. Now, I want to compute the activity on the cortext. Is ImagingKernel * EEGdata correct way to acqurie cortical electrical activity ? Moreover, If I want to compute scalp potential, Is ImagingKernel * EEGdata *Gian correct way to acqurie ? If it is correct, but the results is not equal to EEGdata ? Can you tell me the correct way if I am wrong?

Thank you for you helps.

I believe what you want is: Gain * ImagingKernel * EEGdata. However, this will not give exactly the EEGdata back, but hopefully something close if the data is clean.

Is ImagingKernel * EEGdata correct way to acqurie cortical electrical activity ?

Yes, see the code of the functions I indicated previously.

Is ImagingKernel * EEGdata *Gian correct way to acqurie ? If it is correct, but the results is not equal to EEGdata ?

The model does not explain all your EEG data. You can see the modeled data by right-clicking on the source file > Model evaluation > Simulate recordings.
The corresponding code:

Thanks very much. And I also appreciate the detailed code you provided.

Hello!
Could you explain or give articles why do we multiply by raw data when we make an invesre solution (MNE or sLORETA)?
How does the notion Regularization work?

Minimum norm: Baillet S, Mosher JC, Leahy RM
Electromagnetic brain mapping, IEEE SP MAG 2001.

dSPM: Dale AM, Liu AK, Fischl BR, Buckner RL, Belliveau JW, Lewine JD, Halgren E
Dynamic statistical parametric mapping: combining fMRI and MEG for high-resolution imaging of cortical activity. Neuron 2000 Apr, 26(1):55-67

sLORETA: Pascual-Marqui RD
Standardized low-resolution brain electromagnetic tomography (sLORETA): technical details, Methods Find Exp Clin Pharmacol 2002, 24 Suppl D:5-12