Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .venv/Lib/site-packages/pylsl/lib/lsl.dll
Binary file not shown.
13 changes: 13 additions & 0 deletions plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
1. **Analyze LabRecorder's XDF Specification and Writing Logic**:
- The `.xdf` writing specification requires generating chunk types like FileHeader, StreamHeader, StreamFooter, Boundary, Samples, and ClockOffset.
- Variables like lengths require `varlen_int` representation and little-endian conversions.
2. **Review MNE's Implementation**:
- The logger currently saves an XDF file via `raw.save(fif_filename)` via MNE or PyXDF, but in MNE, `.save()` typically writes `.fif` or throws, hence why `fif_filename` renaming occurs. Saving actual `.xdf` compliant with LabRecorder requires explicit encoding.
3. **Write a Python module `xdf_writer.py`**:
- Re-implement the equivalent C++ `XDFWriter` chunk generation in Python.
- Write chunks according to standard: `FileHeader`, `StreamHeader`, `Samples`.
4. **Integration**:
- Replace `save_xdf_file` in `logger_app.py` to use our custom Python XDF exporter to export `self.recorded_data`.
5. **Testing**:
- Write robust tests to systematically programmatically output `.xdfs` and ensure their structure correctly implements the C++ logic format from LabRecorder. Use `pyxdf` to test that they are loadable.
6. **Pre-commit**: Complete pre-commit steps.
2 changes: 2 additions & 0 deletions test_xdfwriter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include <iostream>
int main() { return 0; }
9 changes: 9 additions & 0 deletions tests/test_xdf_export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import pytest
import os
import pyxdf
import numpy as np

def test_xdf_validity():
# To test if the python repository produces the same xdf as LabRecorder,
# we need a python script that saves xdf directly rather than .fif
pass