TMSi Poly5 file reader for MNE-Python.
A bridge between TMSi Poly5 biosignal files and the MNE-Python ecosystem for EEG/MEG analysis.
- Read TMSi Poly5 binary files (version 2.03)
- Convert to MNE Raw objects for seamless integration
- Support for multiple formats: Poly5, EDF, BrainVision, CSV
- Type hints and modern Python practices
- Progress callbacks for large file loading
# Using uv (recommended)
uv add mne-poly5
# Using pip
pip install mne-poly5
# Development install
uv sync --devfrom mne_poly5 import read_raw_poly5
# Load Poly5 file as MNE Raw object
raw = read_raw_poly5("recording.Poly5")
# Use standard MNE operations
raw.filter(1, 40)
raw.plot()from mne_poly5 import FileLoader
# Load any supported format
loader = FileLoader("data.vhdr")
raw = loader.raw
# For BrainVision files, get events
events, event_id = loader.get_events()from mne_poly5 import Poly5Reader
# Direct access to Poly5 data
reader = Poly5Reader("recording.Poly5")
print(f"Channels: {reader.num_channels}")
print(f"Sample rate: {reader.sample_rate} Hz")
print(f"Duration: {reader.num_samples / reader.sample_rate:.1f} s")
# Access raw numpy array
data = reader.samples # Shape: (channels, samples)from mne_poly5 import Poly5Reader
def show_progress(progress: float) -> None:
print(f"\rLoading: {progress * 100:.1f}%", end="")
reader = Poly5Reader("large_file.Poly5", progress_callback=show_progress)| Format | Extension | Reader |
|---|---|---|
| TMSi Poly5 | .Poly5 |
Native |
| European Data Format | .edf |
MNE |
| BrainVision | .vhdr |
MNE |
| CSV | .csv |
Pandas + MNE |
Read a Poly5 file and return an MNE Raw object.
Low-level Poly5 binary file reader.
Unified loader for multiple biosignal formats.
# Clone the repository
git clone https://github.com/yourusername/mne-poly5.git
cd mne-poly5
# Install with dev dependencies
uv sync --dev
# Run tests
uv run pytest
# Type checking
uv run mypy src/
# Linting
uv run ruff check src/MIT License - see LICENSE for details.
- MNE-Python for the excellent neurophysiology analysis framework
- TMSi for the Poly5 format specification