tnbsclean
Description
tnbsclean is a Python package for preprocessing neurophysiological data.
It helps clean EEG, MEG, EMG, and ECG signals in MNE-Python by removing stimulation artifacts, and it supports converting Blackrock .nsx recordings into MNE Raw objects for seamless analysis.
Installation
You can install the package via pip from PyPI:
pip install tnbsclean
Example use for data cleaning from mne raw object
import tnbsclean as tnbs
# Example parameters
raw # Raw time series data in MNE's raw object format
half_win = 3 # Half window size around each stimulus (in samples) that will be chopped away from the artifact peak point
threshold = 2 # Threshold constant above which stimulus is considered significant
# Apply stimulus cleaning
raw_cleaned, spike_idxs = tnbs.get_stim_markers(raw, half_win, threshold) #cleans based on ECG, returns spike indices
Example use for converting nsx files mne raw object
# Example parameters for reading Blackrock data
folder = r'/path/to/data'
aux_chann = ['L_EMG1', 'R_EMG1', 'ECG']
chan_type_map = {'L_EMG1': 'emg', 'R_EMG1': 'emg', 'ECG': 'ecg'}
file_type = 'hub'
extension = 'ns3'
# Load raw data
raw = tnbs.read_blackrock(folder, aux_chann, chan_type_map, file_type, extension)
Metadata
Release files for tnbsclean 1.20
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tnbsclean-1.20-py3-none-any.whl | Python 3 | none | any | Details |
Release files / tnbsclean-1.20-py3-none-any.whl
| Download URL | tnbsclean-1.20-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d1e7928651c11da987992599a008168c06f99bce70d4cc12ec8095d9dc03dde
|
|
BLAKE2b-256 checksum How to use checksums |
f6c49459d15a892cac929f5fdc400a121ffe67f2d6a97fa04f5d852d7b68bf09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|