Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Your lead-field matrix has a # of columns that does not correspond to the # of source vertices #57

Open
HeroDev67 opened this issue Apr 26, 2019 · 5 comments

Comments

@HeroDev67
Copy link

I am trying to run BCILAB with the following outlines given here

https://docs.google.com/document/d/1iTGj23C5uPW85g4JPDc9l5BTDuKnTvp90y2oCT5JSiY/edit?usp=sharing

As the title suggested it gives me an error while calibrating the model

“Your lead-field matrix has a # of columns that does not correspond to the # of source vertices."

I have tried to debug the problem and reached to the source of the problem

in flt_sourceLocalize.m the struct state has the fields :

state =

struct with fields:

  leadFieldMatrix: [343×3740 double]
laplacianOperator: [3740×3740 double]
        rmIndices: [1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880]
        nVertices: 3751
        nChannels: 64

The error occurs because number of columns leadFieldMatrix doesn't equal to nVertices

What should I do to make them equal ?

@elianasantos
Copy link

I have that problem too. I try to create a headmodel (EEGLAB) to data but that not solve the problem.

@aojeda
Copy link

aojeda commented May 25, 2019

It's been a while since I work on this code, and having so many layers wrapped around the core function makes it difficult for me to assess the ultimate cause of the problem. That is one thing, the other thing is that I see that in this repo, the code that implements LORETA, sometimes may yield a suboptimal source estimate because, depending on how it is called by the upper level wrapper, it may use an optimization procedure to calculate the regularization parameters that is wrong, to be totally fair, it is not that it is wrong but that it is prone to get trapped in a local minima (which is not the same but nevertheless gets you the wrong answer). I remember that we fixed that problem in some version of BCILAB, but it seems that it didn't make it to the master branch.

If you are using Beamforming then what I said about LORETA does not affect you.

In my opinion, if you are willing to write a little bit of code, you are better off implementing a clean source localization function, it's not that difficult. I can help you with that if you specify how you will use such function, e.g., size of EEG data in, montage, etc.

Hope that helps,
A

@elianasantos
Copy link

I need to analyse EEG signals with a headmodel for each subject (co-register). I'm study motor imagery to improve tasks classification. The signal was record with subjects perform left/right hand motor imagery movement. The MATLAB structure of the EEG (1st to 64th channel) and EMG (65th to 68th channel) data (“∗.mat”) for each subject is following: imagery left: 100 or 120 trials of left hand MI and imagery right: 100 or 120 trials of right hand MI. I'd like to write a code to use BCILAB.

thanks!

@HeroDev67
Copy link
Author

It's been a while since I work on this code, and having so many layers wrapped around the core function makes it difficult for me to assess the ultimate cause of the problem. That is one thing, the other thing is that I see that in this repo, the code that implements LORETA, sometimes may yield a suboptimal source estimate because, depending on how it is called by the upper level wrapper, it may use an optimization procedure to calculate the regularization parameters that is wrong, to be totally fair, it is not that it is wrong but that it is prone to get trapped in a local minima (which is not the same but nevertheless gets you the wrong answer). I remember that we fixed that problem in some version of BCILAB, but it seems that it didn't make it to the master branch.

If you are using Beamforming then what I said about LORETA does not affect you.

In my opinion, if you are willing to write a little bit of code, you are better off implementing a clean source localization function, it's not that difficult. I can help you with that if you specify how you will use such function, e.g., size of EEG data in, montage, etc.

Hope that helps,
A

I think the problem in SourceLocalization code .. when I run it without enabling it, it runs perfect.

@elianasantos
Copy link

Sorry, i don't understand. Could you explain again with more detail? I am new in matlab and bcilab. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants