Matlab MNE per Trial Calculation

Hello MNE Analyzers,

I am working with MEEG data and am adapting my predecessor's code. He
relied heavily on the Matlab commands for MNE and that is mostly what I
know. In the analysis, I have to take the channel data from every trial
and compute the activity using the inverse operator for just that trial. I
use this per trial MNE in the continued analysis (Phase Locking Values and
Granger Casuality). However, these MNE values do not appear correct when
viewed in mne_analyze. It is mostly invariant to time, predominately in
the inferior occipital and superior frontal regions of the brain, and has
negative and position values. The values that I get from the .cov file
when I run the MEG solutions are what I would expect, but these are
averaged and I want the activity per trial. Can you help me with my MNE
calculation? Either if you know of a different way to get per-trial MNE
values or can troubleshoot mine.

The significant inputs are the raw_data files from the scanner and the
<subject>_merged_avg-7-meg-eeg-inv.fif inverse operator file. While the
data is still based on channels, I take it from the raw_data file (using
the shell command mne_epochs2mat), selecting the trials corresponding to
the stimuli I want to investigate, and save them in a big .mat file for
each subject. Then I load the inverse operator for the subject and prepare
it as in mne_ex_compute_inverse.m, taking out the projection (since I was
told that was done already in epochs2mat) and not inputting the channel
data yet. So I have the inverse operator for a subject (that maps channels
to sources). For each trial I multiply the operator by the channel data.

I can provide my code if that would help.

Thank you for reading this email and hopefully you can help!
- Conrad

Hello Conrad,

do you know this script:

https://github.com/mne-tools/mne-matlab/blob/master/matlab/mne_ex_compute_inverse_single_trial.m

also, for phase-lock or coherence like analysis,
make sure that you don't take the norm of the 3 orientations ie
that you work with fixed orientation or you do like the picknormal option.

if you want to give a try to Python:

https://martinos.org/mne/auto_examples/inverse/plot_compute_mne_inverse_epochs_in_label.html

HTH,

Alex