Motor Evoked Potentials

Initialize NeuroAnalyzer
using NeuroAnalyzer;

Motor Evoked Potentials (MEPs) are electrical signals recorded from muscles or the descending motor pathways following stimulation of the motor cortex in the brain. MEPs are commonly used in Transcranial Magnetic Stimulation (TMS) to assess the integrity and functionality of the motor pathways and to determine the appropriate intensity of stimulation.

Definition

MEPs are the electrical responses recorded from muscles or motor pathways after the motor cortex is stimulated, typically using TMS.

Applications

  • Diagnostic Use: MEPs are used to evaluate the functional integrity of the corticospinal tract, helping to diagnose neurological conditions such as multiple sclerosis, stroke, and spinal cord injuries.
  • Research Use: In research, MEPs are used to study motor pathway physiology, cortical excitability, and plasticity.

TMS and MEPs:

  • In TMS, a magnetic coil is placed over the motor cortex. A brief magnetic pulse induces an electric current in the brain, which activates the motor neurons and results in a measurable MEP in the target muscle.
  • The intensity of the TMS stimulus is adjusted to elicit a consistent MEP response, which can be quantified in terms of amplitude and latency.

MEP Analysis

NeuroAnalyzer allows for the analysis of MEP recordings. Here’s how it typically handles MEP data:

Data Import

MEP recordings are imported into NeuroAnalyzer. Each MEP is treated as an individual channel within a NeuroAnalyzer.NEURO object. MEPs exported from the DuoMAG stimulator as MATLAB (.m) or ASCII (.ascii) files are supported.

mep = import_duomag("files/mep-duomag.m");

or

mep = import_duomag("files/mep-duomag.ascii");

Channel Management

Since a recording session often contains multiple MEPs, each MEP is imported as a separate channel. This allows for individual analysis and comparison of different MEPs.

info(mep)
              Data type: MEP
            File format: DuoMAG
            Source file: files/mep-duomag.ascii
         File size [MB]: 0.93
       Memory size [MB]: 1.25
                Subject: 000011:  5-1
              Recording: 
        Recording notes: 
         Recording date: 21.11.2019
         Recording time: 14:28:51
     Sampling rate (Hz): 12500
Signal length [samples]: 8129
Signal length [seconds]: 0.6503
     Number of channels: 19

Channels:
 ch     label           type        unit    bad     
 ------ --------------- ----------- ------- -------
 1      MEP1            MEP         μV      false   
 2      MEP2            MEP         μV      false   
 3      MEP3            MEP         μV      false   
 4      MEP4            MEP         μV      false   
 5      MEP5            MEP         μV      false   
 6      MEP6            MEP         μV      false   
 7      MEP7            MEP         μV      false   
 8      MEP8            MEP         μV      false   
 9      MEP9            MEP         μV      false   
 10     MEP10           MEP         μV      false   
 11     MEP11           MEP         μV      false   
 12     MEP12           MEP         μV      false   
 13     MEP13           MEP         μV      false   
 14     MEP14           MEP         μV      false   
 15     MEP15           MEP         μV      false   
 16     MEP16           MEP         μV      false   
 17     MEP17           MEP         μV      false   
 18     MEP18           MEP         μV      false   
 19     MEP19           MEP         μV      false   

Analysis Features

  • Amplitude Analysis: Measure the peak-to-peak amplitude of MEPs to assess the strength of the motor response.
  • Latency Analysis: Determine the latency of MEPs, which is the time between the stimulus and the onset of the muscle response.
  • Statistical Analysis: Perform statistical analyses on MEP data to compare responses under different conditions or over time.

Detecting peaks:

mep_peaks(mep)
19×2 Matrix{Int64}:
 2110  2076
 2128  2086
 2149  2077
 2168  2072
 2170  2073
 2159  2082
 6562  2129
 2154  2073
 2096  2232
 2152  2090
 2115  2202
 2160  2087
 5658  2385
 2745  7601
 7548  2092
 2075  2112
 3099  2119
 2125  2094
 7699  2844

Tip: The output matrix contains the position (in samples) of the positive (first column) and negative (second column) peaks.

Calculating amplitude at given time point across all MEPs:

amp_at(mep, t = 0.250)
19×1 Matrix{Float64}:
   2.6917144495412835
  -0.2894495412844016
  15.473107798165136
  20.644151376146787
 -10.785865825688077
  -0.7515481651376135
   5.571760321100918
   8.395957568807338
  -7.5335149082568815
  -4.855819954128441
 -10.17540137614679
  -7.648308486238534
  -1.7762041284403676
 -16.006708715596332
  -2.4488818807339428
   8.099082568807338
  -2.3892775229357817
  -5.861267201834863
  13.460149082568808

Calculating average, minimum and maximum amplitude over a time segment (provided in seconds):

avgamp_at(mep, t = (0.150, 0.250))
19×1 Matrix{Float64}:
  0.6933131705644617
  3.741725518667638
 13.86559380935618
 20.563415964476118
  2.9095778193958584
 -5.0065441683350596
  6.0697619198219455
  3.966700974083123
 -1.3456651880330612
  0.8268339227700429
  5.0572125327261155
 -5.039995136917988
  0.4364257676427648
 -9.77169672518867
 -5.627938635330272
  3.6122720172485825
 -1.5923150928798249
 -2.025136106710962
 11.644801360746271
minamp_at(mep, t = (0.150, 0.250))
19×1 Matrix{Float64}:
  -6.3082855504587165
  -2.2894495412844016
   7.473107798165136
  13.64415137614679
 -18.785865825688077
 -23.751548165137613
  -1.4282396788990823
  -8.604042431192662
  -8.533514908256882
 -13.85581995412844
 -12.17540137614679
 -13.648308486238534
  -3.7762041284403676
 -18.006708715596332
 -15.448881880733943
  -3.9009174311926618
  -8.389277522935782
  -6.861267201834863
  -0.5398509174311918
maxamp_at(mep, t = (0.150, 0.250))
19×1 Matrix{Float64}:
  6.6917144495412835
  8.710550458715598
 22.473107798165138
 28.644151376146787
 19.214134174311923
 10.248451834862387
 22.571760321100918
 14.395957568807338
  5.4664850917431185
 22.144180045871558
 27.824598623853213
  2.351691513761466
  5.223795871559632
 -4.006708715596332
  1.5511181192660572
 10.099082568807338
  6.610722477064218
  3.1387327981651367
 21.460149082568808

Visualization

  • Visualize MEP waveforms to observe patterns, differences, and changes in response characteristics.

Plotting MEP, channel 1:

plot_mep(mep, ch = "MEP1")

Tip: These peaks are auto-detected. Files exported from DuoMAG contain peaks detected by the stimulator. To use embedded peaks, use:

plot_mep(mep,
         ch = "MEP1",
         peaks = false)

Plotting MEPs, multi-channel:

plot_mep(mep,
         ch = "all",
         avg = true,
         leg = false)

Tip: leg = false hides the list of channels.

Plotting MEPs, averaged multi-channel:

plot_mep(mep,
         ch = "all",
         ci95 = true,
         peaks = false)

Plotting stacked MEPs:

plot_mep(mep,
         ch = "all",
         type = :stack)