stc amplitude dependence on evoked.nave [subject-to-subject comparison]

Hello everyone!

Earlier in the forum, someone asked about working with data on sources with different numbers of averaged epochs per CONDITION. Here is the past discussion. here, here and here.

I have a related issue with SUBJECTS having different numbers of epochs.
[The example below is for a single subject, but let us imagine that these are different subjects]
‘Subject A’ has 453 epochs and ‘subject B’ has 905 epochs. At sensors, the evoked responses have similar amplitude (fig).

However, while solving the inverse problem, MNE-Python scales stc amplitudes proportionally to ‘nave’. As a result, in the source space, B>A (fig), which means that we see a difference that is not really there.

Questions:

  1. Is it possible to somehow normalize the stc amplitudes for the number of averages in order to perform group comparison (we have different numbers of averages in different groups)? If yes, what would be the best way to do so?

  2. Can I use evoked.nave=1 to offset the effect of the inverse problem of having different numbers of averages in subjects A and B?

best regards
Kirill

import mne
import numpy as np
import matplotlib.pyplot as plt

subjects_dir = ‘/freesurfer/’
subject = ‘F001’

lambda2 = 1. / 3 ** 2
method = 'sLORETA'

inv = mne.minimum_norm.read_inverse_operator(myinv+'-inv.fif')
src = mne.setup_source_space(subject, spacing=spacing, subjects_dir=subjects_dir, add_dist=False)

lh_label = mne.read_label(mylabel + '-lh.label')
rh_label = mne.read_label(mylabel + '-rh.label')

epochs = mne.read_epochs(myepochs + '-epo.fif', preload=False)


evoked = epochs.average()

f = mne.viz.plot_compare_evokeds(evoked, 
                                 picks="meg", 
                                 combine='mean',
                                 title='nave = ' + str(evoked.nave),
                                 legend=False,
                                 ylim = dict(mag=[0, 100],grad=[0, 30]))


epochs_crop = epochs.copy()[::2] 
evoked_crop = epochs_crop.average()

f = mne.viz.plot_compare_evokeds(evoked_crop, 
                                 picks="meg", 
                                 combine='mean',
                                 title='nave = ' + str(evoked_crop.nave),
                                 legend=False,
                                 ylim = dict(mag=[0, 100],grad=[0, 30]))


f, ax = plt.subplots(1,2, figsize=(10,5))
f.suptitle('data from sourses', size=20) 
for nhemi, (hemi,label) in enumerate(zip(['left auditory cortex','right auditory cortex'],[lh_label,rh_label])):
    for evk in [evoked, evoked_crop]:

        stc = mne.minimum_norm.apply_inverse(evk, inverse_operator=inv, method=method, lambda2=lambda2, pick_ori=None)
    
        flip = stc.extract_label_time_course(label, src, mode='mean_flip')[0,:]
        if flip[800:1300].mean() > 0:
            flip = flip*-1
    
        ax[nhemi].plot(flip, label = 'nave = ' + str(evk.nave))
    
        ax[nhemi].set_title(hemi, size = 15)
        ax[nhemi].set_ylabel('Amplitude', fontsize = 15)
        ax[nhemi].set_ylim([-35,35])
        ax[nhemi].set_xlabel('Time (ms)', fontsize = 15)
        ax[nhemi].set_xticks(range(0,1201,200))
        ax[nhemi].set_xticklabels(range(-200,1001,200))
        ax[nhemi].grid(True)
        ax[nhemi].legend()

f.tight_layout()

sLORETA and dSPM will scale the output with nave.

You can use method=“MNE” in apply_inverse or maybe z-score/baseline-correct the stcs you obtained.

Alex

3 Likes

Thank you so much for your reply!

Following your words, it is not possible to use sLORETA and dSPM for unbalanced design (e.g. oddball or when we have a systematic bias in the number of epochs between groups of)?

Epochs counts need to be equal across two conditions when you want to compare their source data based on ‘sLORETA’ or ‘dSPM’. nave (in epochs) parameter is used to scale the noise for those methods as Alex mentioned. You have to equalize the epochs across the conditions (nave=453) else you have to use either MNE or eLORETA (check this one, i am not completely sure). Afterwards, you can do a z-score to normalize the data before comparing.

best,
Dip

1 Like

Thank you for your reply!

best,
Kirill

To this question:
Can I use evoked.nave=1 to offset the effect of the inverse problem of having different numbers of averages in subjects A and B?

– No, this is not possible. evoked.nave=1 doesn’t make sense. Typically, nave=1 when you work with a single trial data i.e, (source analysis for epochs) and not for average data.

It would be nice if you change the solution mark to Alex’s comment, so that others can find the right solution.

good wishes,

3 Likes