Amplitude Integrated EEG

Hello,

I would like to ask if the amplitude integrated EEG (aEEG) is implemented in MNE.

Thank you!

I don’t think so, because I have never heard of this term. Would you mind sharing some explanation and/or references and links as to what you mean by aEEG?

1 Like

You can find some information about aEEG in page 96 (https://partners.natus.com/asset/resource/file/neuro/asset/2020-06/013017_Rev07_NeuroWorks%208%20Reference%20Manual.pdf)

thanks for the reference! I also found these:

A quick/cursory look suggests that aEEG is typically used online, meaning it’s used for continuous monitoring. MNE-Python isn’t really designed for that (though there’s another package, MNE-Realtime, that is). Is there a use case for aEEG that is offline (i.e., would it be useful to analyze recorded data this way)?

1 Like

In a recent communication about neonatal eeg analysis, I found very beautiful and helpful the possibility to have an aEEG trace on top of the eeg trace in order to easily explore the global trends of the trace and to find quickly the most relevant fragments. I show you an example in the attached image (if I am able to attach it)

Hi,
Python code using process described in this article Calculation of compact amplitude-integrated EEG …

aEEG

from scipy.signal import hilbert, chirp
import matplotlib.pyplot as plt
from matplotlib.ticker import (MultipleLocator, AutoMinorLocator)
def powerformat(x,pos):    
    """The two arguments are the value and tick position."""
    return r"${0:.{2}f}^{{{1:d}}}$ ".format(10, int(x), 0)+"\u03bcV"
limits={"Low":0.3, "High" : 40}

def aEEGsignal(data,fs):
    # Filter between Low and High limits
    sosh = butter(1, limits["Low"], 'high',output='sos',fs=fs)
    outputh = sosfiltfilt(sosh, data)
    sosl = butter(3, limits["High"], 'low',output='sos',fs=fs)
    output= sosfiltfilt(sosl, outputh)    
    return output

def getEEG_A_mix_max(data,fs):
    # filter channel data
    filtered=aEEGsignal(data,fs)
    # rectify filtered channel data
    rectified=np.absolute(filtered)
    # get amplitude enveloppe
    analytic_signal = hilbert(rectified)
    amplitude_envelope = np.abs(analytic_signal)
    # get min and max terminals from each 15 second epoch
    window=15
    epoch=window*eeg_frequency
    num_epochs=len(amplitude_envelope)//epoch
    valid_length=epoch*(num_epochs)
    valid_data=amplitude_envelope[:valid_length]
    # below 10 linear above 10 microVolts log10 
    valid_data=np.where(valid_data < 10,valid_data/10, np.log10(valid_data))
    epochs=np.reshape(valid_data, (num_epochs,epoch))
    # get percentile analysis
    pct = np.linspace(0, 100, 101)
    # min terminal is maximum of the 9% lower amplitude
    pctlow=9
    # max terminal is minimum of the 93% upper amplitude
    pcthigh=93
    p=np.percentile(epochs, pct, axis=1,method="midpoint")
    amin=np.amax(p[0:pctlow],axis=0)
    amax=np.amin(p[pcthigh:100],axis=0)
    # plot results
    fig, ax = plt.subplots()
    t=np.arange(num_epochs)*window 
    ax.plot(t, amin,lw=1,color="g")
    ax.plot(t, amax,lw=1,color="r")
    ax.fill_between(t, amax, amin, alpha=0.10,hatch="|",color='tab:orange')
    ax.set_ylim([0,3])
    ax.yaxis.tick_right()
    ax.yaxis.set_major_locator(MultipleLocator(1))
    ax.yaxis.set_major_formatter(powerformat)
    plt.show()
    plt.close()
2 Likes