Hi Josh,
I am trying to load the Bpod SessionData with Python notebook. I could load the first level of the struct data. But I do not know how to extract the raw event and state data (second level of struct data) from the RawEvents (below is the notebook code that I tried). Is there any convenient way to do that?
import numpy as np
import matplotlib.pyplot as plt
import glob
from scipy.io import loadmat
filename = 'C:/Users/xiaox/Desktop/Python_learning/Data'
filelist = glob.glob(filename + "/*.mat")
print(filelist)
mat = loadmat(filelist[0]) # mat.keys()
SessionData = mat['SessionData']
print(SessionData.dtype)
TrialTypes = SessionData[0,0]['TrialTypes']
print(TrialTypes)
ImagingFlag = SessionData[0,0]['ImagingFlag']
print(ImagingFlag)
RunSpeed = SessionData[0,0]['RunSpeed']
print(RunSpeed[0,0])
## How to extract raw event data (such as Wire1High) and state data (such as TrialStart) from RawEvents?
RawEvents = SessionData[0,0]['RawEvents']
print(RawEvents[0,0])
Thanks,
Xiong