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.10-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tnbsclean-1.10-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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 c5341c586de1291a494568fac13ab2c12f28dcbbe3cd50c26f96b345379290f9
MD5 67d5397ef90090efd05eeeea3f243ed2
BLAKE2b-256 a8bd071485a13d4c615ffa6186a117df64399808f94e15b544f54e8c81a328e2

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