Skip to main content

This library is designed to build visualization tools for biosignals such as EEG or ECG.

Project description

README: Signal Visualization Library

Overview

This library simplifies the process of managing and visualizing multi-channel signal data. It provides a high-level API to encapsulate signal data handling and visualization through flexible and intuitive classes.

The library is designed for data scientists, engineers, and researchers working with signal data, enabling them to focus on analysis and visualization without worrying about low-level implementation details.

Features

  • Streamlined Signal Management: Encapsulate multi-channel signal data with metadata such as sampling frequency and scale factors.
  • Dynamic Viscd ualization: Customize signal plots with channel-specific settings (e.g., colors, labels, and scales).
  • Interactive Viewer: Navigate through signals with keyboard controls and timestamps for quick analysis.

Installation

pip install BIOViewer

Usage

1. Signal Creation

Create a Signal instance to encapsulate your data and its display settings:

import numpy as np
from signal_module import Signal

# Generate example data (6 channels, 1000 time steps)
data = np.random.randn(6, 1000)

# Initialize the signal with custom settings
signal = Signal(
    data=data,
    fs=128,
    scale_factor='auto',
    y_ticks=['Ch1', 'Ch2', 'Ch3', 'Ch4', 'Ch5', 'Ch6'],
    unit='mV',
    colors='rgbcmy',
    linewidth=1,
    show_scale=True
)

2. Visualize with the Viewer

Combine multiple signals and visualize them interactively:

from signal_module import Viewer

# Create signals
signal1 = Signal(data=data, fs=128)
signal2 = Signal(data=data, fs=128, colors='bbbkbr')

# Initialize the viewer
viewer = Viewer(
    signals=[signal1, signal2],
    figsize=(14, 4),
    t_start=0,
    windowsize=15,
    stepsize=13,
    timestamps=[10, 50, 100]
)

3. Keyboard Controls

  • Right Arrow: Move forward in time.
  • Left Arrow: Move backward in time.
  • n / b: Navigate to the next/previous timestamp.
  • z: Save the current view as an image.

Example

from signal_module import Signal, Viewer
import numpy as np

# Load example signal data
data = np.random.randn(6, 1000)
timestamps = [3, 7, 12, 21]

# Create a signal
signal = Signal(data=data, fs=128, scale_factor=220, unit='mV')

# Visualize using Viewer
viewer = Viewer(
    signals=[signal],
    timestamps=timestamps,
    windowsize=10
)

Contributing

Contributions are welcome! Feel free to submit a pull request or file an issue.

Support

For questions or issues, open a GitHub issue or contact me at [moritz.alkofer@protonmail.com].

Project details


Download files

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

Source Distribution

bioviewer-0.2.3.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

bioviewer-0.2.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file bioviewer-0.2.3.tar.gz.

File metadata

  • Download URL: bioviewer-0.2.3.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.6

File hashes

Hashes for bioviewer-0.2.3.tar.gz
Algorithm Hash digest
SHA256 0a482fc6234beaff7eb5ec9602f4ff394bf3f672c3fb0e8010b8136cb4abced8
MD5 92c5d259cf6501ac91dd679ef5b14228
BLAKE2b-256 007236fd447f4015f331687d5ddedeb42ce3797485952bda21490f2030cedf0e

See more details on using hashes here.

File details

Details for the file bioviewer-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: bioviewer-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.6

File hashes

Hashes for bioviewer-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f5cf6bf474289f3f3446b8b21e70d5204d09c5cbefc21dcf4d05c5d355b9b0b9
MD5 68669e009618e06c10c894703c34c888
BLAKE2b-256 ac585b351786d14e7c5803f27ad54bffa27896e2f77b7eb7917a8190be10ba58

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