Skip to content
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

MRG: Handle sidecar <> raw disparities in channels #823

Merged
merged 8 commits into from
Jul 7, 2021

Conversation

hoechenberger
Copy link
Member

@hoechenberger hoechenberger commented Jul 2, 2021

@agramfort feel free to take over, this seems to fix your problem

Merge checklist

Maintainer, please confirm the following before merging:

  • All comments resolved
  • This is not your own PR
  • All CIs are happy
  • PR title starts with [MRG]
  • whats_new.rst is updated
  • PR description includes phrase "closes <#issue-number>"

Copy link
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx !

you plan to add a test @hoechenberger ?

@hoechenberger
Copy link
Member Author

If you think this is good, I can add a test!

@sappelhoff WDYT? Issue was that we had data with channels listed in the sidecar, which were not present in the raw. (HPI channels I believe. One could argue that these should be specified differently then -- which BIDS readily allows -- however we still have problematic datasets out in the wild we'll have to deal with...)

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a good approach to me and I like the warnings. 👍

@hoechenberger hoechenberger changed the title WIP: Handle sidecar <> raw disparities in channels MRG: Handle sidecar <> raw disparities in channels Jul 6, 2021
@hoechenberger
Copy link
Member Author

@sappelhoff @agramfort I've added tests, good to go from my end

@hoechenberger
Copy link
Member Author

the KIT test fails because after writing, channels.tsv doesn't list STI 014, but this channel is still included in the raw data (or, rather, synthesized by MNE-Python upon file reading, right?)

How shall we deal with this?

@hoechenberger
Copy link
Member Author

Related:
#51

@sappelhoff
Copy link
Member

synthesized by MNE-Python upon file reading, right?

I am not 100% sure, but I thought that we wanted to stop synthesizing stim channels in MNE-Python🤔 or was that only for some particular cases (e.g., for EEG only data)?

I think it'd be good to ignore any channels that MNE-Python synthesizes ... or stop it from automatically synthesizing them in the first place.

@hoechenberger
Copy link
Member Author

@agramfort any insights on this one?

@hoechenberger
Copy link
Member Author

My personal opinion is that since all events should be listed in the sidecar, MNE-BIDS could simply drop STI 014 after reading the file …

@sappelhoff
Copy link
Member

My personal opinion is that since all events should be listed in the sidecar, MNE-BIDS could simply drop STI 014 after reading the file …

Sounds reasonable to me. If it's synthesized by MNE during reading, we wouldn't even have to log information about it. Else, an info/warning may be good.

@hoechenberger
Copy link
Member Author

Sounds reasonable to me. If it's synthesized by MNE during reading, we wouldn't even have to log information about it. Else, an info/warning may be good.

Thing is, I don't know if this channel is always synthesized (and for which file formats) …

What I would propose is:
When reading data and STI 014 is not present in channels.tsv, but appears in the raw, remove it from the raw. This should be rather conservative.

Thoughts?

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, provided CIs pass, +1 to merge

@agramfort agramfort merged commit 780c86c into mne-tools:main Jul 7, 2021
@agramfort
Copy link
Member

thx @hoechenberger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants