56 lines
1.9 KiB
Rust
56 lines
1.9 KiB
Rust
//! Server layer for `RustyTorch`++ medical demos
|
|
//!
|
|
//! This crate provides the API layer between the Tauri frontend and
|
|
//! various medical PINN backends. It manages simulation state, handles
|
|
//! inference requests, and provides a clean interface for IPC commands.
|
|
//!
|
|
//! # Hemodynamics Example
|
|
//!
|
|
//! ```rust,ignore
|
|
//! use rtx_hemodynamics_server::{HemodynamicsService, ServiceConfig};
|
|
//!
|
|
//! let service = HemodynamicsService::new(ServiceConfig::default()).unwrap();
|
|
//! service.initialize(VesselParams::default()).await.unwrap();
|
|
//! let fields = service.query_fields(&points, 0.0).await.unwrap();
|
|
//! ```
|
|
//!
|
|
//! # MRE Elastography Example
|
|
//!
|
|
//! ```rust,ignore
|
|
//! use rtx_hemodynamics_server::{MreService, MreServiceConfig};
|
|
//!
|
|
//! let service = MreService::new(MreServiceConfig::default());
|
|
//! service.initialize_phantom(PhantomType::SingleTumor).await.unwrap();
|
|
//! let loss = service.step().await.unwrap();
|
|
//! let snapshot = service.snapshot().await.unwrap();
|
|
//! ```
|
|
//!
|
|
//! # Thermal Ablation Bioheat Example
|
|
//!
|
|
//! ```rust,ignore
|
|
//! use rtx_hemodynamics_server::{BioheatService, BioheatServiceConfig};
|
|
//! use bioheat_shared::SimulationParams;
|
|
//!
|
|
//! let service = BioheatService::new(BioheatServiceConfig::default());
|
|
//! service.initialize(SimulationParams::liver_default()).await.unwrap();
|
|
//! let loss = service.step().await.unwrap();
|
|
//! let snapshot = service.snapshot().await.unwrap();
|
|
//! ```
|
|
|
|
#![forbid(unsafe_code)]
|
|
#![warn(missing_docs)]
|
|
|
|
mod bioheat_service;
|
|
mod error;
|
|
mod mre_service;
|
|
mod service;
|
|
mod slidescope_service;
|
|
mod state;
|
|
|
|
pub use bioheat_service::{BioheatMetrics, BioheatService, BioheatServiceConfig};
|
|
pub use error::{ServerError, ServerResult};
|
|
pub use mre_service::{MreMetrics, MreService, MreServiceConfig};
|
|
pub use service::{HemodynamicsService, ServiceConfig};
|
|
pub use slidescope_service::{SlidescopeService, SlidescopeServiceConfig};
|
|
pub use state::{SimulationHandle, SimulationStatus};
|