NeuroKit
- 2 min read
- 3 chapters
Related on Lably
Through Open source, Physiology and Python (programming language)
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:
- 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).
Sign in to keep reading
2 more chapters are free with a Lably account.
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.
It enables the computation of Heart Rate Variability (HRV) and Respiratory Variability (RRV) metrics.
It also implements a variety of different algorithms to detect R-peaks and other QRS waves, including an efficient in-house R-peak detector.
For neurophysiological signals such as EEG, it supports microstates and frequency band analysis.
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).
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.
<span id="mwUw"></span><span class="kn" id="mwVA">import</span> <span class="nn" id="mwVQ">neurokit2</span> <span class="k" id="mwVg">as</span> <span class="nn" id="mwVw">nk</span> <span class="c1" id="mwWA"># Download example data</span> <span class="n" id="mwWQ">data</span> <span class="o" id="mwWg">=</span> <span class="n" id="mwWw">nk</span><span class="o" id="mwXA">.</span><span class="n" id="mwXQ">data</span><span class="p" id="mwXg">(</span><span class="s2" id="mwXw">"bio_eventrelated_100hz"</span><span class="p" id="mwYA">)</span> <span class="c1" id="mwYQ"># Preprocess the data (filter, find peaks, etc.)</span> <span class="n" id="mwYg">processed_data</span><span class="p" id="mwYw">,</span> <span class="n" id="mwZA">info</span> <span class="o" id="mwZQ">=</span> <span class="n" id="mwZg">nk</span><span class="o" id="mwZw">.</span><span class="n" id="mwaA">bio_process</span><span class="p" id="mwaQ">(</span><span class="n" id="mwag">ecg</span><span class="o" id="mwaw">=</span><span class="n" id="mwbA">data</span><span class="p" id="mwbQ">[</span><span class="s2" id="mwbg">"ECG"</span><span class="p" id="mwbw">],</span> <span class="n" id="mwcA">rsp</span><span class="o" id="mwcQ">=</span><span class="n" id="mwcg">data</span><span class="p" id="mwcw">[</span><span class="s2" id="mwdA">"RSP"</span><span class="p" id="mwdQ">],</span> <span class="n" id="mwdg">eda</span><span class="o" id="mwdw">=</span><span class="n" id="mweA">data</span><span class="p" id="mweQ">[</span><span class="s2" id="mweg">"EDA"</span><span class="p" id="mwew">],</span> <span class="n" id="mwfA">sampling_rate</span><span class="o" id="mwfQ">=</span><span class="mi" id="mwfg">100</span><span class="p" id="mwfw">)</span> <span class="c1" id="mwgA"># Compute relevant features</span> <span class="n" id="mwgQ">results</span> <span class="o" id="mwgg">=</span> <span class="n" id="mwgw">nk</span><span class="o" id="mwhA">.</span><span class="n" id="mwhQ">bio_analyze</span><span class="p" id="mwhg">(</span><span class="n" id="mwhw">processed_data</span><span class="p" id="mwiA">,</span> <span class="n" id="mwiQ">sampling_rate</span><span class="o" id="mwig">=</span><span class="mi" id="mwiw">100</span><span class="p" id="mwjA">)</span>

