Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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

  • These apps were mainly tested with meg.fif recorded at the ICM and they were all resting state data. So, it is important to test them with task data (especially for app-make-epochs, app-get-events, and app-resampling).

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:

Code Block
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.

Info

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):

...

Info

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.