Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 41 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
# CTPhysics

简体中文说明 | English version below
[简体中文](#概述) | [English](#overview)

——
---

## 概述

CTPhysics 是一个用于学习与演示计算机断层扫描(CT)成像物理的交互式平台。项目聚焦成像链路的关键环节(采样、重建、噪声和剂量等),通过轻量的前端可视化与实验模块,帮助学习者和从业者理解核心物理概念及工程权衡。

## 在线站点

- 生产/演示站点:https://www.ct-physics.xyz
- 若链接更新,请在此处同步维护。

## 功能特性

- 交互式模块:采样与滤波、卷积核(重建滤波器)对图像的影响、剂量与噪声的权衡等
- 可视化解释:图表/曲线/示意图,直观展示物理量与图像质量指标的关系
- 多语言支持:中/英文内容(可拓展 i18n)
- 教学实验:本地保存实验参数(可选),便于复现实验
- 可访问性:尽量遵循可访问性规范(ARIA、键盘可操作)

## 技术栈

- 前端框架:React / Next.js(TypeScript 严格模式)
- 样式与组件:Tailwind CSS + Radix UI(或等价组件库)
- 可视化:Canvas/WebGL(必要时),可使用 D3/Plotly 等
- 测试:Vitest(单元/集成)、Playwright(端到端)
- 代码质量:ESLint + Prettier(CI 中强制)

## 快速开始

1) 环境准备
- Node.js >= 18
- 推荐使用 pnpm(或 npm / yarn)
Expand All @@ -40,6 +45,7 @@ CTPhysics 是一个用于学习与演示计算机断层扫描(CT)成像物
- pnpm build && pnpm start

## 测试(Vitest / Playwright)

- 单元与集成测试(Vitest)
- 运行:pnpm test
- 覆盖率报告:pnpm test --coverage
Expand All @@ -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)
Expand All @@ -69,6 +77,7 @@ CTPhysics 是一个用于学习与演示计算机断层扫描(CT)成像物
- Production URL(合并到 master 后自动更新)

## 可观测性(可选:Sentry)

- 启用方式
- 创建 Sentry 项目与 DSN
- 在环境变量中配置 SENTRY_DSN(参考 docs/ENV.md)
Expand All @@ -78,49 +87,62 @@ 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)
- Teaching labs: locally persisted parameters (optional) for reproducible experiments
- 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
- Testing: Vitest (unit/integration), Playwright (end-to-end)
- Code quality: ESLint + Prettier (enforced in CI)

## Quick start

1) Prerequisites
- Node.js >= 18
- Prefer pnpm (or npm / yarn)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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.
Loading