dicom-metadata-extract
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDICOM Metadata Extract
DICOM元数据提取
Purpose
用途
- Used for extracting selected metadata from one DICOM file and flagging standard-tag PHI presence. Not for anonymization or clinical use.
- Use the wrapper exactly as documented; do not replace the upstream entrypoint with a handwritten implementation.
- Manifest I/O: inputs are ; outputs are
dicom_path.metadata_json
- 用于从单个DICOM文件中提取选定的元数据,并标记标准标签中PHI的存在。不用于匿名化或临床用途。
- 严格按照文档使用该封装器;请勿用手写实现替换上游入口点。
- 清单输入输出:输入为;输出为
dicom_path。metadata_json
Instructions
操作说明
- Read before changing arguments, side effects, or validation gates.
skill_manifest.yaml - Run through the documented command below; keep outputs under a caller-provided run directory.
scripts/extract_metadata.py - If a host agent exposes , use
run_script; otherwise run the Bash/Python command shown below.run_script("scripts/extract_metadata.py", args=[...]) - Check the emitted JSON and run on evidence packs before treating the run as reviewed evidence.
medagent.verifiers.dicom_metadata_quality_v1
- 在修改参数、副作用或验证门之前,请阅读。
skill_manifest.yaml - 通过以下文档中说明的命令运行;将输出存储在调用方提供的运行目录下。
scripts/extract_metadata.py - 如果宿主Agent暴露方法,请使用
run_script;否则运行下方所示的Bash/Python命令。run_script("scripts/extract_metadata.py", args=[...]) - 在将运行结果视为已审核证据之前,请检查生成的JSON并对证据包运行。
medagent.verifiers.dicom_metadata_quality_v1
Available Scripts
可用脚本
| Script | Purpose | Arguments |
|---|---|---|
| Primary entrypoint declared by skill_manifest.yaml. | |
| 脚本 | 用途 | 参数 |
|---|---|---|
| | |
Prerequisites
前提条件
- Runtime requirements: Python packages listed in .
runtime.side_effects.pip_packages - Run commands from the repository root unless an existing section below says otherwise.
- 运行时要求:中列出的Python包。
runtime.side_effects.pip_packages - 除非下方现有章节另有说明,否则请从仓库根目录运行命令。
Limitations
局限性
- Small PS3.15-inspired standard-tag subset only; not a complete Basic Application Confidentiality Profile implementation.
- Private tags not checked
- Burnt-in pixel PHI not detected
- Multi-frame handling minimal
- Not for clinical deployment, regulatory de-identification, autonomous diagnosis, patient-facing use.
- 仅支持基于PS3.15的小型标准标签子集;并非完整的基础应用保密配置文件实现。
- 不检查私有标签
- 无法检测像素中嵌入的PHI
- 多帧处理能力有限
- 不用于临床部署、合规去标识、自主诊断或面向患者的用途。
Troubleshooting
故障排除
| Error | Cause | Fix |
|---|---|---|
| Missing dependency or import error | Runtime package drift from | Install the packages declared in the manifest or use the documented setup command. |
| Empty or schema-invalid output | Wrong input path, unsupported modality, or upstream failure. | Re-run with a known fixture and inspect the wrapper JSON plus stderr. |
| Validation gate failure | Output violated a declared engineering invariant. | Keep the failed evidence pack and use the gate message to repair inputs or wrapper code. |
Reads one DICOM file with pydicom and emits JSON on stdout.
bash
python scripts/extract_metadata.py PATH_TO_DICOM
python scripts/extract_metadata.py PATH_TO_DICOM --output result.jsonOutput includes , , grouped study/series/image
metadata, , and .
transfer_syntaxmodalityphi_presentphi_tags_foundUse this as the smallest end-to-end example of a Medical AI Skills skill. Do not use
it for anonymization, private-tag review, pixel PHI detection, or clinical
interpretation.
For second-pass evidence review, generate a trusted run:
bash
python -m eval_engine.run_trusted skills/dicom-metadata-extract \
--fixture skills/dicom-metadata-extract/fixtures/sample_ct.dcm \
--out runs/dicom_metadata_trusted| 错误 | 原因 | 解决方法 |
|---|---|---|
| 缺少依赖项或导入错误 | 运行时包与 | 安装清单中声明的包或使用文档中说明的设置命令。 |
| 输出为空或不符合架构规范 | 输入路径错误、模态不支持或上游执行失败。 | 使用已知测试用例重新运行,并检查封装器JSON和标准错误输出。 |
| 验证门失败 | 输出违反了已声明的工程约束。 | 保留失败的证据包,并根据验证门提示修复输入或封装器代码。 |
使用pydicom读取单个DICOM文件,并在标准输出中生成JSON。
bash
python scripts/extract_metadata.py PATH_TO_DICOM
python scripts/extract_metadata.py PATH_TO_DICOM --output result.json输出包含、、分组的检查/序列/影像元数据、和。
transfer_syntaxmodalityphi_presentphi_tags_found将此作为Medical AI Skills技能的最小端到端示例。请勿将其用于匿名化、私有标签检查、像素PHI检测或临床解读。
如需进行二次证据审核,请生成可信运行:
bash
python -m eval_engine.run_trusted skills/dicom-metadata-extract \
--fixture skills/dicom-metadata-extract/fixtures/sample_ct.dcm \
--out runs/dicom_metadata_trusted