MEG to BIDS conversion problem with BAD_ACQ_SKIP

Hello,

I am trying to convert a MEG data to BIDS using MNE-BIDS 0.12. For one participant I get this error:

ValueError: The provided raw data contains annotations, but “event_id” does not contain entries for all annotation descriptions. The following entries are missing: BAD_ACQ_SKIP

print(raw.annotations) returns this:
<Annotations | 1 segment: BAD_ACQ_SKIP (1)>

How do I include BAD_ACQ_SKIP in my event_id definitions? How do I know what trigger it uses? If it is trigger 1, it is already used and defined for another event.

Hello @dcdace and welcome to the forum!

BAD_ACQ_SKIP is normally not part of your event_id dictionary when working with events in MNE-Python. However, when writing out data to BIDS, it is very important to preserve this segment annotation. What you need to do is amend the event_id dictionary that you pass to write_raw_bids() and include BAD_ACQ_SKIP there. You can assign it an arbitrary event code – pick whatever makes you happy. With this modification, writing the data to BIDS should work. And when reading it back again via read_raw_bids(), you should find the BAD_ACQ_SKIP annotation in the correct place!

Good luck and best wishes,

Richard

1 Like

Thanks so much, that worked!