Claude Skill MartBrowse skillsWhat is a Skill?
Back to list

pydicom DICOM Toolkit

A safety-first guide and CLI toolkit for reading, writing, converting and de-identification-preflighting local DICOM data with pydicom 3.0.2.

Dev & CodingAdvanced33,0303,248AI score 9/10Last updated: Aug 9, 2026

What it does

  • Safe dataset reads: shows dcmread() patterns with stop_before_pixels, specific_tags and defer_size, and explicitly forbids print(ds), full JSON dumps or logging element values because DICOM metadata can carry PHI.
  • Transfer syntax & codec preflight: decodes Transfer Syntax UIDs and maps out pinned plugin combinations (pylibjpeg, pyjpegls, python-gdcm, Pillow) plus supply-chain advice on hash-verified, internally mirrored wheels.
  • Pixel data handling: frame-scoped decoding via pydicom.pixels, array shape semantics, the correct Modality LUT → VOI LUT order, MONOCHROME1 inversion and Palette Color LUTs.
  • Compression / encapsulation: notes that compress() and decompress() mutate Pixel Data and mint a new SOP Instance UID, plus encapsulate() and generate_frames() usage.
  • Bounded de-identification workflow: a nine-step PS3.15 Annex E–aligned process covering original preservation, recursive sequence actions, one-to-one UID replacement, date-shift policy, burned-in annotation review and secret handling for UID keys/maps.
  • Seven helper CLIs: aggregate metadata, technical inventory, codec inspector, frame/memory planner, single non-diagnostic frame render, pseudonymizer + audit, and UID map validator.

Who it's for

  • Researchers and data engineers preprocessing medical imaging datasets in Python
  • Developers building PACS or imaging pipelines who must pin codec dependencies
  • Privacy/IRB engineers designing pseudonymization and audit trails before data sharing
  • Teams migrating pydicom 2.x code to the 3.0 API

Example uses

  1. Dataset triage: "Summarize modality, image size and transfer syntax across authorized/" → run scripts/dicom_inventory.py authorized/ --recursive for an aggregate report with no per-patient values exposed.
  2. Fixing decode errors: a JPEG 2000 CT series fails to open, so transfer_syntax_inspector.py reveals which plugins are installed and which pinned package to add.
  3. Research pseudonymization: generate a project key, run anonymize_dicom.py --uid-key-file project.key --uid-scope export-v1, then deidentification_audit.py on the derivative before expert sign-off.

· · · Install guide · · ·

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude Skill Mart.
Copy the skills/pydicom folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/pydicom/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/K-Dense-AI/scientific-agent-skills.git && mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/pydicom ~/.claude/skills/

This is a third-party skill. Check the source repository before installing.

  1. Open a terminal and clone the repository: git clone https://github.com/K-Dense-AI/scientific-agent-skills.git
  2. Copy the skill into Claude Code's skills folder: mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/pydicom ~/.claude/skills/
  3. Create and activate a Python virtual environment (e.g. python3 -m venv .venv && source .venv/bin/activate). Python 3.10+ is required.
  4. Install the reviewed pinned release: uv pip install "pydicom==3.0.2" (or pip install "pydicom==3.0.2").
  5. For pixel arrays and rendering add numpy==2.5.1 and Pillow==12.3.0; for compressed syntaxes install only the plugins you actually need (pylibjpeg family, pyjpegls, or python-gdcm).
  6. Restart Claude Code and ask something like "use pydicom to inspect this DICOM folder" — the skill triggers automatically.
  7. Only point it at local data you are authorized to access, keep originals untouched, and never commit, sync or share the generated UID key files.