extracting-dicom-metadata

extracting-dicom-metadata is a skill for Claude Code from maziyarpanahi/openmed. It costs 147 tokens per session (1,983 once invoked), scanned A, original, Apache-2.0.

A guide for reading DICOM medical-imaging files and DICOM Structured Reports, which store imaging details and sometimes the written radiology report.

In plain words
What is it for?
Use it when importing CT, MR, X-ray, ultrasound, or radiology-report files from medical archives and preparing them for OpenMed.
Why use it?
It collects report text for clinical language processing and identifies header fields that may contain protected health information before images are shared.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the openmed-skills plugin — 74 skills shipped together

Good fit Use it when importing CT, MR, X-ray, ultrasound, or radiology-report files from medical archives and preparing them for OpenMed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/maziyarpanahi/openmed/extracting-dicom-metadata
About the project

OpenMed is local-first healthcare AI software that extracts clinical information and removes personally identifying details from clinical text on hardware controlled by the user. Healthcare developers use its Python runtime, Apple Silicon and mobile SDKs, and browser support for on-device clinical NER and PII de-identification.

maziyarpanahi/openmed · 5,290 stars · on GitHub · openmed.life

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add maziyarpanahi/openmed --skill extracting-dicom-metadata
Clone the repo
git clone --depth 1 https://github.com/maziyarpanahi/openmed

Made for: Claude Code.

Or install openmed-skills, the plugin that ships this one along with the rest of its 74 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for extracting-dicom-metadata

README.md
[![agentmods](https://agentmods.dev/badge/skills/maziyarpanahi/openmed/extracting-dicom-metadata/github.svg)](https://agentmods.dev/skills/maziyarpanahi/openmed/extracting-dicom-metadata)
Your own site
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/extracting-dicom-metadata"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/extracting-dicom-metadata/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for extracting-dicom-metadata

Your own site · 80×15
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/extracting-dicom-metadata"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/extracting-dicom-metadata.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 147 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,983 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00147 $0.01983
Opus 5 $0.00073 $0.00992
Sonnet 5 $0.00029 $0.00397
Haiku 4.5 $0.00015 $0.00198

Measured 11d ago against content hash 98af880320ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

extracting-dicom-metadata scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/extracting-dicom-metadata/SKILL.md · 148 lines

How it starts

The opening of the file, as written. The whole thing — 148 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Extracting DICOM Metadata & Report Text for OpenMed

DICOM (Digital Imaging and Communications in Medicine) files carry far more than pixels: a header of tagged attributes (patient, study, series, equipment) and, for DICOM-SR (Structured Reports), a content tree holding the actual radiology/cardiology report text. Two jobs sit here: pull the report narrative for NLP, and flag the PHI in the header so it gets scrubbed. This skill does both, then hands narrative to OpenMed. Header tags are read with pydicom (external, MIT-licensed); de-identification of the extracted text is OpenMed's.

When to use

  • You ingest DICOM from PACS/VNA or a research archive and want the SR report text mined with clinical NLP.
  • You must enumerate PHI-bearing header tags before sharing/exporting images.
  • You have DICOM-SR objects (e.g. radiology measurements + impression) whose content tree contains the dictated report.

DICOM headers in one minute

Every attribute has a tag (gggg,eeee) (group, element), a VR (value representation, e.g. PN person name, DA date, UI UID), and a value. PHI clusters in well-known tags:

Tag Name VR Notes
(0010,0010) PatientName PN direct identifier
(0010,0020) PatientID LO MRN
(0010,0030) PatientBirthDate DA DOB
(0010,1040) PatientAddress LO address
(0008,0090) ReferringPhysicianName PN provider
(0008,0020/0030) StudyDate / StudyTime DA/TM dates
(0008,0050) AccessionNumber SH order id
(0008,103E) SeriesDescription LO free text — may leak PHI
(0020,4000) ImageComments LT free text — may leak PHI
(0040,A730) ContentSequence SQ DICOM-SR report tree

Quick start

Read the header, pull SR report text, flag PHI tags, hand off to OpenMed:

import pydicom
import openmed

ds = pydicom.dcmread("study.dcm")

# 1) Enumerate PHI-bearing header tags (report, do not log values).
PHI_TAGS = [
    (0x0010, 0x0010), (0x0010, 0x0020), (0x0010, 0x0030), (0x0010, 0x1040),
    (0x0008, 0x0090), (0x0008, 0x0050), (0x0008, 0x0020), (0x0008, 0x0030),
]
present_phi = [hex_pair for hex_pair in PHI_TAGS if hex_pair in ds]

# 2) Extract report text from a DICOM-SR content tree (recursively).
def sr_text(dataset):
    chunks = []
    for item in dataset.get("ContentSequence", []):
        vt = item.get("ValueType")
        if vt == "TEXT" and "TextValue" in item:
            chunks.append(item.TextValue)
        if "ContentSequence" in item:          # nested CONTAINER
            chunks.append(sr_text(item))
    return "\n".join(c for c in chunks if c)

report = sr_text(ds)
# Some modalities stash narrative in free-text header tags too:
for tag in ("ImageComments", "SeriesDescription", "StudyDescription"):
    if tag in ds and isinstance(ds.get(tag), str):
        report += "\n" + ds.get(tag)

# 3) De-identify the narrative, then run NER.
if report.strip():
    deid = openmed.deidentify(report, method="replace", policy="hipaa_safe_harbor")
    result = openmed.analyze_text(deid.text, output_format="dict")

Read the full file on GitHub · 148 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 148 lines · 147 tokens per session scan A 98af880320ca

Subscribe to this mod's changes

extracting-dicom-metadata is a skill published in the GitHub repository maziyarpanahi/openmed (5,290 stars, last pushed today), licensed Apache-2.0. It adds 147 tokens to every session and 1,983 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

benchmarking

Use this skill when the user wants to benchmark an MLX-VLM change and present the numbers in a PR — fork-vs-main A/B comparisons, isolated-module micro-benchmarks, median-of-N timing with warmup, peak-memory reporting, correctness checks, parameter sweeps, and self-contained reproducible bench scripts to paste into a…

Blaizzy/mlx-vlm · 74 tokens

drug-discovery

Drug discovery: ChEMBL search, drug-likeness, interactions.

NousResearch/hermes-agent · 19 tokens

server-inference

Use this skill when the user wants to run or debug MLX-VLM server inference, including uv run mlxvlm.server, /v1/models, /v1/chat/completions, /v1/responses, streaming, OpenAI-compatible clients, health checks, metrics, model unload/reload, adapters, trust-remote-code, and server request/response failures.

Blaizzy/mlx-vlm · 80 tokens

imaging-data-commons

Query and download public cancer imaging data from NCI Imaging Data Commons using idc-index. Use for accessing large-scale radiology (CT, MR, PET) and pathology datasets for AI training or research. No authentication required. Query by metadata, visualize in browser, check licenses.

synthetic-sciences/openscience · 62 tokens

paper-revision-author

Revise independently drafted paper sections into one coherent LaTeX body before the abstract is written.

opensquilla/opensquilla · 24 tokens

molecular-cloning

Molecular cloning simulation and design. PCR amplicon prediction, restriction enzyme digestion, Golden Gate and Gibson assembly simulation, primer design, CRISPR sgRNA design, and plasmid annotation. For protein-level sequence analysis use biopython or esm; for database lookups use gene-database or ensembl-database.

synthetic-sciences/openscience · 70 tokens