# dsdiff **Repository Path**: graviton/dsdiff ## Basic Information - **Project Name**: dsdiff - **Description**: dose diff - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-01 - **Last Updated**: 2026-06-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # dsdiff `dsdiff` 是一个 Rust/Tauri 桌面工具, 用于查看和对比 TPS (Treatment Planning System) plan 的 dose 计算结果. 当前支持: - 选择一个 plan 输出目录, 查看其中的 dose `.bin` 文件. - 选择两个 plan 输出目录, 按同名 `.bin` 文件展示 `right - left` dose diff, left 作为 base. - 使用 Axial / XY, Coronal / XZ, Sagittal / YZ 三视图查看 slice. - 三视图联动: 点击任意 slice 锁定 voxel, 自动同步另外两个视图. - 鼠标 hover 显示 voxel index, 物理坐标和当前 dose/diff value. - 支持缩放、平移、color map、Grid overlay、reload 和 reset slice bar. 更多功能和实现细节见 `docs/design.md`. ## 输入格式 输入 `algorithm/` 下的文件, 比如 `/data/tps/work/case_10/plan_8/radiationSet_10/algorithm` 典型文件: ```text beamgroup_dose_phy_23034.bin beamgroup_dose_rbe_23034.bin beam_dose_phy_31204.bin configlc.json energy_spot_info_beam_31204.json ``` 配置文件按以下优先级查找: 1. `configlc.json` 2. `config.json` dose `.bin` 文件格式: - 原始二进制数组. - big-endian `float32`. - shape 从配置文件的 `dose_grid.num_voxels` 读取. - 按 Fortran order 展平. 例如: ```json { "dose_grid": { "num_voxels": [191, 148, 257] } } ``` 对于 `[nx, ny, nz]`, 线性索引为: ```text idx = x + nx * (y + ny * z) ``` ## 依赖 需要安装: - Rust / Cargo - Bun - Windows WebView2 Runtime(Windows 上 Tauri 需要) 前端依赖使用 Bun 管理: ```powershell bun install ``` Rust 依赖由 Cargo 管理, 位于 `src-tauri/`. ## 开发 启动 Tauri 桌面应用: ```powershell bun run tauri dev ``` 前端类型检查和生产构建: ```powershell bun run build ``` Rust 测试: ```powershell cd src-tauri cargo test ``` 更多 Bun/npm 开发、调试、关闭测试进程和打包命令见 `docs/dev-cmd.md`. ## 构建 构建生产版 Tauri 应用: ```powershell bun run tauri build ``` 生成简单 zip 分发包: ```powershell bun run package:zip ``` 构建和 zip 分发细节见 `docs/design.md`. ## 项目结构 ```text src/ React/Vite 前端 src-tauri/ Rust/Tauri 后端 src-tauri/src/lib.rs Tauri commands, dose 读取, 缓存和 slice 逻辑 scripts/ 辅助脚本, 包括 zip 分发打包 docs/taskin.md 原始任务说明 docs/dev-cmd.md Windows 开发, 调试, 关闭进程和打包命令 docs/design.md 功能, 构建和性能设计细节 compare_plan_dirs.py Python 参考实现 regress/ 现有 Python 对比工具 ``` ## 当前范围 当前版本聚焦 dose `.bin` 的 view 和 diff. `energy_spot_info_beam_*.json` 的 spot 可视化暂未实现, 格式说明见 `docs/taskin.md`.