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 BrainVision export via pybv #10678

Closed
sappelhoff opened this issue May 26, 2022 · 6 comments · Fixed by #10681
Closed

Add BrainVision export via pybv #10678

sappelhoff opened this issue May 26, 2022 · 6 comments · Fixed by #10681
Labels

Comments

@sappelhoff
Copy link
Member

Just announcing that I plan to add export capabilities for BrainVision to the MNE-Python export suite. I thought we had discussed this in other issues already, but I can't find them or they have been closed.

I recently added a feature to pybv to write more complex events, so that mne.Annotations can now be properly written, see: bids-standard/pybv#86

In the future I'd also like to be able to export electrode coordinates ("channel locations"), but I think that can come as an add on slightly later: bids-standard/pybv#44

One feature apart from making this available to MNE-Python users would also be that we can refactor what we currently have in mne-bids: https://github.com/mne-tools/mne-bids/blob/fa7a94bb0ef03691aa881f39c90b23a7aa69a923/mne_bids/write.py#L963

Let me know if you have thoughts on this :-)

@sappelhoff sappelhoff added the ENH label May 26, 2022
@larsoner
Copy link
Member

Yes feel free! I think the idea is to have as much export code as possible live in the downstream lib (in this case, pybv), so that the code in MNE-Python is something simple like:

if ext in ('.vhdr', ...):
    pybv = _whatever_our_safe_importer_is('pybv')
    pybv.export_raw(raw)

and then you add pybv to the -testing requirements (and maybe also environment.yml and requirements.yml), and write one small test here in test_export.py or whatever we call it.

@sappelhoff
Copy link
Member Author

Sounds good to me! I'd then keep pybv._export_raw_mne (for example) a private function in pybv 👍

@sappelhoff
Copy link
Member Author

Is there a reason why export_evokeds_mff is in the public API, instead of being private and users getting to it via export_evoked?

@larsoner
Copy link
Member

Yes because it has extra options, see discussion in and around #9406 (comment)

@sappelhoff
Copy link
Member Author

Thanks, I was wondering about that, because export_raw also has extra options that are only used for EDF 🤔 is that simply an inconsistency due to the way the module recently "grew"?

@larsoner
Copy link
Member

Can't recall if it was intentional or not, but it would be nice to be consistent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants