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

Add yasa.Hypnogram.as_events() example #191

Open
remrama opened this issue Dec 28, 2024 · 0 comments
Open

Add yasa.Hypnogram.as_events() example #191

remrama opened this issue Dec 28, 2024 · 0 comments
Assignees
Labels
enhancement 🚧 New feature or request

Comments

@remrama
Copy link
Collaborator

remrama commented Dec 28, 2024

The new yasa.Hypnogram class has a method .as_events() that complies with some of the MNE annotation norms and possibly BIDS event files.

It would be nice to have an example of this in the documentation, either in a notebook or a docstrings example.

One possibility is an example on how to add the events returned from hyp.as_events() to an MNE raw object with raw.set_annotations().

annotations = mne.Annotations(onset, duration, description)
raw.set_annotations(annotations)

See MNE events_from_annotations and annotations_from_events.

@remrama remrama self-assigned this Dec 28, 2024
@remrama remrama added the enhancement 🚧 New feature or request label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🚧 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant