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

Binlister #200

Open
pb865 opened this issue Dec 11, 2024 · 3 comments
Open

Binlister #200

pb865 opened this issue Dec 11, 2024 · 3 comments

Comments

@pb865
Copy link

pb865 commented Dec 11, 2024

This isn't a bug, but a question about Binlister that I can't find an answer to.

In a set of data I have, the event codes are off by 30ms because of a lag that wasn't accounted for. I need to communicate to EEGlab that epochs should be time-locked to the stimulus code onset + 30ms, rather than the marker position alone. How would I write this in a binlitser file? Is this possible?

Thanks!

@Kwinsler
Copy link

It sounds like the best approach would be to just shift the event codes in your data to account for the lag. There is a function to do this in ERPLAB. Using the classic GUI, it can be found under ERPLAB > Preprocess EEG > Shift Event Codes. Using ERPLAB studio there is a panel to do this in the EEG tab. In a script this can be done with the pop_erplabShiftEventCodes function. This would be a way to use that function to shift all event codes to account for a 30ms lag:

EEG = pop_erplabShiftEventCodes( EEG , 'DisplayEEG', 0, 'DisplayFeedback', 'both', 'Eventcodes', 1:255, 'Rounding', 'earlier', 'Timeshift', 30 );

@pb865
Copy link
Author

pb865 commented Dec 11, 2024

I ended up adjusting the event latency pre-epoching instead (not sure why I didn't think of this first):

% Adjust event latency
    for iEvent=1:length(EEG.event)
     EEG.event(iEvent).latency = EEG.event(iEvent).latency + 30;
     end
    [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); % Store dataset

I will leave this open in case there is another way to do this via Binlister or other functions that could also be a solution.

@pb865
Copy link
Author

pb865 commented Dec 11, 2024

It sounds like the best approach would be to just shift the event codes in your data to account for the lag. There is a function to do this in ERPLAB. Using the classic GUI, it can be found under ERPLAB > Preprocess EEG > Shift Event Codes. Using ERPLAB studio there is a panel to do this in the EEG tab. In a script this can be done with the pop_erplabShiftEventCodes function. This would be a way to use that function to shift all event codes to account for a 30ms lag:

EEG = pop_erplabShiftEventCodes( EEG , 'DisplayEEG', 0, 'DisplayFeedback', 'both', 'Eventcodes', 1:255, 'Rounding', 'earlier', 'Timeshift', 30 );

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

2 participants