Skip to main content

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)

Table of built distributions (wheels) for tnbsclean 1.20
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.20 This release

1 release file

1.10

1 release file

1.8

2 release files

1.7

2 release files

1.6

2 release files

1.5

2 release files

1.4

2 release files

1.3

2 release files

1.2

2 release files

1.1

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

1 release file

0.1.7

2 release files

0.1.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page