Skip to main content

No project description provided

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tnbsclean-1.20-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file tnbsclean-1.20-py3-none-any.whl.

File metadata

  • Download URL: tnbsclean-1.20-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for tnbsclean-1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 1d1e7928651c11da987992599a008168c06f99bce70d4cc12ec8095d9dc03dde
MD5 e9baafebb34be5bcb040e266029eb8e8
BLAKE2b-256 f6c49459d15a892cac929f5fdc400a121ffe67f2d6a97fa04f5d852d7b68bf09

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page