jukka / NeuroKit

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing

Home Page:https://neurokit2.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image

image

image

image

image

image

Maintainability

The Python Toolbox for Neurophysiological Signal Processing

This package is the continuation of NeuroKit 1. It's a user-friendly package providing easy access to advanced biosignal processing routines. Researchers and clinicians without extensive knowledge of programming or biomedical signal processing can analyze physiological data with only two lines of code.

Quick Example

And boom 💥 your analysis is done 😎

Installation

To install NeuroKit2, run this command in your terminal:

pip install neurokit2

If you're not sure how/what to do, be sure to read our installation guide.

Contributing

License

GitHub CI

Black code

NeuroKit2 is the most welcoming project with a large community of contributors with all levels of programming expertise. But the package is still far from being perfect! Thus, if you have some ideas for improvement, new features, or just want to learn Python and do something useful at the same time, do not hesitate and check out the following guides:

Documentation

Documentation Status

API

Tutorials

PDF

Binder

Chat on Gitter

Click on the links above and check out our tutorials:

General

Examples

You can try out these examples directly in your browser.

Don't know which tutorial is suited for your case? Follow this flowchart:

image

Citation

image

image

Physiological Data Preprocessing

Simulate physiological signals

image

Electrodermal Activity (EDA/GSR)

image

Cardiac activity (ECG)

image

Respiration (RSP)

image

Electromyography (EMG)

image

Photoplethysmography (PPG/BVP)

image

Electrooculography (EOG)

image

Electrogastrography (EGG)

Consider helping us develop it!

Physiological Data Analysis

The analysis of physiological data usually comes in two types, event-related or interval-related.

image

This type of analysis refers to physiological changes immediately occurring in response to an event. For instance, physiological changes following the presentation of a stimulus (e.g., an emotional stimulus) indicated by the dotted lines in the figure above. In this situation the analysis is epoch-based. An epoch is a short chunk of the physiological signal (usually < 10 seconds), that is locked to a specific stimulus and hence the physiological signals of interest are time-segmented accordingly. This is represented by the orange boxes in the figure above. In this case, using bio_analyze() will compute features like rate changes, peak characteristics and phase characteristics.

This type of analysis refers to the physiological characteristics and features that occur over longer periods of time (from a few seconds to days of activity). Typical use cases are either periods of resting-state, in which the activity is recorded for several minutes while the participant is at rest, or during different conditions in which there is no specific time-locked event (e.g., watching movies, listening to music, engaging in physical activity, etc.). For instance, this type of analysis is used when people want to compare the physiological activity under different intensities of physical exercise, different types of movies, or different intensities of stress. To compare event-related and interval-related analysis, we can refer to the example figure above. For example, a participant might be watching a 20s-long short film where particular stimuli of interest in the movie appears at certain time points (marked by the dotted lines). While event-related analysis pertains to the segments of signals within the orange boxes (to understand the physiological changes pertaining to the appearance of stimuli), interval-related analysis can be applied on the entire 20s duration to investigate how physiology fluctuates in general. In this case, using bio_analyze() will compute features such as rate characteristics (in particular, variability metrics) and peak characteristics.

Miscellaneous

Heart Rate Variability (HRV)

  • Compute HRV indices
    • Time domain: RMSSD, MeanNN, SDNN, SDSD, CVNN etc.
    • Frequency domain: Spectral power density in various frequency bands (Ultra low/ULF, Very low/VLF, Low/LF, High/HF, Very high/VHF), Ratio of LF to HF power, Normalized LF (LFn) and HF (HFn), Log transformed HF (LnHF).
    • Nonlinear domain: Spread of RR intervals (SD1, SD2, ratio between SD2 to SD1), Cardiac Sympathetic Index (CSI), Cardial Vagal Index (CVI), Modified CSI, Sample Entropy (SampEn).

image

ECG Delineation

  • Delineate the QRS complex of an electrocardiac signal (ECG) including P-peaks, T-peaks, as well as their onsets and offsets.

image

Signal Processing

  • Signal processing functionalities
    • Filtering: Using different methods.
    • Detrending: Remove the baseline drift or trend.
    • Distorting: Add noise and artifacts.

image

Complexity (Entropy, Fractal Dimensions, ...)

  • Optimize complexity parameters (delay tau, dimension m, tolerance r)

image

  • Compute complexity features
    • Entropy: Sample Entropy (SampEn), Approximate Entropy (ApEn), Fuzzy Entropy (FuzzEn), Multiscale Entropy (MSE), Shannon Entropy (ShEn)
    • Fractal dimensions: Correlation Dimension D2, ...
    • Detrended Fluctuation Analysis

Signal Decomposition

image

Signal Power Spectrum Density (PSD)

image

Statistics

  • Highest Density Interval (HDI)

image

Popularity

image

image

image

NeuroKit2 is one of the most welcoming package for new contributors and users, as well as the fastest growing package. So stop hesitating and hop onboard 🤗

image

Notes

The authors do not provide any warranty. If this software causes your keyboard to blow up, your brain to liquefy, your toilet to clog or a zombie plague to break loose, the authors CANNOT IN ANY WAY be held responsible.

About

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing

https://neurokit2.readthedocs.io/

License:MIT License


Languages

Language:Python 76.6%Language:Jupyter Notebook 17.6%Language:TeX 5.5%Language:R 0.4%