Real-time analysis of intracranial neurophysiology recordings.
Project description
py_neuromodulation
Analyzing neural data can be a troublesome, trial and error prone, and beginner unfriendly process. py_neuromodulation allows using a simple interface for extraction of established neurophysiological features and includes commonly applied pre -and postprocessing methods.
Only time series data with a corresponding sampling frequency are required for feature extraction.
The output will be a pandas.DataFrame including different time-resolved computed features. Internally a stream get’s initialized, which resembles an online data-stream that can in theory also be be used with a hardware acquisition system.
The following features are currently included:
oscillatory: fft, stft or bandpass filtered band power
various burst features
line length
and more…
The original intention for writing this toolbox was movement decoding from invasive brain signals [1]. The application however could be any neural decoding problem. py_neuromodulation offers wrappers around common practice machine learning methods for efficient analysis.
Find the documentation here http://py-neuromodulation.readthedocs.io for example usage and parametrization.
Installation
For installation, clone the repository and create a new virtual conda environment with at least python 3.10:
conda create -n pynm-test python=3.10
conda activate pynm-test
Then install the packages listed in the pyproject.toml with.
pip install .[dev]
Optionally the ipython kernel can be specified for the installed pynm-test conda environment:
ipython kernel install --user --name=pynm-test
Then py_neuromodulation can be imported via:
import py_neuromodulation as py_nm
Basic Usage
import py_neuromodulation as pn
import numpy as np
NUM_CHANNELS = 5
NUM_DATA = 10000
sfreq = 1000 # Hz
feature_freq = 3 # Hz
data = np.random.random([NUM_CHANNELS, NUM_DATA])
stream = pn.Stream(sfreq=sfreq, data=data, sampling_rate_features_hz=sampling_rate_features_hz)
features = stream.run()
Check the Usage and First examples for further introduction.
Contact information
For any question or suggestion please find my contact information at my GitHub profile.
References
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for py_neuromodulation-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b62f0979f708df044918e9b1187234fa36696587f0e212b0af159a36f8918da |
|
MD5 | 484e099d266eed5c6e2339607704f41a |
|
BLAKE2b-256 | 65165a4c8a2503493f9cd3c4bd7b346557edcf200da964efd7cca831bb993055 |