Compute EEG sources with sLoreta

@Francois,
Here's the eLORETA code you asked for (attached).
I see that some changes were made on bst_inverse_linear_2028.m.
Hopefully none of those changes involved how the SNR, the noise regularization
parameter, and the whitening are done, as those are inter-related, and would affect this code if different
from what they should be. My advice for the future, is if it's not broken don't try to fix it..
I am attaching an m file that has only the eLORETA specific code for both fixed and free dipole
orientations.
It is assumed that you have whitened the lead field matrix and provided
a fix regularization parameter, but I hint in comments as to how to also use time-dependent SNR.
I have made no attempt to reconnect it with the larger program, but it should be clear
where the code should go (i.e., after you have whitened the lead field matrix and have computed a regularization parameter). The last line gives you the Kernel_eLORETA, which is what you are after and works just like the weighted minumum-L2-norm Kernel.
Note that for eLORETA the source covariance is diagonal but it's not a multiple of the identity matrix.
So some of the "new" edits that I did not introduce treat it as a scalar, and that is just not good, and it's incompatible with any method like eLORETA that does a bit more and actually learns a source a priori covariance that results in absolutely zero localization bias and real current density solutions (not arbitrary unit "activity").
Best,
Rey
eloreta_code_chunk.m (5.0 KB)