-
Notifications
You must be signed in to change notification settings - Fork 92
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
iEEGCoordinateSystemDescription is not being written correctly #677
Comments
Are you sure that it's not supported? Not even after the recent PRs to make any "standard coordinate system" acceptable? (see: https://bids-specification.readthedocs.io/en/latest/99-appendices/08-coordinate-systems.html#standard-template-identifiers)
I actually think the filename should be EDIT: found the corresponding validator issue: https://github.com/bids-standard/bids-validator/issues/743 |
for posterity, these are the problematic lines: mne-bids/mne_bids/tests/test_write.py Lines 2178 to 2180 in d65b8ca
mne-bids/mne_bids/tests/test_write.py Lines 2204 to 2206 in d65b8ca
mne-bids/mne_bids/tests/test_write.py Lines 2274 to 2286 in d65b8ca
|
The problem goes even deeper ... although we didn't have an issue with that so far, it's a ticking bomb: Look at these lines: Lines 174 to 189 in d65b8ca
Click details, which will show you that reversing a dict with duplicate values leads to data loss:
basically, having several values |
Describe the bug
In my testing of #675 I was adding tests for
iEEGCoordinateSystemDescription
that we add to thecoordsystem.json
files. However, I noticed a bug that writes the description as'n/a'
.Steps to reproduce
In
test_write.py::test_coordsystem_json
, one can comment out the lines asserting what the CoordinateSystemDescriptions for iEEG should be and you will see that the tests fail.Expected results
In order to overcome this, perhaps it's best to briefly summarize how we dealt with iEEG coordinate frames. There exist coordinate frames represented in three different spaces: i) MNE, ii) filename and iii) BIDS.
For example, in MNE, we'll represent "FreeSurfer" coordsystem as
'fs_tal'
. Since this isn't yet a supported coordinate system in BIDS, in BIDs, it would be represented as'Other'
. In the filename, then this would be encoded asspace-fs
(note that we get rid of the underscore else it wouldn't be BIDS-compliant). Tbh this is quite confusing and unfortunate, but no way I see around it rn.Possible Solutions
This is probably a mne-bidsv0.8+ problem, since it doesn't really have a huge impact.
Possibly, a way for tackling this would be to refactor how
coordsystem.json
files are written, and keep track of a "MNE-coord-system" and "BIDS-coord-system" better, so they can be handled correctly indig.py::_coordsystem_json
.Additional information
The text was updated successfully, but these errors were encountered: