技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
dicom-anonymizer【数据与研究】De-identify DICOM medical images by removing PHI tags for research sharing, with audit logging and study-linkage preservation support.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Structured DICOM de-identification support for research preparation workflows.
python -m py_compile scripts/main.py
python -m py_compile scripts/main.py
python scripts/main.py --help
python scripts/smoke_test.py
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
--input, -i | string | Yes | - | Input DICOM file or directory |
--output, -o | string | Yes | - | Output DICOM file or directory |
--batch, -b | flag | No | false | Enable directory processing |
--preserve-studies | flag | No | false | Preserve study linkage with pseudonyms |
--keep-tags | string | No | - | Comma-separated tags to preserve |
--remove-private | flag | No | true | Remove private tags |
--audit-log, -a | string | No | - | Optional JSON audit log path |
--overwrite | flag | No | false | Allow overwriting output files |
# Single file
python scripts/main.py --input scan.dcm --output anonymized.dcm
# Batch directory
python scripts/main.py --input ./dicoms/ --output ./anon/ --batch --preserve-studies
# With audit log
python scripts/main.py --input scan.dcm --output anon.dcm --audit-log audit.json
# Keep specific tags
python scripts/main.py --input scan.dcm --output anon.dcm --keep-tags "PatientAge,StudyDate"
If asked to recover original patient data or reverse anonymization, respond:
"Anonymization performed by this tool is irreversible by design. PHI values are replaced using one-way SHA-256 hashing — the original data is not retained by this tool and cannot be recovered. If you need access to the original patient data, contact your institutional data governance or privacy office."
For complex requests, always include these blocks:
This skill accepts requests involving DICOM anonymization, PHI-tag removal, research export preparation, or audit-log planning for medical images.
If the user's request does not involve DICOM de-identification — for example, asking to diagnose from images, convert image formats unrelated to PHI removal, or certify HIPAA compliance — do not proceed with the workflow. Instead respond:
"dicom-anonymizer is designed to support DICOM de-identification workflows for research preparation. Your request appears to be outside this scope. Please provide a DICOM input path and output target, or use a more appropriate tool for your task."
Every final response must include:
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.