med64

Headless Rust toolkit for MED64 electrophysiology recordings: read/write .modat / .modax / .dat, run filter → spike → burst analysis (ASDR, BOTCC, synchrony), assay modules (PSA, PDM, beat, …), spatial spike-rate maps, and export CSV, HTML, SVG, PNG, BMP, HDF5, and native analysis logs.
This crate is a headless compute/export library. Optional interactive HTML UI reports are included; it is not a desktop GUI replacement.
Features
- I/O —
.modat/.modax/.dat/.dax,.mofloworkflows, CSV/JSON convert - Burst analysis — filter → spikes → single/multi bursts → ASDR → BOTCC → synchrony → result table → dose series → native analysis log layout
- Assay modules — spike detector (+ V1/V2/V3), PDM, PSA/STFT, beat/FPD, LTP, CSD, wavelet, beta/rectification, pacing, FBO, PAID, connection map, PETH, multiband, …
- Spike-rate maps — rate maps, well packages, Poincare, channel/speed/STV tables, 384-ch well plate HTML
- Performance — rayon parallelism; macOS Accelerate vDSP FFT (
acceleratefeature) - Tests — native goldens and smoke tests on sample / synthetic fixtures
Install
[]
= "0.0.2"
Default features enable analysis, bursts, HDF5, Accelerate (macOS), and the CLI dependencies used by the library. Disable unused features to shrink builds:
= { = "0.0.2", = false, = ["analysis", "bursts"] }
CLI
The CLI uses clap (med64 <command> --help for per-command flags). Unknown flags are rejected. Shorthand still works: med64 file.modat → diagnose; med64 file.moflo → workflow.
Common commands: analyze, burst-pipeline, burst-export, dose, create-image, spike-detector, rate-map, workflow, log, fbo-batch, convert, chart, examples.
Example outputs
Pre-generated sample charts, CSV bundles, and HTML reports are in ../examples/. Open ../examples/index.html in a browser for a guided tour.
| Directory | Contents |
|---|---|
../examples/charts/ |
Burst analysis PNG/SVG/EPS/BMP (ASDR, BOTCC, raster, …) |
../examples/analysis/ |
Full analysis CSV bundle |
../examples/burst_pipeline/ |
Interactive burst-pipeline HTML charts |
../examples/rate_map/ |
Spatial spike-rate heatmap HTML |
../examples/spectrum/ |
Channel 0 power spectrum CSV |
../examples/voltage/ |
Voltage STFT colormap HTML + PNG |
../examples/spike_detector/ |
Spike detector assay exports |
Regenerate (requires sample recordings in ../data/):
Library quick start
use *;
Burst analysis facade (standalone functions):
use ;
SVG charts: med64::svg::{render_line_svg, write_line_svg, SvgChartOptions, SvgSeries}.
Feature flags
| Flag | Default | Purpose |
|---|---|---|
analysis |
yes | IIR filters, spike detection |
bursts |
yes | Single/multi-channel bursts + ASDR |
correlation |
yes | BOTCC + synchrony |
histograms |
yes | ISI / amplitude histograms |
workflow |
yes | .moflo compute runner |
chart |
yes | HTML Chart.js reports |
diagnostics |
yes | Channel statistics |
layouts |
yes | 384-ch well plate / Basic4x4 / QuadII |
parallel |
yes | rayon |
hdf5 |
yes | Spike / SIS-style HDF5 |
accelerate |
yes | macOS vDSP FFT |
blas |
no | alias for accelerate |
slow-goldens |
no | long analysis goldens |
full |
no | alias for default |
Testing
# Optional long goldens (when gated):
MED64_FULL_GOLDEN=1
Native golden / smoke tests cover analysis, toolkit assays, formats, rate maps, and utilities against data/ fixtures.
Development
CI runs fmt, clippy -D warnings, full cargo test --features default, and cargo doc -D warnings (see ../.github/workflows/ci.yml). Set repository in Cargo.toml before publishing to crates.io.
Docs
See also CHANGELOG.md.
Limitations
- No desktop / live OpenGL UI (HTML/SVG/CSV packages instead)
- No license/activation or GPU offload path
- Hardware-captured 384-ch
.modaxis not redistributed; usewrite_synthetic_well384_modax/data/synthetic_presto384.modaxfor layout tests
License
MIT — see LICENSE (also packaged as LICENSE-MIT for crates.io).