View average waveform troubles visualizing results

  • MNE version: 1.2
  • operating system: Windows 11

Hi, I am following the mne-nirs tutorial Group Level Waveform Analysis everything worked perfectly, however I am having troubles viewing the average waveform:

I did the following:

pprint(all_evokeds)

""" output: pprint(all_evokeds)

defaultdict(<class 'list'>,
            {'NV': [<Evoked | '' (average, N=0), -8 – 20 sec, baseline -8 – 0 sec, 88 ch, ~294 kB>,
                    <Evoked | 'NV' (average, N=10), -8 – 20 sec, baseline -8 – 0 sec, 88 ch, ~294 kB>,
                    <Evoked | '' (average, N=0), -8 – 20 sec, baseline -8 – 0 sec, 88 ch, ~294 kB>,
                    <Evoked | 'NV' (average, N=10), -8 – 20 sec, baseline -8 – 0 sec, 88 ch, ~294 kB>,
                    <Evoked | 'NV' (average, N=10), -8 – 20 sec, baseline -8 – 0 sec, 88 ch, ~294 kB>,
                  ...
"""

fig, axes = plt.subplots(nrows=1, ncols=len(all_evokeds), figsize=(17, 5))
lims = dict(hbo=[-8, 20], hbr=[-8, 20])

for (pick, color) in zip(['hbo', 'hbr'], ['r', 'b']):
    for idx, evoked in enumerate(all_evokeds):
        mne.viz.plot_compare_evokeds({evoked: all_evokeds[evoked]}, combine='mean',
                             picks=pick, axes=axes[idx], show=False,
                             colors=[color], legend=False, ylim=lims, ci=0.95,
                             show_sensors=idx == 2)
        axes[idx].set_title('{}'.format(evoked))
axes[0].legend(["Oxyhaemoglobin", "Deoxyhaemoglobin"])

And received the following traceback:

ValueError: <Evoked | '' (average, N=0), -8 – 20 sec, baseline -8 – 0 sec, 88 ch, ~294 kB> and <Evoked | 'NV' (average, N=10), -8 – 20 sec, baseline -8 – 0 sec, 86 ch, ~288 kB> do not contain the same channels.

How can I avoid this and be able to plot the average waveform!

Thank you in advance!
Best - Rebecka

Hello @rfahrn, I’m not familiar with this particular tutorial you’re following, but something’s clearly wrong with some of the evokeds you’re producing, specifically the first and third one:

It says N=0 there, as if they don’t contain any data.

Maybe somebody else has an idea on what’s up.

Best wishes,
Richard

1 Like

Thanks @richard for the reply, yes it does appear to be empty - I have no idea how that could happen though.

Best thanks - Rebecka