-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[draft] new reader for curry files, using curry-python-reader code #13176
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
base: main
Are you sure you want to change the base?
Conversation
mne/io/curry/curryreader.py
Outdated
@@ -0,0 +1,633 @@ | |||
# Authors: The MNE-Python contributors. | |||
# License: BSD-3-Clause | |||
# Copyright the MNE-Python contributors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this file the official reader? is this file copied from somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's copied from https://github.com/neuroscan/curry-python-reader
the false info you flagged was added by [autofix.ci]
further formatting changes were necessary to pacify pre-commit hook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you discussed this topic with a compumedics dev in #12855
they said they wont supply a pypi or conda version, but we are free to use the code.
the github repo has a BSD3 license applied, but they dont include any note in the file itself
Given that @CurryKaiser refused our offer to help them package up their reader for PyPI / conda-forge, I see two remaining options:
Personally I lean toward option 2. I say this because if we're going to try to support curry files, at a minimum we need to be able to fix bugs when they arise, and ideally we should be willing/able to incorporate new features that have high demand from our users ( |
hum... my first reaction is to push a version 0.1 of their package on pypi
and rely on this. Basically we maintain a fork and hope that the fork
changes are accepted upstream... it feels less hacky and they also have a
CI and some testing setup with test_data that I would not duplicate in
mne-python...
… Message ID: ***@***.***>
|
that indeed is less hacky than my approach to vendoring. I'd be OK with that outcome, though curious what @larsoner will think. |
I'm fine with that idea but it would be good to get some blessing/permission from them to do this |
xref to #12855 (comment) where I've asked for confirmation that Compumedics really doesn't want to be the packager and they're OK with us doing it. |
And nothing has changed, so all good from our side. Sorry we couldn't package it for you. And thank you for working on this! |
thanks @CurryKaiser ! ok, sounds like a plan.. I can start working on this again soon, if you give a go @agramfort @drammock @larsoner I guess the fork should live in the mne-tools org? I have the necessary rights to create it |
Yeah I think so |
I already made the fork |
ok, sounds like a plan.. I can start working on this again soon, if you
give a go @agramfort <https://github.com/agramfort> @drammock
<https://github.com/drammock> @larsoner <https://github.com/larsoner>Message
ID: ***@***.***>
+1
|
xref to mne-tools/curry-python-reader#1 |
i could need some guidance on 2 things:
a few other things to discuss:
|
p.s. and could you remind me how to switch off the CIs when pushing these early commits? |
Push commits with |
... for the cHPI stuff it's probably easiest to load a Neuromag raw FIF file with cHPI info and look at how the info is stored for example in For preload, since |
ok,
|
@CurryKaiser in another place you said you might be able to provide us with test files - could we perhaps get a small one with epoched recordings in it (format version shouldn't matter)? |
Could be that they were truncated, let me check. |
Ok, try these: |
thanks for the file @CurryKaiser |
@drammock @larsoner @agramfort currently related question: |
Yeah use |
see conda-forge PR: conda-forge/staged-recipes#29754 |
hi @larsoner @drammock - specific questions:
|
btw, the style issue says: |
Yeah I can look a bit deeper... before I do, what's the situation on The short version in case you want to think about if things are done correctly:
Is this how things work in this PR (and on main)?
Sure!
Seems reasonable to me
Why have an option to import as raw? To me this seems like a more general problem that we might want to have an Epochs method |
Only tangentially related... |
i can remove the option, no prob. |
the point was: its not straightforward to parse and split the string ;) a few options are:
|
yes sensor locations are also loaded in the legacy version. as i said, i reuse parts of this code. in the PR i do set the coordinate frames as intended (head for eeg, device for meg) and for eeg im generally quite confident everything is fine (including RPA, LPA and Nasion). |
@larsoner - |
For the device stuff, for now we could just put it all in [ ![]() It's a bit of a misnomer but I think it's a reasonable first step. We can always improve it later by splitting the string or whatever. Another option would be For M/EEG alignment, is there a good example or dataset with M/EEG Curry data I can use to check things? |
... this failure seems real: https://github.com/mne-tools/mne-python/actions/runs/16425669566/job/46415245479?pr=13176
|
this is the epoched file I recently asked you to merge into |
..that wouldnt solve the anonymisation issue, though. i could also just add a user-warning, if not empty? |
Maybe put it in For the testing dataset you change mne-python/mne/datasets/config.py Line 90 in bf57d9c
mne-python/mne/datasets/config.py Line 118 in bf57d9c
|
this one (from the official curryreader testing data): HPI.zip thinking about it, would be good to include this in our testing data. it can improve some other tests, too. it also a case that has additional HPI data that i cant really make much sense of - first thought it was cHPI, but not so sure anymore after what i read in the curryreader code |
Ahh okay the comment from 2 weeks ago I read as meaning you were going to add to test data, modify code, etc. and then I assumed you would ping for review in another comment. Looks like you modified the code but didn't ping for review until today. Most maintainers don't get notified when commits are made for PRs -- it's waaaay too noisy -- so I didn't realize you had pushed. I should be able to look soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before I look at the MEG data (hopefully Monday), noticed a lot of red in the tests that I figured I'd ask about now
], | ||
) | ||
@pytest.mark.parametrize("mock_dev_head_t", [True, False]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping existing tests would be touched/changed as little as possible... Can you explain why this test had to be removed? Or could it be put back and still work?
|
||
|
||
@testing.requires_testing_data | ||
@pytest.mark.parametrize( | ||
"fname", | ||
[ | ||
pytest.param(curry_dir / "test_bdf_stim_channel Curry 7.cef", id="7"), | ||
pytest.param(curry_dir / "test_bdf_stim_channel Curry 8.cdt.cef", id="8"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here (and below) ... why did this have to be removed?
@dominikwelke so this code, which uses
fails on ![]() So a couple of things are noticeable here. First, the helmet doesn't match the sensors. This is because the sensor defs are wrong:
This does not appear to be a Neuromag system I think (184 channels), so the Second, the
I haven't looked into what this means... but if there were 5 HPI coils, and they were defined in the head coordinate frame (5 points) and the MEG/device coordinate frame (same matched 5 points) then these can be used to get a proper |
hi all
as discussed in #13033 here a draft PR to use the official curry reader code.
in a first step i just use the reader as a module (only fixed formatting to force it past pre-commit).
it has some drawbacks (e.g. data is always loaded) and i did not implement all possible data yet (eg hpi, or epoched recordings) but in general it already works pretty well. tested it with all their example data, and one of my own recordings that didnt work in mne before.
it would be great to get some feedback how you want me to proceed with this @drammock @larsoner:
BACKGROUND:
the curry data reader currently cant handle all/newer curry files
plan is port code from the official curry reader into mne-python
for permission see #12855
closes #12795
closes #13033
closes #12855