You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I downloaded a matlab toolbox to analyse eeg data, additionally to eeglab. This toolbox is used to analyse eeg data from people who experience pain. This toolbox is based on EEG lab and I am using it with their demo data. In this code pop_chanedit fails to add the reference channel, in the EEGtemp structure that is returned, chanlocs.labels are all 'E', but in the original EEGtemp, the labels in chanlocs are correct. I could track the problem until eeg_checkset in line 1081. At that point, the field labels is correct and a field called label has appeared and is empty. Then inside eeg_checkset, line 272, the field labels is interchanged with the field label, which is empty and messes up the labels field.
The channel to insert is A1 (the reference). In the main script of the analysis toolbox it is written:
without knowing very well what I am doing (I am new to eeglab), I added in the main script:
for ichan=1:length(EEGtemp.chanlocs)
EEGtemp.chanlocs(ichan).label=EEGtemp.chanlocs(ichan).labels;
end
between steps 1 and 2. In this case, the updated EEGtemp after pop_chanedit, has the correct chanlocs.labels, but the reference channel is not added to the rest.
Expected behavior:
I expect that the reference channels is added without changing any field of the other channels, apart from setref (I suppose)
Actual behavior:
The labels in chanlocs are messed up, all are the same and it is 'E'. If I write the additional code, the labels are fine (because eeg_checkset cannot mess them up, but the reference channel is not added.
Versions
OS version
[14.6.1]
Matlab version
[2023b]
EEGLAB version
[2024..2]
The text was updated successfully, but these errors were encountered:
Thanks for reporting. EEG.chanlocs(x).label is not supposed to be a field in EEG.chanlocs. I am not sure why this section of the code of eeg_checkset is executed on your side. It is meant for future versions of EEGLAB where EEG.chanlocs.labels will be renamed EEG.chanlocs.label (without s), because the s should have never been there in the first place. However, for the current version, it should have no incidence.
Thank you for your answer... what do you suggest me? remove eeg_checkset in pop_chanedit? Or is this not possible? Sorry, I am new to eeglab and I do not know how to proceed properly. Alternatively, I can set the reference channel by "hand" instead of using pop_chanedit, if you think this will not cause a problem... Sorry for insisting, I am a bit clueless
Description
I downloaded a matlab toolbox to analyse eeg data, additionally to eeglab. This toolbox is used to analyse eeg data from people who experience pain. This toolbox is based on EEG lab and I am using it with their demo data. In this code pop_chanedit fails to add the reference channel, in the EEGtemp structure that is returned, chanlocs.labels are all 'E', but in the original EEGtemp, the labels in chanlocs are correct. I could track the problem until eeg_checkset in line 1081. At that point, the field labels is correct and a field called label has appeared and is empty. Then inside eeg_checkset, line 272, the field labels is interchanged with the field label, which is empty and messes up the labels field.
The channel to insert is A1 (the reference). In the main script of the analysis toolbox it is written:
Steps to Reproduce
'changefield', {EEGtemp.nbchan+1,'labels',ALLEEG(iRec).BIDS.tInfo.EEGReference},...
'changefield', {EEGtemp.nbchan+1, 'X', params.RefCoord.X}, ...
'changefield', {EEGtemp.nbchan+1, 'Y', params.RefCoord.Y}, ...
'changefield', {EEGtemp.nbchan+1, 'Z', params.RefCoord.Z},...
'setref',{['1:' num2str(EEGtemp.nbchan)],ALLEEG(iRec).BIDS.tInfo.EEGReference});
without knowing very well what I am doing (I am new to eeglab), I added in the main script:
for ichan=1:length(EEGtemp.chanlocs)
EEGtemp.chanlocs(ichan).label=EEGtemp.chanlocs(ichan).labels;
end
between steps 1 and 2. In this case, the updated EEGtemp after pop_chanedit, has the correct chanlocs.labels, but the reference channel is not added to the rest.
Expected behavior:
I expect that the reference channels is added without changing any field of the other channels, apart from setref (I suppose)
Actual behavior:
The labels in chanlocs are messed up, all are the same and it is 'E'. If I write the additional code, the labels are fine (because eeg_checkset cannot mess them up, but the reference channel is not added.
Versions
The text was updated successfully, but these errors were encountered: