dicom-metadata-extract

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DICOM 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
    dicom_path
    ; outputs are
    metadata_json
    .
  • 用于从单个DICOM文件中提取选定的元数据,并标记标准标签中PHI的存在。不用于匿名化或临床用途。
  • 严格按照文档使用该封装器;请勿用手写实现替换上游入口点。
  • 清单输入输出:输入为
    dicom_path
    ;输出为
    metadata_json

Instructions

操作说明

  • Read
    skill_manifest.yaml
    before changing arguments, side effects, or validation gates.
  • Run
    scripts/extract_metadata.py
    through the documented command below; keep outputs under a caller-provided run directory.
  • If a host agent exposes
    run_script
    , use
    run_script("scripts/extract_metadata.py", args=[...])
    ; otherwise run the Bash/Python command shown below.
  • Check the emitted JSON and run
    medagent.verifiers.dicom_metadata_quality_v1
    on evidence packs before treating the run as reviewed evidence.
  • 在修改参数、副作用或验证门之前,请阅读
    skill_manifest.yaml
  • 通过以下文档中说明的命令运行
    scripts/extract_metadata.py
    ;将输出存储在调用方提供的运行目录下。
  • 如果宿主Agent暴露
    run_script
    方法,请使用
    run_script("scripts/extract_metadata.py", args=[...])
    ;否则运行下方所示的Bash/Python命令。
  • 在将运行结果视为已审核证据之前,请检查生成的JSON并对证据包运行
    medagent.verifiers.dicom_metadata_quality_v1

Available Scripts

可用脚本

ScriptPurposeArguments
scripts/extract_metadata.py
Primary entrypoint declared by skill_manifest.yaml.
PATH_TO_DICOM [--output OUT.json]
脚本用途参数
scripts/extract_metadata.py
skill_manifest.yaml
中声明的主要入口点。
PATH_TO_DICOM [--output OUT.json]

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.
  • 运行时要求:
    runtime.side_effects.pip_packages
    中列出的Python包。
  • 除非下方现有章节另有说明,否则请从仓库根目录运行命令。

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

故障排除

ErrorCauseFix
Missing dependency or import errorRuntime package drift from
skill_manifest.yaml
.
Install the packages declared in the manifest or use the documented setup command.
Empty or schema-invalid outputWrong input path, unsupported modality, or upstream failure.Re-run with a known fixture and inspect the wrapper JSON plus stderr.
Validation gate failureOutput 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.json
Output includes
transfer_syntax
,
modality
, grouped study/series/image metadata,
phi_present
, and
phi_tags_found
.
Use 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
错误原因解决方法
缺少依赖项或导入错误运行时包与
skill_manifest.yaml
不一致。
安装清单中声明的包或使用文档中说明的设置命令。
输出为空或不符合架构规范输入路径错误、模态不支持或上游执行失败。使用已知测试用例重新运行,并检查封装器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_syntax
modality
、分组的检查/序列/影像元数据、
phi_present
phi_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