cognis-digital/dicomsweep

GitHub: cognis-digital/dicomsweep

按 DICOM PS3.15 附录 E 规范对医学影像进行去标识化处理,清除 PHI 标签与烧录像素文本的命令行工具。

Stars: 0 | Forks: 0

DICOMSWEEP # DICOMSWEEP ### 根据 DICOM PS3.15 附录 E 配置文件对 DICOM 影像研究进行去标识化处理,清除标签和烧录的像素文本。 [![PyPI](https://img.shields.io/pypi/v/cognis-dicomsweep.svg?color=6b46c1)](https://pypi.org/project/cognis-dicomsweep/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/5026907836061047.svg)](https://github.com/cognis-digital/dicomsweep/actions) [![License: COCL 1.0](https://img.shields.io/badge/License-COCL%201.0-2b6cb0.svg)](LICENSE) [![Suite](https://img.shields.io/badge/Cognis-Neural%20Suite-6b46c1.svg)](https://github.com/cognis-digital) *医疗保健与生命科学 — HIPAA、PHI、FHIR/HL7 和临床数据。*
``` pip install cognis-dicomsweep dicomsweep scan . # → prioritized findings in seconds ``` ## 用法 — 逐步指南 1. **安装** CLI: pip install dicomsweep 2. **扫描 DICOM 文件**以查找 PHI 标签(只读;如果发现任何标签则以状态码 1 退出): dicomsweep scan study.dcm 3. **清除文件**以写入去标识化副本(默认为 `.safe.dcm`): dicomsweep sweep study.dcm --output study.safe.dcm 4. **读取输出。**全局 `--format json` 标志会生成关于检测到/已移除标签的机器可读报告: dicomsweep --format json scan study.dcm > phi.json 5. **将其接入 pipeline** — 以扫描退出代码作为控制条件,然后在导出前进行清除: dicomsweep scan study.dcm && echo clean || dicomsweep sweep study.dcm ## 目录 - [为什么选择 dicomsweep?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [功能对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献](#contributing) ## 为什么选择 dicomsweep? 一条命令即可将一文件夹的扫描结果转化为可用于研究的安全数据集,包括大多数免费工具会跳过的、基于 OCR 的像素烧录文本清除功能 —— 这对 AI 影像研究人员具有极大的吸引力。 `dicomsweep` 是单一用途、可脚本化且可自托管的:将其指向目标,即可获得您的工作流已适配的格式(表格 · JSON · SARIF)的优先级结果,以此为依据控制 CI,并允许 agent 通过 MCP 驱动它。
↑ 回到顶部
## 功能 - ✅ 标签名称 - ✅ 解析 Dicom - ✅ 扫描数据集 - ✅ 扫描文件 - ✅ 清除数据集 - ✅ 清除文件 - ✅ 可在 Linux/macOS/Windows · Docker · devcontainer 上运行 - ✅ 提供 Python、JavaScript、Go 和 Rust 的移植版本 (`ports/`)
↑ 回到顶部
## 快速开始 ``` pip install cognis-dicomsweep dicomsweep --version dicomsweep scan . # scan current project dicomsweep scan . --format json # machine-readable dicomsweep scan . --fail-on high # CI gate (non-zero exit) ```
↑ 回到顶部
## 示例 ``` $ dicomsweep scan . [HIGH ] DIC-001 example finding (./src/app.py) [MEDIUM ] DIC-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 回到顶部
## 架构 ``` flowchart LR IN[input] --> P[dicomsweep
analyze + score] P --> OUT[report] ```
↑ 回到顶部
## 从任何 AI 技术栈中使用 `dicomsweep` 可与所有流行的 AI 使用方式互操作: - **MCP server** — `dicomsweep mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 通过管道将 `dicomsweep scan . --format json` 传入任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码即可将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI pipeline 提供 exit code + SARIF
↑ 回到顶部
## 功能对比 | | **Cognis dicomsweep** | pydicom | |---|:---:|:---:| | 支持自托管,无需账号 | ✅ | 视情况而定 | | 单条命令,零配置 | ✅ | ⚠️ | | 用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | 原生支持 MCP(AI agent) | ✅ | ❌ | | 多语言移植(JS/Go/Rust) | ✅ | ❌ | | 开源许可证 | ✅ COCL | 视情况而定 | *秉承 **pydicom / DICOM Cleaner (RSNA)** 的精神构建,并以 Cognis 的方式重新呈现。遗漏了致谢?欢迎提交 PR。*
↑ 回到顶部
## 集成 可接入您的技术栈:用于代码扫描的 **SARIF**,用于任何场景的 **JSON**,用于 AI agent 的 **MCP server** (`dicomsweep mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。详见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 回到顶部
## 安装 — 全方式、全平台 ``` pip install "git+https://github.com/cognis-digital/dicomsweep.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/dicomsweep.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/dicomsweep.git" # uv pip install cognis-dicomsweep # PyPI (when published) docker run --rm ghcr.io/cognis-digital/dicomsweep:latest --help # Docker brew install cognis-digital/tap/dicomsweep # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/dicomsweep/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | 云平台 | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/dicomsweep` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 回到顶部
## 相关 Cognis 工具 - [`phiscrub`](https://github.com/cognis-digital/phiscrub) — 流式扫描日志、CSV 和自由文本笔记中的 PHI(姓名、MRN、SSN、日期、地址),并进行就地脱敏或 token 化处理。 - [`fhirlint`](https://github.com/cognis-digital/fhirlint) — 根据配置文件(US Core 等)验证 FHIR R4/R5 资源和捆绑包,并提供精确到行级别的错误报告。 - [`hl7tap`](https://github.com/cognis-digital/hl7tap) — 从终端解析、美化打印、比对差异并通过 MLLP 重放 HL7 v2 消息。 - [`consentledger`](https://github.com/cognis-digital/consentledger) — 维护一份防篡改的、哈希链式的患者数据访问和同意事件审计日志。 - [`synthcohort`](https://github.com/cognis-digital/synthcohort) — 根据 schema 规范生成具有统计学真实性的合成患者队列(FHIR/CSV),用于开发和测试。 - [`trialwatch`](https://github.com/cognis-digital/trialwatch) — 查询、比对差异并监控 ClinicalTrials.gov 记录,在状态、入组情况或结果发生变化时发出警报。 **探索完整套件 →** [🗂️ 全部 170+ 工具](https://github.com/cognis-digital/cognis-neural-suite) · [⭐ awesome-cognis](https://github.com/cognis-digital/awesome-cognis) · [🔗 cognis-sources](https://github.com/cognis-digital/cognis-sources) · [🤖 uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet) · [🧠 engram](https://github.com/cognis-digital/engram)
↑ 回到顶部
## 互操作性 `{}` 与包含 300+ 工具的 Cognis 套件组合使用 — JSON 输入/输出以及共享的 兼容 OpenAI 的 `/v1` 主干。请参阅 **[INTEROP.md](INTEROP.md)** 获取 套件图谱、组合模式和参考技术栈。 ## 许可证 在 **Cognis Open Collaboration License (COCL) v1.0** 下开源可见 — 个人、内部评估、研究和教育用途免费;**商业/生产用途需要许可证** (licensing@cognis.digital)。详见 [LICENSE](LICENSE)。
Cognis Digital · Cognis Neural Suite 中的 170+ 工具之一 · Making Tomorrow Better Today
标签:DICOM, Python, 医学影像, 医疗健康, 可视化界面, 数据可视化, 数据脱敏, 无后门, 日志审计, 网络安全, 请求拦截, 逆向工具, 隐私保护