-
Notifications
You must be signed in to change notification settings - Fork 90
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
include OPM channels as megmag under .pick/get_coil_types() #1222
Conversation
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴🏽♂️ |
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1222 +/- ##
==========================================
- Coverage 97.61% 97.45% -0.17%
==========================================
Files 40 40
Lines 8685 8685
==========================================
- Hits 8478 8464 -14
- Misses 207 221 +14 ☔ View full report in Codecov by Sentry. |
Hi there, thanks for the PR. I am not sure whether we should include this here before OPM has been "properly" included in BIDS: bids-standard/bids-specification#1676 any other opinions? |
I think we should enable the specific coil type for now so people can share their data ... of course, sharing helmet designs etc should also be included in the specification but we should not wait for the specification to be updated. You can imagine updating |
Hi @AmaiaBA I think I now agree with Mainak and think there is little harm in allowing mne-bids to produce experimental/BIDSish OPM datasets for now, so I'd be happy to merge this PR, pending these items:
See the "instructions-for-first-time-contributors" section in https://github.com/mne-tools/mne-bids/blob/main/CONTRIBUTING.md#instructions-for-first-time-contributors |
@AmaiaBA I just realized we never finished this. All we really need are a changelog entry and your name in the authors list -- the steps are described here: #1222 (comment) do you have time to complete this soon? |
hey I thought I had added the info you had requested, but maybe I did not commit them at the time... sorry!! It should be done now! |
hey @AmaiaBA
I don't really see any changes -- did you forget to |
Please note that you would also have to For simplicity, you could also tell me the following in a comment:
|
I did forget to git push... I am so sorry. I did git pull/git push now, but please let me know if you can not see it? just in case, here is the info: |
Marking for merge, thanks @AmaiaBA |
🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪 |
PR Description
Description:
This pull request addresses an issue encountered when using the write_raw_bids() command for OPM (Optically Pumped Magnetometer) data. The problem arises in the _channels_tsv() function, which throws a KeyError when attempting to access a key in the map_chs dictionary.
Error Details:
Issue Explanation:
The error occurs because the key _channel_type is not present in the map_chs dictionary. Specifically, when using any of the supported channel types for OPMs, _channel_type is set to 'mag' instead of 'megmag'. This discrepancy is due to the fact that get_coil_types() under mne_bids/pick.py does not include OPM channels.
Solution:
To resolve this issue, I expanded the list of supported OPM channels in get_coil_types():
This modification ensures that OPM channels are properly accounted for in _channel_type when using write_raw_bids().
Merge checklist
Maintainer, please confirm the following before merging.
If applicable: