-
Notifications
You must be signed in to change notification settings - Fork 88
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() respects info['bads'], but it really shouldn't #498
Comments
Agreed
|
but isn't the |
Yes. But if you want to mark channels as bad in BIDS, you will have to bite the bullet and add this column :) |
yes, but then we have a lossy reader, it does not get all the information that is there in the file |
I think many Elekta users may feel it is sufficient to make the dataset pass the validator but will be surprised that the bad channels are not read in. We shouldn't require the users to know all the BIDS standard by heart and know where to put things. |
We already do, e.g. regarding events… |
MNE-BIDS writes the bads to |
Following your suggestion would also have implications on #491 – currently I only update the sidecar, but you're suggesting we write an entire updated raw file / info dict to disk as well. I mean, we could do that, but it doesn't seem very elegant… |
I'm really just super concerned about keeping everything in sync if we start allowing multiple places to store the same info. Esp since one of them (info['bads']) is lossy in the sense that it cannot hold a status_description. |
now the question is do you want only MNE-BIDS written files to be readable in MNE-BIDS? I understand the issue of keeping things in sync. I am just saying we need a clear policy that is documented and adhere to it. What you're suggesting means that everything in |
My understanding so far was that our policy in MNE-BIDS is that if we have BIDS metadata for an entity, it will always take precedence over anything in the raw data / raw.info for that entity. Now when we're looking at |
yeah, I understand. But does taking precedence mean ignoring everything in |
This. However we seem to have different views on what a missing |
I also think this highlights that the status columnn should be REQUIRED instead of OPTIONAL… |
Yes :) I think we now have a common understanding! Just need to figure out the way forward that everyone agrees with. agree, the use of OPTIONAL vs RECOMMENDED vs REQUIRED is very much abused in BIDS |
(btw intuitively I would have NO clue whatsoever what the difference between "optional" and "recommended" would be. This almost seems to imply that there are options which are totally useless, bc otherwise they would be recommended…) |
I believe there were murmurs of throwing warnings with "recommended" in the validator. There might be an open issue? But not sure if it was ever taken care of. Intuitively, recommended is something that's probably missing because of the recording system you are using but if it's there, you really should put that info in. |
Let's bring @sappelhoff in here 😅 |
agreed
to me a missing column communicates that all row entries would be
but labelling channels as "good" or "bad" is a subjective process (unless a clearly objective policy is documented, preferably in the form of a reproducible algorithm), and there are certainly cases where people want to share data, but not their judgment of channel status --> for example because they didn't check every channel. In those cases, a REQUIRED status column would just be
see bids-standard/bids-specification#563 --> OPTIONAL in BIDS is often more like "RECOMMENDED under condition X, but not condition Y", rather than "truly optional".
that would certainly be reasonable for many of the recommendations. But we have too few contributors who are interested in making the validator strong. I am already very thankful to @adam2392 for starting to make a few PRs and I think we (as MNE-BIDS team) contribute a lot to the validator (and the spec) by pointing out flaws, inconsistencies, and missing coverage. We're at the front line ... so to say. |
Ok so… now, what should be the behavior if we encounter both, |
warn the user about the inconsistency and explicitly use the BIDS information |
* Grant channels.tsv sole authority over Good & Bad Closes #498 * New approach based on discussion * Fix * Update tests * Update changelog * Fix comment * Remove line
based on thinking in #495 I believe mismatch should be a validator error. See for example what they do with niftis |
For the record: I agree with Mainak on this, but the validator is not "there yet" and until then we need to be pragmatic, so I stay with my earlier recommendation |
sounds good, but the writing API in #491 might introduce these kinds of inconsistencies. |
No, it actually does away with it :) I've designed it such that (un)marking channels as "bad" will alter both, |
ahhh, wonderful! |
Describe the bug
While working in #491 I think I've discovered a bug in
_handle_channels_reading()
, which is used byread_raw_bids()
. Specifically, when reading data and populating the list of "bads", MNE-BIDS currently merges the information from_channels.tsv
andinfo['bads']
in the data file. I think this is not correct, and only_channels.tsv
should be honored.mne-bids/mne_bids/read.py
Lines 259 to 263 in 8eec738
Steps to reproduce
Checkout
hoechenberger:mark-bads
(the branch from #491). Run:Expected results
Actual results
Additional information
Looking into
sub-01_ses-01_task-audiovisual_run-01_channels.tsv
, it's clear that it's being updated correctly:The text was updated successfully, but these errors were encountered: