Tutorials


Starting MIA for the first time

  1. If you haven’t read the installation instructions, please do it now : Installation.
  • Start mia from matlab (by typing mia in Matlab command line) or from Brainstorm
  • Select an empty directory to create MIA database

MIA folders / files

MIA requires different directories to work properly. Please note that it is important that you do not use MIA directory for other purpose as MIA (copying file into MIA’s directory would likely produce errors). We recommend that you understand this organization before creating a new database.


1. Program directory: « mia »

  • Contains all the program files: Matlab scripts, external functions, etc.
  • You can move this folder and replace it with a newer version at anytime (however, we recommend that you always keep track of the versions that you install), your data will be safe.
  • Recommended location:
    • Windows: Documents\mia
    • Linux: /home/username/mia
    • MacOS: Documents/mia


2. Database directory: « mia_db »

  • Created by user.
  • Contains all the MIA database files.
  • Managed by the MIA toolbox : do not move, delete or add files manually.
  • Recommended location:
    • Windows: Documents\mia_db
    • Linux: /home/username/ mia_db
    • MacOS: Documents/ mia_db

3. Original data files:

  • Recordings that you want to process with MIA
  • Put them wherever you want but not in any of the previous folders.


4. User history file : « .mia_history.mat »

  • Created at MIA startup. Typical location:
    • Windows: C:\Users\username\.mia_history.mat
    • Linux: /home/username/.mia_history.mat
    • MacOS: /Users/username/.mia_history.mat

Contains MIA’s user preferences


General workflow

The workflow described in this tutorial includes the following steps :


Suggested pre-processing steps

Optional pre-processing steps that we implement regularly include :

  • Filtering (continuous data filtering is recommended)
  • Artifact rejection (marking segments on continuous data is recommended)
  • Bad channel rejection

Please note that it is mandatory to perform an epoch segmentation that includes enough temporal points to disregard edge effects prior to MIA import. All these steps can be processed in Brainstorm :


Files supported

Files pre-processed in Brainstorm (trial*.mat, channel.mat, braintormstudy.mat) and Brainvision (.eeg,.vmrk,.vhrd) are directly importable in MIA.

Find below the various file format of intracerebral data (sEEG – EcoG) handled by Brainstorm :

  • Deltamed
  • Micromed
  • Nihon Koden
  • Nicolet
  • BrainAmp
  • ED

And file extensions :

  • ‘.trc’
  • ‘.eeg’
  • ‘.e’
  • ‘.bin’
  • ‘.rda’

Main interface window

Anatomical labeling

Currently, MIA supports labeling table constructed with Brainstorm, Fieldtrip or a custom table organized such that each line describes one recording contact, with four simple fields across four columns: patient ID, contact label, laterality (L or R) and region anatomical label. The region labels can be arbitrarily decided by the user, but they must be consistent across patients.

Exemple of custom table :


Sanity check

The sanity check interface allow the visualization of imported data (prior to any MIA process). The interface shows : the number of trials, the total number of contacts (recording sites), the number of electrodes, and the number of contacts per electrode. It displays the signals on a butterfly view as well as on an image view.

There is a scroll menu to switch between monopolar montage and bipolar montage (for visualization only).

At this stage, if you identify a flaw channel (which was missed at the preprocessing stage), you can reject it form this interface: use the “Button select channel”. Then, the “Save button” will make sure that these channels will not be processed in MIA subsequent processing steps.



Normalization and Time-Frequency decomposition

To perform a time-frequency analysis or a simple normalization of the broadband signals use the “Frequency” button from the main interface. At the stage, several options can be set :

Frequency range : Low and high boundaries of the frequency range you want to explore

  • Frequency range : Low and high boundaries of the frequency range you want to explore
  • Step : Step to take between low boundary and high boundary (e.g. if frequency range is 80-100 and step 10Hz, the algorithm will decompose the signals into 80, 90, 100 and process the 1/f compensation at each frequency, then will average the three frequencies together)
  • Method : Pick the method to process the signals.
  • N cycles : The number of cycles for Morlet wavelets.
  • Baseline : Baseline period used for normalization (in seconds)
  • Montage : Montage to compute prior to processing


Statistical analysis

work in progress. Thank you for your understanding.

Button Function Comment
Zoom in and Zoom out give access to the Matlab zoom feature applicable on any of the three panels (the two other panels will accordingly adapt to the same zoom accordingly)
data cursor get the precise cursor information (time and amplitude) click anywhere on one of the three panels
JPEG button saves a snapshot of the window A default “JPEGs” folder is automatically created in the main database directory
pan tool pan the axes views A native Matlab feature
DISP button hide or show the left and middle panels These correspond to z-scores and uncorrected t-values

Group analysis

Troubleshooting

If you experience any difficulties with MIA please do not hesitate to reach out by posting an issue on GitHub.