diff --git a/README.md b/README.md index 0eeca1b..f24daf2 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,20 @@ # CTPhysics -简体中文说明 | English version below +[简体中文](#概述) | [English](#overview) -—— +--- ## 概述 + CTPhysics 是一个用于学习与演示计算机断层扫描(CT)成像物理的交互式平台。项目聚焦成像链路的关键环节(采样、重建、噪声和剂量等),通过轻量的前端可视化与实验模块,帮助学习者和从业者理解核心物理概念及工程权衡。 ## 在线站点 + - 生产/演示站点:https://www.ct-physics.xyz - 若链接更新,请在此处同步维护。 ## 功能特性 + - 交互式模块:采样与滤波、卷积核(重建滤波器)对图像的影响、剂量与噪声的权衡等 - 可视化解释:图表/曲线/示意图,直观展示物理量与图像质量指标的关系 - 多语言支持:中/英文内容(可拓展 i18n) @@ -19,6 +22,7 @@ CTPhysics 是一个用于学习与演示计算机断层扫描(CT)成像物 - 可访问性:尽量遵循可访问性规范(ARIA、键盘可操作) ## 技术栈 + - 前端框架:React / Next.js(TypeScript 严格模式) - 样式与组件:Tailwind CSS + Radix UI(或等价组件库) - 可视化:Canvas/WebGL(必要时),可使用 D3/Plotly 等 @@ -26,6 +30,7 @@ CTPhysics 是一个用于学习与演示计算机断层扫描(CT)成像物 - 代码质量:ESLint + Prettier(CI 中强制) ## 快速开始 + 1) 环境准备 - Node.js >= 18 - 推荐使用 pnpm(或 npm / yarn) @@ -40,6 +45,7 @@ CTPhysics 是一个用于学习与演示计算机断层扫描(CT)成像物 - pnpm build && pnpm start ## 测试(Vitest / Playwright) + - 单元与集成测试(Vitest) - 运行:pnpm test - 覆盖率报告:pnpm test --coverage @@ -50,15 +56,17 @@ CTPhysics 是一个用于学习与演示计算机断层扫描(CT)成像物 - 数据与网络:尽量使用可复现数据与网络模拟,避免外部依赖造成不稳定 ## CI 概述 + - GitHub Actions(示例) - 触发:PR / push 到 master - - 阶段:lint → type-check → unit tests(Vitest)→ e2e(Playwright,可选)→ 构建 + - 阶段:lint → type-check → 单元测试(Vitest)→ e2e(Playwright,可选)→ 构建 - 覆盖率阈值:在 CI 中强制(失败则拒绝合并) - 预览部署:Vercel PR preview(自动) - 可选:Sentry release(仅 master) - 安全:GitHub Secret Scanning & Push Protection ## 部署(Vercel) + - 步骤 - 连接 Git 仓库(picspin/CTPhysics) - 配置环境变量(参考 docs/ENV.md) @@ -69,6 +77,7 @@ CTPhysics 是一个用于学习与演示计算机断层扫描(CT)成像物 - Production URL(合并到 master 后自动更新) ## 可观测性(可选:Sentry) + - 启用方式 - 创建 Sentry 项目与 DSN - 在环境变量中配置 SENTRY_DSN(参考 docs/ENV.md) @@ -78,35 +87,46 @@ CTPhysics 是一个用于学习与演示计算机断层扫描(CT)成像物 - 注意隐私和合规要求,避免上传敏感数据 ## PCD 路线图摘要 + - 详见 docs/PCD_ROADMAP.md - 里程碑 M1~M4 - QA 指标:MTF(调制传递函数)、NPS(噪声功率谱)、NEQ(等效量子数) - 测试目标:单元/端到端覆盖率 ## 贡献 + - 欢迎贡献!请先阅读 CONTRIBUTING.md - 分支与提交流程(PR) - 代码风格与提交信息规范 - 测试与环境管理要求 ## 许可证 + - License:参见仓库根目录的 LICENSE 文件(例如 MIT) ## 相关文档 + - 环境变量:docs/ENV.md - 架构与设计:docs/ARCHITECTURE.md -—— +## 架构图 + +项目架构图使用 Mermaid 渲染,查看 [diagrams/architecture.html](../../diagrams/architecture.html)。 -English +> **提示**:在 GitHub 上查看时,需要安装 [Mermaid Markdown Preview](https://marketplace.visualstudio.com/items?itemName=sporiley.mermaid-markdown) 等扩展;或访问在线渲染版本。 + +--- ## Overview + CTPhysics is an interactive learning and demonstration platform for CT (Computed Tomography) imaging physics. It focuses on key parts of the imaging pipeline (sampling, reconstruction, noise and dose trade-offs) and uses lightweight visualizations and hands-on labs to clarify core physical concepts and engineering decisions. ## Live site + - Production / demo: https://www.ct-physics.xyz ## Features + - Interactive modules: sampling and filtering, reconstruction kernels, dose vs. noise trade-offs - Visual explanations: charts/curves/diagrams for relationships between physical quantities and image quality metrics - Multilingual: CN/EN content (i18n-ready) @@ -114,6 +134,7 @@ CTPhysics is an interactive learning and demonstration platform for CT (Computed - Accessibility: strive for ARIA compliance and keyboard operability ## Tech stack + - Frontend: React / Next.js with strict TypeScript - UI/Styling: Tailwind CSS + Radix UI (or similar) - Visualization: Canvas/WebGL as needed; D3/Plotly optional @@ -121,6 +142,7 @@ CTPhysics is an interactive learning and demonstration platform for CT (Computed - Code quality: ESLint + Prettier (enforced in CI) ## Quick start + 1) Prerequisites - Node.js >= 18 - Prefer pnpm (or npm / yarn) @@ -135,6 +157,7 @@ CTPhysics is an interactive learning and demonstration platform for CT (Computed - pnpm build && pnpm start ## Testing (Vitest / Playwright) + - Unit & integration with Vitest - Run: pnpm test - Coverage: pnpm test --coverage @@ -145,6 +168,7 @@ CTPhysics is an interactive learning and demonstration platform for CT (Computed - Data & network: prefer reproducible fixtures and network mocks to avoid flakiness ## CI overview + - GitHub Actions (example) - Triggers: PR / push to master - Stages: lint → type-check → unit tests (Vitest) → e2e (Playwright, optional) → build @@ -154,6 +178,7 @@ CTPhysics is an interactive learning and demonstration platform for CT (Computed - Security: GitHub Secret Scanning & Push Protection ## Deployment (Vercel) + - Steps - Connect repo (picspin/CTPhysics) - Configure environment variables (see docs/ENV.md) @@ -164,6 +189,7 @@ CTPhysics is an interactive learning and demonstration platform for CT (Computed - Production URL (auto after merge to master) ## Observability (optional Sentry) + - Enable - Create Sentry project and DSN - Configure SENTRY_DSN in env (see docs/ENV.md) @@ -173,20 +199,30 @@ CTPhysics is an interactive learning and demonstration platform for CT (Computed - Respect privacy/compliance; avoid sensitive data ## PCD roadmap summary + - See docs/PCD_ROADMAP.md - Milestones M1–M4 - QA metrics: MTF (Modulation Transfer Function), NPS (Noise Power Spectrum), NEQ (Noise Equivalent Quanta) - Test coverage targets (unit/e2e) ## Contributing + - Contributions are welcome! Please read CONTRIBUTING.md - Branch & PR workflow - Code style & commit message conventions - Testing & environment management requirements ## License + - See LICENSE file at the repo root (e.g., MIT) ## Documentation links + - Environment variables: docs/ENV.md - Architecture & design: docs/ARCHITECTURE.md + +## Architecture Diagram + +The project architecture is rendered with Mermaid. View [diagrams/architecture.html](../../diagrams/architecture.html). + +> **Tip**: When viewing on GitHub, install a Mermaid preview extension like [Mermaid Markdown Preview](https://marketplace.visualstudio.com/items?itemName=sporiley.mermaid-markdown), or visit the online rendered version. diff --git a/diagrams/architecture.html b/diagrams/architecture.html new file mode 100644 index 0000000..f9228bd --- /dev/null +++ b/diagrams/architecture.html @@ -0,0 +1,245 @@ + + + + + + CTPhysics Architecture + + + + + + + +
+
+

CTPhysics Architecture

+

Interactive CT Imaging Physics Learning Platform

+
+ +
+
+ + + +
+
+
+ + +
+ + + +