I can’t use the streaming of lfp tutorial. I have updates both ibllib
and brainbox
. I am trying to stream the lfp around a certain event but I get an error stating that SpikeSortingLoader has no raw_electrophysiology attribute.
ibllib is version 2.35.2, brainbox is version 0.0.7 in my environment. I just upgraded them and it did not fix the error.
Code:
from one.api import ONE
from brainbox.io.one import SpikeSortingLoader
import matplotlib.pyplot as plt
import scipy.signal
from brainbox.ephys_plots import plot_brain_regions
from ibllib.plots import Density
ssl = SpikeSortingLoader(pid=probe_id, one=one)
# The channels information is contained in a dict table / dataframe
channels = ssl.load_channels()
# Get AP and LFP spikeglx.Reader objects
sr_lf = ssl.raw_electrophysiology(band="lf", stream=True)
Error:
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[48], [line 6](vscode-notebook-cell:?execution_count=48&line=6) [3](vscode-notebook-cell:?execution_count=48&line=3) channels = ssl.load_channels() [5](vscode-notebook-cell:?execution_count=48&line=5) # Get AP and LFP spikeglx.Reader objects ----> [6](vscode-notebook-cell:?execution_count=48&line=6) sr_lf = ssl.raw_electrophysiology(band="lf", stream=True) AttributeError: 'SpikeSortingLoader' object has no attribute 'raw_electrophysiology'
Note I am planning on plotting using this code later, I do not need the ap.
Plotting to do:
sos_lf = scipy.signal.butter(3, 2 / sr_lf.fs /2, btype='highpass', output='sos') # 2 Hz high pass LF band
filtered_lf = scipy.signal.sosfiltfilt(sos_lf, raw_lf)
# displays the AP band and LFP band around this stim_on event
fig, ax = plt.subplots(figsize=(9, 6))
Density(- filtered_lf, fs=sr_lf.fs, taxis=1, ax=ax)
plot_brain_regions(channels["atlas_id"], channel_depths=channels["axial_um"], ax=ax, display=True)