mne-python
mne-python copied to clipboard
updated eeglab.py to account for SET files that contain trials but no…
Reference issue
No issue
What does this implement/fix?
This pull request implements a robust method for handling EEGLAB files that contain epoched data but lack explicit event information. Specifically:
- It introduces a new function
generate_boundary_eventsthat creates synthetic boundary events for epoched data without events. - It modifies the existing
create_events_from_eeglabfunction to use this new method when appropriate. - It ensures that the generated events array is always a NumPy array of 64-bit integers, resolving compatibility issues with MNE functions.
These changes allow MNE to properly process EEGLAB files that have been epoched but have lost their event information during preprocessing or export. This is particularly useful for researchers working with legacy datasets or those using EEGLAB processing pipelines that may not preserve event information in all cases.
Additional information
- This implementation assumes that epochs in the data are contiguous. If there are known gaps between epochs in certain datasets, additional parameters may need to be added to the
generate_boundary_eventsfunction to account for this. - The boundary events are given a unique event code (1 in this implementation). Users should be advised to check that this does not conflict with existing event codes in their datasets.
- Extensive testing has been done with various EEGLAB files, including those with and without event information, to ensure backward compatibility and correct handling of different data structures.
- Documentation has been updated to reflect these changes and provide guidance on using these functions with problematic datasets.
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴