# 临析Trodes **Repository Path**: lgl-linshu/Linxi-Trodes ## Basic Information - **Project Name**: 临析Trodes - **Description**: 临析Trodes,以python方式操作SpikeGadgets - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-24 - **Last Updated**: 2026-09-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Linxi-Trodes Linxi-Trodes is forked from [Trodes](https://bitbucket.org/mkarlsso/trodes) Now this repo provides a python implemented SpikeGadgets DIO data extractor. Please follow the instruction to use it. Install the package in editable mode: ```bash pip install -e . ``` Use it with a python script: ```python from linxi_trodes import TrodesRecParser # Default mode (legacy behavior): only state transitions are kept. parser = TrodesRecParser("path/to/your/recording.rec") result = parser.extract_dio(output_dir="path/to/save/dio/") # result[channel_name] -> (timestamps: np.uint32[N], states: np.uint8[N]) # Raw packet-sample mode: one record per valid packet, no deduplication. # Useful for waveform-style analysis of every digital sample. result_raw = parser.extract_dio( output_dir="path/to/save/dio/", return_type="raw", ) # result_raw[channel_name] -> (timestamps: np.uint32[N], states: np.bool_[N]) ``` The `return_type` selector chooses the semantics of the returned arrays and the `.dat` files written under `output_dir`. Omitting the argument preserves the legacy event-extraction behavior (default is `"event"`). Both modes share the same on-disk record layout — five little-endian bytes per record (``); the difference is only which packets get recorded: - `return_type="event"` — only state-transition edges are written (default). - `return_type="raw"` — every valid-packet sample is written (no dedup). Use it with a simple CLI: ```bash python src/linxi_trodes/export_dio.py \ "path/to/your/recording.rec" \ "path/to/save/dio/" \ [--only-export-enabled-dio] ```