This is a collaborative space. In order to contribute, send an email to maximilien.chaumon@icm-institute.org
On any page, type the letter L on your keyboard to add a "Label" to the page, which will make search easier.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

DRAFT

As pointed out by Soichi during a datatype meeting (see Datatype meeting 22.04.2021), we don’t want an App that outputs a MEG file whose only difference from the input MEG file is the list of bad channels or the list of events.

This issue, regarding bad channels, was also discussed here Où stocker l'information "bad channels", and it was decided that the App that detects bad channels will only returns a BIDS-compliant channels.tsv and this file will be used in other Apps to populate the raw.info['bads'].

Add how to handle events.tsv

Channels.tsv

Steps to create a BIDS compliant channels.tsv

  1. Create a BIDS path using mne_bids

  2. Convert the MEG file into a BIDS structure using mne_bids.write_raw_bids()

  3. Extract the channels.tsv from the BIDS path

Update channels.tsv with bad channels detected by the App

  1. Convert the channels.tsv into a pd.DataFrame

  2. Update its column “status” of the dataframe with “bad” for the channels detected as bad

  3. Save the updated dataframe in a .tsv file

Populate raw.info['bads'] with channels.tsv info

The output datatype of the App that detects bad channels is meg/fif-override (see https://brainlife.io/datatype/608195ce89df435fd26893c1), but as pointed out here Où stocker l'information "bad channels", MNE Python functions used the info stored in raw.info['bads']. So, we need to update raw.info['bads']with the info of channels.tsv. If raw.info['bads'] is not compliant with the info of channels.tsv, a warning is displayed to the user to tell him that by default, only bad channels from channels.tsv are considered as bad: the info of his MEG file will be updated with those channels. The comparison between channels.tsv and raw.info['bads'] is performed at the beginning of each App.

Events.tsv

  • No labels