Files
Head_CT_Morph/工程分析/测试方案-2026-05-08-02-36-12.md

95 lines
2.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 测试方案
开始时间2026-05-08-02-36-12
## 本次方案路径
`工程分析/测试方案-2026-05-08-02-36-12.md`
## 测试范围
- STL 上传接口。
- ASCII STL 和 binary STL 解析。
- STL 与 DICOM 切片相交 mask 生成。
- 模型切分开启后起点帧/终点帧双图显示。
- 双端点进度条起点/终点可交叉。
- 普通 DICOM 阅览不受影响。
- 前端类型检查、构建和 Python 语法检查。
- 重新部署后访问验证。
## 测试命令
Python 语法检查:
```bash
python -m py_compile web_backend.py head_extension_app.py
```
前端类型检查:
```bash
cd WebSite
npm run lint
```
前端构建:
```bash
cd WebSite
npm run build
```
后端函数级测试建议:
```bash
python - <<'PY'
from web_backend import parse_stl_bytes
sample = b'''solid demo
facet normal 0 0 1
outer loop
vertex 0 0 0
vertex 10 0 0
vertex 0 10 0
endloop
endfacet
endsolid demo
'''
triangles = parse_stl_bytes(sample)
print(triangles.shape)
PY
```
部署验证:
```bash
curl -I --max-time 5 http://192.168.3.11:3005/
curl -s --max-time 10 "http://127.0.0.1:8787/api/library/reformat-preview?id=demo_ori_head_ct&plane=coronal&index=256&window=bone"
```
## 手工验证点
- 打开 DICOM 阅览,普通冠状位/矢状位切片仍可查看。
- 上传 STL 后启用模型切分。
- 使用一个双端点进度条调节起点/终点帧。
- 将起点拖过终点或终点拖过起点后,界面仍能按两个端点显示切分结果。
- 起点帧和终点帧上显示真实 STL 切面 mask无交集时不显示假 mask。
- 不再出现单独无意义的 CT MASK 图片。
## 验收标准
- STL 上传返回模型信息。
-`modelId``/api/library/reformat-preview` 可返回叠加 mask 的 PNG。
- `python -m py_compile web_backend.py head_extension_app.py` 通过。
- `npm run lint` 通过。
- `npm run build` 通过。
- Gitea commit/push 完成。
- 重新部署后 `http://192.168.3.11:3005/` 返回 `200 OK`
## 残余风险
- mask 是否精确覆盖目标结构取决于 STL 与 DICOM 是否同坐标系、同单位、同方向。如果 STL 未与 DICOM patient 坐标配准,需要额外提供配准矩阵或模型平移/缩放/旋转控制。
## 人工审核状态
用户已明确本次不需要人工二次确认,直接执行。