mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

updated eeglab.py to account for SET files that contain trials but no…

Open drpedapati opened this issue 1 year ago • 1 comments

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:

  1. It introduces a new function generate_boundary_events that creates synthetic boundary events for epoched data without events.
  2. It modifies the existing create_events_from_eeglab function to use this new method when appropriate.
  3. 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_events function 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.

drpedapati avatar Jul 09 '24 18:07 drpedapati

Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴

welcome[bot] avatar Jul 09 '24 18:07 welcome[bot]