Parse, validate, and convert GE Healthcare MUSE XML cardiology ECG data.
Research only. This crate is interoperability work-in-progress. It is not for use in any production system and not suitable for medical use. See Disclaimers below.
A Rust library and command-line tool for working with GE Healthcare MUSE XML files — the proprietary format used by MUSE / MUSE NX cardiology systems to store resting ECG (electrocardiogram) test data.
Capabilities:
- Parse MUSE XML files into strongly-typed Rust structs.
- Convert MUSE XML to JSON for interoperability with other systems.
- Convert JSON back to MUSE XML with round-trip fidelity.
- Decode and re-encode base64 waveform sample data.
- Verify per-lead
LeadDataCRC32checksums. - Display human-readable summaries from the command line.
From the crate root:
cargo install --path .Or add the library to another project:
[dependencies]
ge-healthcare-muse = "0.1"Convert MUSE XML to JSON (and back):
ge-healthcare-muse convert --input ecg.xml --output ecg.json
ge-healthcare-muse convert --input ecg.json --output ecg.xmlDisplay a summary:
ge-healthcare-muse info --input ecg.xmlValidate parse + CRC32 for all leads:
ge-healthcare-muse validate --input ecg.xml --verify-crcFormat is auto-detected by extension (.xml or .json, case-insensitive).
The CLI exits 0 on success, 1 on parse failure or CRC mismatch.
See doc/cli-reference.md for the full reference.
use std::path::Path;
use ge_healthcare_muse::{io_xml, io_json, waveform};
// Read a MUSE XML file.
let ecg = io_xml::read_xml_file(Path::new("ecg.xml")).unwrap();
// Inspect.
println!("Patient ID: {}", ecg.patient_demographics.patient_id);
println!("Waveforms : {}", ecg.waveforms.len());
// Convert to JSON.
let json = io_json::to_json(&ecg).unwrap();
// Convert back to MUSE XML.
let xml = io_xml::to_xml(&ecg).unwrap();
// Decode a lead's samples and verify its CRC32.
if let Some(lead) = ecg.waveforms.first().and_then(|w| w.lead_data.first()) {
let samples: Vec<i16> = waveform::decode_waveform_data(lead).unwrap();
waveform::verify_lead_crc32(lead).unwrap();
println!("{} samples for lead {}", samples.len(), lead.lead_id);
}See doc/library-api-guide.md and
doc/examples.md for more.
| Module | Purpose |
|---|---|
error |
MuseError enum (single unified error type). |
patient |
PatientDemographics. |
test_demographics |
TestDemographics. |
order |
OrderInformation. |
diagnosis |
Diagnosis, DiagnosisStatement. |
waveform |
Waveform, LeadData, base64 + CRC32 utilities. |
measurements |
RestingEcgMeasurements. |
resting_ecg |
RestingEcg top-level document struct. |
io_xml |
Read/write MUSE XML files. |
io_json |
Read/write JSON files. |
- Root element:
<RestingECG>. - Declared encoding:
windows-1252. The crate currently reads as UTF-8; files with non-ASCII windows-1252 bytes need external transcoding. - DOCTYPE:
RestingECG SYSTEM "restecg.DTD"(parser is non-validating). - Waveform samples: base64 → little-endian → 2-byte signed integers
(
i16). - Typical sample rate: 500 Hz. Typical amplitude resolution: 4.88 µV/bit.
- CRC32: IEEE 802.3 / zlib polynomial, over the raw decoded bytes (not the base64 text).
Full format details: doc/muse-xml-format.md
and doc/waveform-data.md.
User-facing guides live in doc/:
- Getting started
- CLI reference
- Library API guide
- Data structures
- Waveform data
- MUSE XML format
- Error handling
- Examples
- Architecture
- Testing
- Contributing
The normative specification is spec.md. Agent-facing
operational guidance lives in AGENTS.md and
AGENTS/.
- Implementation-complete against spec version 0.1.0.
- 56 tests pass (40 unit + 12 integration + 4 doc-tests).
cargo clippy --all-targets -- -D warningsclean.cargo doc --no-depsclean.- Canonical example:
examples/example.xml(12 leads × 2 waveforms, all CRC32 verified).
Known intentional gaps (see AGENTS/roadmap.md):
<MeasurementMatrix>and<PacemakerSpikes>not yet modeled.PharmaDataandExtraQuestionsare empty placeholders.- Windows-1252 transcoding not implemented (UTF-8 read path only).
- The program is a draft, a work in progress, for interoperability research purposes.
- The program is NOT for use in any production system, and NOT suitable for medical use.
- Use this work at your own risk.
- The work is generated by Claude Code AI.
- Constructive feedback welcome.
- This work is independent and exists for the purpose of interoperability with other programs.
- This work is not by the company GE Healthcare, makers of the MUSE software, apps, and services.
- GE Healthcare and MUSE are trademarks of General Electric, Inc. in the United States and other countries.
- Package:
ge-healthcare-muse-rust-crate - Version: 0.1.0
- Created: 2026-02-25T17:57:20Z
- Updated: 2026-05-24T00:00:00Z
- License: MIT or Apache-2.0 or GPL-2.0 or GPL-3.0 or BSD-3-Clause or contact us for more
- Contact: Joel Parker Henderson joel@joelparkerhenderson.com