eeglab
eeglab copied to clipboard
spherical interpolation
Makoto: Maruti pointed me to this issue--EEGLAB's electrode interpolation seems to follow Perrin et al. (1989), but there is an update on this topic in 2015 by Kang et al. (2015). I attached both papers here for your reference.
Question to Arno: Does eeg_interp() use the regularization parameter lambda? I don't think it is discussed in Perrin et al., but Kang et al. says it was introduced by Perrin et al. I'm a bit confused.
Anyway, it seems if we use computationally more expensive solutions (lower m, higher n) than those originally suggested by Perrin et al. (1989), it seems to produce better results in terms of the impact on the cross-electrode phase analyses. papers.zip
Thanks Makoto,
Question to Arno: Does eeg_interp() use the regularization parameter lambda? I don't think it is discussed in Perrin et al., but Kang et al. says it was introduced by Perrin et al. I'm a bit confused.
I have looked and I do not think we use the parameter lambda. It is in Perrin et al in the comments at the end.
The current code in eeg_interp line 341 is
C = pinv([Gelec;ones(1,length(Gelec))]) * values;
Could be changed to
C = pinv([Gelec+eye(size(Gelec))*lambda;ones(1,length(Gelec))]) * values;
Since lambda is a "is small positive value added to the diagonal in the matrix solutions of (1) to regularize"
We could change the default to m=3 and n=50, add lambda, and even make the number publicly accessible to users in the interface.
There is another function sphericalSplineInterpolate in clean_rawdata that uses n=200; m=4 and lambda = 1e-5 Kay has also worked on a minor modification.
Attaching a white paper of an observation I made more than 15 years ago. We actually do not use the standard spherical interpolation in eeg_interp. We use a different method to compute the difference in angle which was in the function prior to 2000 (probably implemented by Colin Humphries), and our solution is apparently more robust to interpolation of outer boundaries. I asked Jason to look at the math, but he was as puzzled as I am. This would be a great student project. I still have the testing scripts.
Thanks Arno. This is a perfect explanation. Maruti must be very impressed! It's also good to know that you had that white paper from 2007, I appreciate your deep thought and insight on this issue.
According to Kang et al. (2015), m=3, n=50, lambda=10^-8 is recommended. I think it is a great idea to update eeg_interp() based on Kang et al. (2015). clean_rawdata's n=200 should be certainly better but probably an overkill.
The code we used in in Prep was a modification of an implementation by Christian Kothe. We did a lot of testing to evaluate accuracy for a variety of headset configurations before we settled on the parameters we used. We were not overly concerned about execution time in contrast to better accuracy.
The original code Christian used is from Jason D.R. Farquhar @.***) apparently.
We were not overly concerned about execution time in contrast to better accuracy.
Yes, I totally agree.
Makoto
On Wed, Jun 15, 2022 at 12:40 PM Arnaud Delorme @.***> wrote:
The original code Christian used is from Jason D.R. Farquhar @.***) apparently.
— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/sccn/eeglab/issues/500*issuecomment-1156853224__;Iw!!Mih3wA!HSac0LXB4z2IGV8q9SDbxwliW-lsU9efwcu8o5_ASiWW_vBZcqDuG33PFLPZYJDZoV_av5MHfF3qtmmNkAgeMaU2QbI$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AK7GVNLLGIDLIJBJVWEWQTLVPIWRHANCNFSM5Y4D23PA__;!!Mih3wA!HSac0LXB4z2IGV8q9SDbxwliW-lsU9efwcu8o5_ASiWW_vBZcqDuG33PFLPZYJDZoV_av5MHfF3qtmmNkAgeuxuxZWI$ . You are receiving this because you commented.Message ID: @.***>
Also, since you are able to dig into this and have expertise, I was wondering what you think about this article here, that seems to suggest a neurophysiological approach to interpolation rather than mathematical approaches like SSI.
Yup, I was thinking about the same idea. The accuracy depends on the forward model though. As Nunez and Srinivasan (2006) argues, we don't know what is a good forward model because tissue conductivity is poorly known. Thicker the skull, more resistance--intuitively it should work like that, right? But you get a worse result there.
On Fri, Jun 17, 2022 at 7:17 AM marutimishra @.***> wrote:
Also, since you are able to dig into this and have expertise, I was wondering what you think about this article here https://urldefense.com/v3/__https://link.springer.com/article/10.1007/s10548-021-00844-2__;!!Mih3wA!CblAPWcBgdo-khOBPLISLYeTK5Eb8o2NDoE-rw1ht2GOmitiKG47QlP61P2EfLVMKO6nYfkMwRgvDvGlEp5CcUMNZdU$, that seems to suggest a neurophysiological approach to interpolation rather than mathematical approaches like SSI.
— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/sccn/eeglab/issues/500*issuecomment-1158917770__;Iw!!Mih3wA!CblAPWcBgdo-khOBPLISLYeTK5Eb8o2NDoE-rw1ht2GOmitiKG47QlP61P2EfLVMKO6nYfkMwRgvDvGlEp5CpXHDXf8$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AK7GVNKFJQI34LOY2RGXGSTVPSCITANCNFSM5Y4D23PA__;!!Mih3wA!CblAPWcBgdo-khOBPLISLYeTK5Eb8o2NDoE-rw1ht2GOmitiKG47QlP61P2EfLVMKO6nYfkMwRgvDvGlEp5CtcmKcRo$ . You are receiving this because you commented.Message ID: @.***>
Ah, I see. make sense. I was thinking if one can use CNNs to interpolate? and I did a brief search and found this article that exactly does that https://www.sciencedirect.com/science/article/pii/S0165027021000613 I guess it would take a long time for this to be really used. what are your thoughts?
You can use any algorithm for interpolation, and I do believe that each approach has its own strength. But to compare these strengths across methods not only requires a careful designing of simulation studies but also would be challenged by variations of scenarios. A part of ground-truth signal that is specific to the location of the electrode definitely includes individual differences of brain anatomy including functional mappings. Using a population-level knowledge to interpolate individual anatomical/functional differences has a fundamental limitation from the beginning. So I don't have any strong opinion as to which method should be used here. I need to see more empirical and simulation test results to form my own recommendation.
On Sat, Jun 18, 2022 at 5:45 PM marutimishra @.***> wrote:
Ah, I see. make sense. I was thinking if one can use CNNs to interpolate? and I did a brief search and found this article that exactly does that https://www.sciencedirect.com/science/article/pii/S0165027021000613 https://urldefense.com/v3/__https://www.sciencedirect.com/science/article/pii/S0165027021000613__;!!Mih3wA!GtbSSvzsE4GyRs63PQP8jsF4VCeh2q7UDpbro29KXUGZpMENfvQs-GBimahsyaSVbjOEd0MB_u5VnXPf0tViWoFmEkA$ what are your thoughts?
— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/sccn/eeglab/issues/500*issuecomment-1159590317__;Iw!!Mih3wA!GtbSSvzsE4GyRs63PQP8jsF4VCeh2q7UDpbro29KXUGZpMENfvQs-GBimahsyaSVbjOEd0MB_u5VnXPf0tVi6Agtmac$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AK7GVNJUR7BSPKCWVXVIOLLVPZURHANCNFSM5Y4D23PA__;!!Mih3wA!GtbSSvzsE4GyRs63PQP8jsF4VCeh2q7UDpbro29KXUGZpMENfvQs-GBimahsyaSVbjOEd0MB_u5VnXPf0tVi2pD9WxM$ . You are receiving this because you commented.Message ID: @.***>
Is there any modification we should make to the function?
It depends on whether EEGLAB developer wants to implement updated/'better' channel interpolation to EEGLAB or not. It's not that I am requesting the fix/change. The current algorithm does not do any bad.
Makoto
On Wed, Oct 12, 2022 at 10:15 PM Arnaud Delorme @.***> wrote:
Is there any modification we should make to the function?
— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/sccn/eeglab/issues/500*issuecomment-1277041528__;Iw!!Mih3wA!Fz1yUNDZ9O9OpzjfTM4Ht93YEgelpAdNZZMFS4gmdTYrBWYZ8NCjGQotAtsh_hJ2-VDcDcnvFpUXZga7e29Mlk8x5K8$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AK7GVNJEGPMOIA3QZCWQTHLWC6LHFANCNFSM5Y4D23PA__;!!Mih3wA!Fz1yUNDZ9O9OpzjfTM4Ht93YEgelpAdNZZMFS4gmdTYrBWYZ8NCjGQotAtsh_hJ2-VDcDcnvFpUXZga7e29MfAPAMAQ$ . You are receiving this because you commented.Message ID: @.***>
OK, I have added an option to use the Kang method and also use custom values.