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

Read MIT Annotations #13030

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

withmywoessner
Copy link
Contributor

Reference issue (if any)

Fixes #12660.

What does this implement/fix?

Adds the ability to read WaveForm Database (wfdb) annotations using the already existing library. My proposed API adds two new parameters to mne.read_annotations() fmt and suffix. fmt and suffix are used in combination to read an annotation whose file suffix is not strictly defined.
If mne.annotations(fmt='wfbd'...) is called with no suffix, then the function will check to see if the suffix matches a default list of suffixes.
If mne.annotations(fmt='wfbd', suffix='seizures'...) is called, then the function will bypass the default list of suffixes.

@larsoner larsoner added this to the 1.10 milestone Dec 16, 2024
@withmywoessner
Copy link
Contributor Author

Hi @drammock and @larsoner, I know you mentioned reading the annotations using a predefined list of suffixes in #12660, but I thought it would be useful to also allow for the option to read files using any suffix. Let me know if you prefer otherwise.

Co-authored-by: Eric Larson <[email protected]>
@withmywoessner
Copy link
Contributor Author

withmywoessner commented Dec 16, 2024

Where is the best place to list the suffix mappings @larsoner? The WFBD library mentions a few that I would also like to include besides .seisuzes.

@larsoner
Copy link
Member

Where is the best place to list the suffix mappings @larsoner?

Looks like the mapping currently lives here

readers = {

@withmywoessner
Copy link
Contributor Author

Okay, everything should be good then. Should I add tests and include a citation for the library somewhere? @larsoner

@larsoner
Copy link
Member

larsoner commented Jan 7, 2025

Should I add tests and include a citation for the library somewhere?

Sure, it would be good to add it to environment.yml (and to conda-forge if it's not already on there) and pyproject.toml in the full deps. Then we'll also want to add it to mne-installers around https://github.com/mne-tools/mne-installers/blob/a18bf50444a0e258b7d09c0ce14eab1ec8d948a9/recipes/mne-python/construct.yaml#L92

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

Successfully merging this pull request may close these issues.

Add reader for annotations in MIT format
2 participants