-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding modules for real time specific processing #26
Comments
Do you have some benchmark scripts that compare the timing with your implementation against MNE? |
@jasmainak To refer to the specific files: rt_filter.py Currently no, I can provide such a file though. @teonbrooks @jasmainak Would do you think about the separate modules? I can create separate pull requests to demonstrate the functionality interplay. |
I like the architecture of these files and it would be a great starting point. are these listed in the same order you would expect them to be applied as well? |
So in general a script would be started by the initiation of rt_analysis.py. In there the LSL or FT Client would be initialized, then in a loop new data would be called by e.g. Maybe a further word on normalization, of course the mne.decoding.scaler could be also called on all previous acquired data, but some of the previous analysis we did in the lab showed that it might be beneficial, and maybe also more computational efficient, to only normalize according to the last n seconds. |
Maybe a bit more general question, what do you think about the idea to specify certain common preprocessing and feature parameters in a settings file? |
Hereby I want to propose some additional files for the mne-realtime package that would allow for fast computation and data handling of processed data.
rt_filter.py
The MNE filter functions seem fairly slow and thus could resemble some restrictions for high sampling rate processing. Instead bandpass filter can be calculated before the real time processing, and then only be applied using a fast numpy convolution.
(see https://github.com/neuromodulation/py_neuromodulation/blob/main/pyneuromodulation/filter.py as example implementation)
rt_normalization.py
During real time analysis it becomes necessary to normlize data according to a certain timeframe, here the mean or median option could be handy.
(see https://github.com/neuromodulation/py_neuromodulation/blob/main/pyneuromodulation/realtime_normalization.py as example implementation)
rt_features.py
For neural decoding different kind of features (frequency, time, spatial domain) need to be computed, optimally across multiple threads. This could be achieved using a class that calls predefined features routines.
(see https://github.com/neuromodulation/py_neuromodulation/blob/main/pyneuromodulation/features.py for example implementation)
rt_analysis.py
When analyzing streaming data, the data processing needs to be defined. A pandas dataframe with predictions, features and timestamps could be defined for saving data. After data acquisiton ends, the data can be saved using mne_bids. Decoding predictions/performances could be saved in the BIDS derivatives.
The text was updated successfully, but these errors were encountered: