tpt-medical
RustFully open-source, pure-Rust computational biomechanics and medical device simulation engine, compiling to WASM for zero-cloud, browser-based surgical planning.
Languages
tpt-medical
A fully open-source, pure-Rust computational biomechanics and medical device simulation engine, compiling to WebAssembly for zero-cloud, browser-based surgical planning.
Organization: TPT Solutions (tpt-solutions) ·
License: MIT OR Apache-2.0 ·
Crate prefix: tpt-med-*
Why
Medical device design and surgical planning require FDA-mandated FEA and
fluid dynamics, but legacy tools are proprietary black boxes (Abaqus, Ansys),
carry academic license traps (FEBio, OpenSim), or demand cloud upload of
patient DICOM data (HIPAA/GDPR risk). tpt-medical eliminates all three:
- No license barrier — permissive dual licensing, no copyleft contamination.
- Zero-cloud patient privacy — compiles to WASM; imaging and simulation run entirely in the browser or on a local hospital workstation.
- Reproducible FDA submissions — open, auditable mathematics with 21 CFR Part 11 audit trails and ASME V&V 40 credibility tooling.
Crates
Every crate is documented individually: a comprehensive README (overview, features, conventions, runnable usage, API table, verification evidence, dependencies, known limitations) and a Keep a Changelog-format CHANGELOG recording what changes for its consumers. Crates version and release independently, so those two files are the per-crate source of truth.
| Crate | Description | Docs | Status |
|---|---|---|---|
tpt-med-core | Patient models, anatomical coordinate systems, HIPAA-safe audit traits | README · CHANGELOG | 🚧 Alpha |
tpt-med-units | Type-safe unit system (mm, MPa, N, g/cm³) | README · CHANGELOG | 🚧 Alpha |
tpt-med-geometry | Geometry primitives, anatomical transforms | README · CHANGELOG | 🚧 Alpha |
tpt-med-wasm | WASM bindings for the in-browser stack | README · CHANGELOG | 🚧 Alpha |
tpt-med-dicom | DICOM parsing & Hounsfield Unit mapping | README · CHANGELOG | 🚧 Alpha |
tpt-med-nifti | NIfTI-1 volume parsing (research-space imaging) | README · CHANGELOG | 🚧 Alpha |
tpt-med-meshing | Segmentation masks & voxel-to-hex meshing | README · CHANGELOG | 🚧 Alpha |
tpt-med-biomechanics | Voxel hexahedral FEM solver core | README · CHANGELOG | 🚧 Alpha |
tpt-med-tissue | Hyperelastic tissue models (Neo-Hookean, Mooney-Rivlin, Ogden, HGO) | README · CHANGELOG | 🚧 Alpha |
tpt-med-bone | Bone mechanics & Wolff's-Law remodeling | README · CHANGELOG | 🚧 Alpha |
tpt-med-viscoelastic | Prony-series viscoelasticity | README · CHANGELOG | 🚧 Alpha |
tpt-med-cartilage | Biphasic/poroelastic cartilage models | README · CHANGELOG | 🚧 Alpha |
tpt-med-hemodynamics | Navier–Stokes CFD, WSS & OSI | README · CHANGELOG | 🚧 Alpha |
tpt-med-cardiovascular | Windkessel models, FFR | README · CHANGELOG | 🚧 Alpha |
tpt-med-stents | Nitinol superelasticity, stent deployment | README · CHANGELOG | 🚧 Alpha |
tpt-med-orthopedics | Micromotion & stress-shielding analysis | README · CHANGELOG | 🚧 Alpha |
tpt-med-wear | Archard / Cross-Land wear laws | README · CHANGELOG | 🚧 Alpha |
tpt-med-surgical-planning | Osteotomy cuts, virtual surgery | README · CHANGELOG | 🚧 Alpha |
tpt-med-implant-sizing | Automated implant sizing from anatomy | README · CHANGELOG | 🚧 Alpha |
tpt-med-audit | Cryptographic audit signing & verification | README · CHANGELOG | 🚧 Alpha |
tpt-med-fda | 21 CFR Part 11 audit trails | README · CHANGELOG | 🚧 Alpha |
tpt-med-vv40 | ASME V&V 40 credibility assessment | README · CHANGELOG | 🚧 Alpha |
tpt-med-examples | Runnable end-to-end example binaries | README · CHANGELOG | 🚧 Alpha |
tpt-med-benches | Workspace benchmark suite | README · CHANGELOG | 🚧 Alpha |
Quick Start
Build the workspace and run the Phase 1 milestone CLI, which converts a DICOM CT series into a patient-specific bone mesh CSV:
cargo run -p tpt-med-examples --bin dicom-to-mesh -- \
test-data/dicom/synthetic_ct --output femur_mesh.csv --threshold 200
Use the solver stack in Rust:
use std::path::Path;
use tpt_med_dicom::DicomSeries;
use tpt_med_meshing::{MedicalMesher, SegmentationMask};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let series = DicomSeries::load_from_dir(Path::new("test-data/dicom/synthetic_ct"))?;
let mask = SegmentationMask::threshold_hu(&series, 200.0);
let mesh = MedicalMesher::default().voxels_to_hex_mesh(&mask)?;
mesh.write_csv(Path::new("bone_mesh.csv"))?;
Ok(())
}
Zero-Cloud Patient Privacy
All simulations run entirely locally; the WASM build (tpt-med-wasm) runs the
full imaging-to-simulation pipeline inside the browser. Patient DICOM scans
never leave the hospital network. The repository's test data is synthetic
only — never commit real patient data.
Browser apps under web/: the surgical planning viewer,
the white-label <tpt-stent-simulator> web component, and the
end-to-end CT → mesh → FEM → stent in-browser demo
(scripts/build-web.sh builds the engine).
Browser Demos
Build the engine glue once, then serve the repository root:
./scripts/build-web.sh # or scripts\build-web.ps1 on Windows
python -m http.server 8080
- Viewer —
http://localhost:8080/web/viewer/: upload a DICOM series (or the synthetic CT demo), mesh it, solve a stance load, and inspect von Mises stress in WebGL2; plus in-browser stent deployment. - White-label stent simulator —
http://localhost:8080/web/stent-simulator/: the embeddable<tpt-stent-simulator>custom element with live branding controls (seeweb/stent-simulator/README.md).
Try it without installing anything: a live build of the viewer is published to GitHub Pages on every merge to
masterthat touches the engine or the web assets, against the committed synthetic CT data. See the repository's Demo workflow for the published URL, or run it locally with the two commands above.
Verification & Validation
Following ASME V&V 40, every solver ships with verification tests against
analytical solutions (uniaxial tension, Euler–Bernoulli beam deflection,
Poiseuille flow, Prony relaxation) and curated golden reference datasets under
test-data/golden/. Standards automation targets ASTM
F2028 / F2079 / F2394 and ISO 7206 / 14879.
Substrate
Built on the TPT engineering stack (pinned in the root Cargo.toml):
tpt-math (fixed-size linalg, optimization, probability, signal filtering),
tpt-engineering (biocompatible material libraries), tpt-science
(bio-fluid dynamics), and tpt-fem (nonlinear FEM, contact). Medical crates
are deliberately dependency-light (std only) to keep the WASM footprint
small; substrate integration points are documented per crate and in the
RFCs.
Contributing
Bug reports, feature requests, RFC proposals, and documentation corrections are all welcome, and all arrive as GitHub issues — this project does not accept external pull requests. See CONTRIBUTING.md for the process and the RFC process for significant design changes. New constitutive models, solver algorithms, and regulatory features require an accepted RFC, and numerical behaviour is treated as API. Everything is DCO-signed and CLA-free.
License
Licensed under either of
- MIT license (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)
at your option.
Regulatory Disclaimer
This software is for research and development purposes only. It is not cleared or approved by the FDA or any other regulatory body for clinical diagnostic or treatment use. Regulatory submissions require validation under ASME V&V 40 and applicable standards.