pydicom

Read, modify, and anonymize DICOM files via pydicom Dataset objects and metadata.

16|7|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/jackspace/ClaudeSkillz --skill pydicom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pydicom
Source: https://github.com/jackspace/ClaudeSkillz/tree/main/skills/scientific-pkg-pydicom
Command: npx skills add https://github.com/jackspace/ClaudeSkillz --skill pydicom

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill guides users on working with DICOM files in Python, enabling reading, modifying, anonymizing, converting pixel data, and managing DICOM metadata for medical imaging workflows.

Core Features & Use Cases

  • Read/write DICOM data: Access pixel arrays and metadata.
  • Pixel data handling: Extract and display CT/MRI image data.
  • Anonymization & privacy: Remove PHI safely.
  • DICOM metadata management: Update tags, transfer syntaxes, and datasets.
  • Use cases include clinical research data sharing and PACS workflows.

Quick Start

Load a DICOM file, print patient name and modality, then anonymize and save a new file.

Frequently Asked Questions about pydicom

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read and extract metadata from DICOM files in Python?

Use pydicom to load DICOM files as Dataset objects, then access metadata through ds attributes and file_meta. The library provides direct access to patient information, imaging modality, transfer syntax, and other header tags for medical imaging workflows.

What's the best way to anonymize DICOM files and remove patient information?

Anonymization in pydicom involves identifying and removing PHI tags from the Dataset, then saving the modified file. Common targets include patient name, ID, birth date, and other identifiers; pydicom's tag access makes scripted removal straightforward for clinical research data sharing.

Can I extract and manipulate pixel data from CT and MRI images?

Yes, pydicom extracts pixel arrays from DICOM files and supports color space conversion, windowing, and multi-frame dataset handling. This enables image display, conversion to standard formats, and pixel-level modifications for medical imaging analysis.

How do I handle compressed DICOM data and different transfer syntaxes?

Pydicom manages transfer syntax metadata and compressed pixel data through the Dataset and file_meta objects. The library supports reading various compression formats used in PACS systems, allowing you to work with different encoding schemes programmatically.

Can I modify and save DICOM files with updated metadata?

Pydicom allows scripted changes to Dataset attributes and tags, then saves the modified file while preserving DICOM structure. This supports workflows requiring metadata updates, tag corrections, or batch modifications across multiple files.