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 16 Next »

In some Confluence pages, you can find panel notes in which some ideas of App improvements are listed.

Define an EEG datatype

All Apps use the meg/fif datatype when they directly preprocess the file containing the signals. But some app can preprocess both EEG and MEG data (app-notch-filtering, app-resampling, app-temporal-filtering, app-get-events, and app-make-epochs).

Files in fif format can contain both MEG and EEG data: to select EEG, you have to specify it with the parameter param_picks_by_channel_types_or_names (except for the app-get-events, a MNE function pick() may be added to that App).

But for now no EEG datatype we can use exists, so a discussion about EEG datatype is to needed. The apps app-notch-filtering, app-resampling, app-temporal-filtering, app-get-events, and app-make-epochs run correctly with EEG data stored in a fif file, so maybe it would be interesting to create a eeg/fif datatype. However fif is a format that is not usually used for EEG…

In helper.py a new function dealing with optional files from eeg/fif datatype should be created and used if param_picks_by_channel_types_or_names = 'eeg' instead of the one called when the meg/fif datatype is used (see Create a helper.py file).

HTML reports

The structure of the report needs to be discussed. It’s important for the App user to be able to visualize easily the signals.

Ideas of improvements:

  • Let the user decide the parameters of the plots (the scaling especially) and the plots to display?

  • Add other plots like topoplots

  • For app-bad-channels, plot in red the channels that are detected as bad?

  • Create HTLM reports for other exsiting Apps (app-resampling for instance?)

  • Display plots before and after in the same raw (left and right instead of one above the other)

Assess the quality of the correction

We looked for a value to quantify the efficacy of the correction. A SNR computation was found but has to be improved (see Assess the quality of artifact correction/rejection). The code to compute this SNR is available in several Apps (app-bad-channels, app-maxwell-filter, app-notch-filter, app-temporal-filtering) but it is commented.

The result of this assessment must appear in the HTML report.

Improve existing Apps

  • To see the improvements to make on each app, please check the Confluence page relative to each App (Description of existing Apps).

  • For each App, make sure that error of info messages are clear and that the description of the parameters (in the docstring of the Python file, in the README.md, and on Brainlife) are consistent between each other and understandable.

  • Make sure that the default values of the Apps' parameters correspond to the values of MNE Python 0.23.

  • Try to create a pipeline rule with these Apps to preprocess several subjects in a raw.

  • Add Brainlife tag to output data (such as “epoched”, “filtered”).

  • In the Python code, parts that are no be tested are commented # to be tested.

  • See if the descriptions of the App parameters are consistent in README.md, the doctrings, and in BL

Next Apps to create

  • An app to detect bad channels automatically but not using Maxwell filter, so that it can be applied on .ctf and EEG files

  • An app to re-reference EEG channels

  • An app to automatically detect bad epochs

  • An App to apply ICA

  • Duplicate some of existing apps (apps that are not Elekta specific) so they can be applied to ctf files for example? Or create an app to convert to fif format? An app to convert ctf to fif has been created (see app-ctf2fif)

MNE Python was not designed at first to process EEG data, so their ICA can present some flaws. Maybe these Apps can used other toolboxes like FieldTrip for instance.

Create meg.json

In BiDS a derivatives file called meg.json contains info about the data such as:

FilterType
RECOMMENDED. Could be ‘low-pass butterworth’, ‘high-pass fir’, ‘band-pass iir’, etc.

HighCutoff
RECOMMENDED. Cutoff at which higher frequencies are attenuated.

LowCutoff
RECOMMENDED. Cutoff at which lower frequencies are attenuated.

HighCutoffDefinition
RECOMMENDED. Can be “half-amplitude (-6dB)” or “half-power (-3dB)”

LowCutoffDefinition
RECOMMENDED. Can be “half-amplitude (-6dB)” or “half-power (-3dB)”

FilterOrder
RECOMMENDED. The order of the filter.

FilterLength
OPTIONAL. The length of the filter

RollOff
OPTIONAL. Could be “12 dB/Octave”, etc.

TransitionBandwidth
OPTIONAL. Could be “10 Hz”, etc.

PassbandRipple
OPTIONAL.

StopbandAttenuation
OPTIONAL.

FilterDelay
OPTIONAL. Could be “linear-phase” or “non-linear-phase”

FilterCausality
OPTIONAL. Could be “causal” or “non-causal”

Direction
RECOMMENDED. Could be ‘forward’, ‘backward’ or ‘bidirectional’

DirectionDescription
REQUIRED if “Direction” is “bidirectional”. Else OPTIONAL. Could be “cutoff frequencies and filter order apply to a single filter pass” or “cutoff frequencies and filter order apply to the final two-pass filter”

Purpose
OPTIONAL. ‘antialiasing’

So, it would be interesting to have this information after app-notch-filtering and app-temporal-filtering for instance.

This info doesn’t correspond exactly to the parameter values set by the User (sometimes the values are implicit and must be retrieved by looking closely at the MNE scripts).

The file meg.json doesn’t exist in the meg/fif datatype because the information of this file should be stored in config.json (the meg.json is stored as metadata in Brainlife):

When the data is imported from BIDS to Brainlige, the meg.json is read and content is stored as metadata for that object.

To put information in that field you must you the product.json, which is currently used to display messages in Brainlife UI. But we want this info to be updated after each App: so, for each app that handles meg/fif, you will need to copy the content of the meta from the input to product.json's meta for each meg/fif output, then next app does the same, and so on.

  • No labels