Read MIT Annotations
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.
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.
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.
Where is the best place to list the suffix mappings @larsoner?
Looks like the mapping currently lives here https://github.com/mne-tools/mne-python/blob/b38385ef90d0fd8214d54b15c5fd91333c3bc032/mne/annotations.py#L1203
Okay, everything should be good then. Should I add tests and include a citation for the library somewhere? @larsoner
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
Would you mind cutting a new release for the testing data? @larsoner https://github.com/mne-tools/mne-testing-data/pull/118
I used the data from https://physionet.org/content/chbmit/1.0.0/
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
Added a PR here: https://github.com/mne-tools/mne-installers/pull/325
https://github.com/mne-tools/mne-testing-data/releases/tag/0.157
Can anyone help me figure out why the new test file is not being recognized by pytest? Is it because it has two extensions? When I read it myself it works fine.
Can anyone help me figure out why the new test file is not being recognized by pytest? Is it because it has two extensions? When I read it myself it works fine.
You need to tell the CIs (via MNE-Python) to actually use the newest version of the testing dataset. See:
https://github.com/mne-tools/mne-python/pull/12800/files
I see, thank you. The testing data PR was merged before I updated the version.txt file. Should I make a new PR or ask for the last one to be reverted?
Whoops I missed that! Will fix both and cut a new version
Done... use 0.158 :facepalm:
@withmywoessner do you have time to come back to this or would it help if someone pushed commits?
Yes, I can do this! Sorry about that! I have been dealing with NIH nonsense this year.