-
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
read_raw_bids() messes up the channel order and therefore loading raw fails #1170
Comments
The BIDS names and channel order should take precedence, so renaming channels is the correct move. Channel orders in the sidecars and raw file also are allowed to differ IIRC ("should" be the same). Maybe we should adopt a 2-step procedure to avoid name collisions:
This should prevent the problem you're describing here. |
Just to clarify: this issue should only come up if the channel order in channels.tsv differs from the channel order in the raw file. |
I don't understand why any random names should be needed. Why not construct the full mapping from old names to new names and then call |
Ok sounds good I don't see why we would need to |
I don't fully understand the use case or what MNE-BIDS does in all cases, I just saw "reorder" in the title and "channel order" in your comment so figured it was relevant / I should include for completeness |
Ah ok! :) MNE-BIDS is only supposed to apply the channel names in the order they appear in |
Description of the problem
I can load my data using
mne.read_raw()
but not usingmne_bids.read_raw_bids()
. I get the following error:My
electrodes.tsv
file seems correct. When inspecting the code, it turns out that the order ofch_names_tsv
andraw.ch_names
is messed up. Not sure why it only happens for one specific file.If I change the lists using
sorted()
, it works fine. Should the code possibly be changed?Maybe it's the same issue as #1117 (I didn't look into the details)?
Steps to reproduce
Expected results
I would expect
mne_bids.read_raw_bids()
to load the data.Actual results
Additional information
The text was updated successfully, but these errors were encountered: