NeuroKit
{{Infobox software
| logo = NeuroKit2 logo.png
| released =
| programming_language = Python
| operating_system = All OS supported by Python
| language = English
| genre = Statistical software
| license = MIT License
| website = {{URL|https://github.com/neuropsychology/NeuroKit}}
}}
NeuroKit ("nk") is an open source toolbox for physiological signal processing.{{cite journal |last1=Makowski |first1=Dominique |last2=Pham |first2=Tam |last3=Lau |first3=Zen J. |last4=Brammer |first4=Jan C. |last5=Lespinasse |first5=François |last6=Pham |first6=Hung |last7=Schölzel |first7=Christopher |last8=Chen |first8=S. H. Annabel |title=NeuroKit2: A Python toolbox for neurophysiological signal processing |journal=Behavior Research Methods |date=August 2021 |volume=53 |issue=4 |pages=1689–1696 |doi=10.3758/s13428-020-01516-y|pmid=33528817 |doi-access=free }} The most recent version, NeuroKit2, is written in Python and is available from the PyPI package repository.{{cite web |title=neurokit2 |url=https://pypi.org/project/neurokit2/ |website=PyPI |access-date=23 March 2022}} As of June 2022, the software was used in 94 scientific publications.{{cite web |title=NeuroKit2 article - Statistics |url=https://www.researchgate.net/publication/348985040 |website=ResearchGate |access-date=23 March 2022}}
NeuroKit2 is presented as one of the most popular and contributor-friendly open-source software for neurophysiology based on the number of downloads, the number of contributors, and other GitHub metrics{{ref|a|a}}.{{cite web |title=NeuroKit2 - Popularity |url=https://github.com/neuropsychology/NeuroKit#popularity |website=GitHub |date=February 2021 |access-date=23 March 2022}}
History
The first version of NeuroKit was created as a PhD side-project of Dominique Makowski in 2017. It was officially deprecated in 2020 and has been replaced by the current version, NeuroKit2. A few major updates have been released since:{{cite web |title=NeuroKit2 Versions |url=https://github.com/neuropsychology/NeuroKit/releases |website=GitHub |access-date=18 August 2022 |language=en}}
- February 08, 2021: The 0.1.0 release coincides with the first publication of the software.
- May 18, 2022: The 0.2.0 release coincides with an overhaul of the documentation.
NeuroKit has received the 2024 Commendation Award from the Society for the Improvement of Psychological Science (SIPS).{{cite web |title=SIPS 2024 Awards |url=https://improvingpsych.org/mission/awards/ |access-date=20 August 2024 |date=24 July 2018}}
Features
NeuroKit2 includes tools to work with cardiac activity from electrocardiography (ECG) and photoplethysmography (PPG), electrodermal activity (EDA), respiratory (RSP), electromyography (EMG), and electrooculography (EOG) signals.{{cite journal |last1=Jaber |first1=Dalia |last2=Hajj |first2=Hazem |last3=Maalouf |first3=Fadi |last4=El-Hajj |first4=Wassim |title=Medically-oriented design for explainable AI for stress prediction from physiological measurements |journal=BMC Medical Informatics and Decision Making |date=December 2022 |volume=22 |issue=1 |pages=12 |doi=10.1186/s12911-022-01772-2|pmid=35148762 |pmc=8840288 |doi-access=free }}
It enables the computation of Heart Rate Variability (HRV) and Respiratory Variability (RRV) metrics.{{cite journal |last1=Pham |first1=Tam |last2=Lau |first2=Zen Juen |last3=Chen |first3=S. H. Annabel |last4=Makowski |first4=Dominique |title=Heart Rate Variability in Psychology: A Review of HRV Indices and an Analysis Tutorial |journal=Sensors |date=9 June 2021 |volume=21 |issue=12 |pages=3998 |doi=10.3390/s21123998|pmid=34207927 |pmc=8230044 |bibcode=2021Senso..21.3998P |doi-access=free }}{{cite journal |last1=Frasch |first1=Martin G. |title=Comprehensive HRV estimation pipeline in Python using Neurokit2: Application to sleep physiology |journal=MethodsX |date=1 January 2022 |volume=9 |pages=101782 |doi=10.1016/j.mex.2022.101782|pmid=35880142 |pmc=9307944 }}
It also implements a variety of different algorithms to detect R-peaks and other QRS waves, including an efficient in-house R-peak detector.{{cite journal |last1=Baraeinejad |first1=Bardia |last2=Fallah Shayan |first2=Masood |last3=Vazifeh |first3=Amir Reza |last4=Rashidi |first4=Diba |last5=Saberi Hamedani |first5=Mohammad |last6=Tavolinejad |first6=Hamed |last7=Gorji |first7=Pouya |last8=Razmara |first8=Parsa |last9=Vaziri |first9=Kiarash |last10=Vashaee |first10=Daryoosh |last11=Fakharzadeh |first11=Mohammad |title=Design and Implementation of an Ultra-Low-Power ECG Patch and Smart Cloud-Based Platform |journal=TechRxiv |date=December 2021 |pages=5 |doi=10.36227/techrxiv.17003401|s2cid=244360958 |url=https://figshare.com/articles/preprint/Design_and_Implementation_of_an_Ultra-Low-Power_ECG_Patch_and_Smart_Cloud-Based_Platform/17003401 }}{{cite web |title=R-peak detection benchmark |url=https://sleepecg.readthedocs.io/en/stable/heartbeat_detection.html#performance-evaluation |website=sleepecg.readthedocs.io |access-date=31 March 2022 |language=en}}
For neurophysiological signals such as EEG, it supports microstates and frequency band analysis.{{Citation needed|date=March 2022}}
It also includes a comprehensive set of functions used for fractal physiology, allowing the computation of various measures of complexity (including entropy and fractal dimensions).{{cite journal |last1=Makowski |first1=Dominique |last2=Te |first2=An Shu |last3=Pham |first3=Tam |last4=Lau |first4=Zen Juen |last5=Chen |first5=S. H. Annabel |title=The Structure of Chaos: An Empirical Comparison of Fractal Physiology Complexity Indices Using NeuroKit2 |journal=Entropy |date=27 July 2022 |volume=24 |issue=8 |pages=1036 |doi=10.3390/e24081036|pmid=36010700 |pmc=9407071 |bibcode=2022Entrp..24.1036M |doi-access=free }}
Design
The software was designed to be accessible to users without programming experience, with the possibility of using high-level functions to run entire preprocessing or analysis routines.{{cite web |title=Biosignal processing for automatic emotion recognition |url=https://school.brainhackmtl.org/project/biosignalemotions/ |website=BrainHack School |access-date=18 May 2022 |language=en-us}}
import neurokit2 as nk
- Download example data
data = nk.data("bio_eventrelated_100hz")
- Preprocess the data (filter, find peaks, etc.)
processed_data, info = nk.bio_process(ecg=data["ECG"], rsp=data["RSP"], eda=data["EDA"], sampling_rate=100)
- Compute relevant features
results = nk.bio_analyze(processed_data, sampling_rate=100)
See also
{{Portal|Free and open-source software}}
Other open-source toolboxes for analysis of physiological signals include:
- Neurophysiological Biomarker Toolbox (MatLab)
- EEGLAB (MatLab)
- MNE-Python (Python)
Notes
:{{note|a}}As of May 18, 2022, GitHub indicates that the package has 644 stars, 47 contributors, and is used in 101 other open-source applications.{{cite web |title=NeuroKit2 - Popularity |url=https://github.com/neuropsychology/NeuroKit#popularity |website=GitHub |date=February 2021 |access-date=23 March 2022}}