pydicom

Read, write, and edit DICOM files in Python.

1|2|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/fuzzy-dynamics/strings --skill pydicom-fuzzy-dynamics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pydicom
Source: https://github.com/fuzzy-dynamics/strings/tree/main/packages/skills/pydicom
Command: npx skills add https://github.com/fuzzy-dynamics/strings --skill pydicom-fuzzy-dynamics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pydicom, numpy, Pillow, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a Python-based toolkit for reading, writing, and editing DICOM files, enabling medical imaging workflows to access pixel data, metadata, and image information without specialized tooling.

Core Features & Use Cases

  • Read and inspect DICOM metadata and pixel data; extract image arrays for processing.
  • Anonymize PHI fields and adjust identifiers to prepare datasets for research or sharing.
  • Convert DICOM images to common formats or extract slices for analysis, visualization, or PACS integration.
  • Maintain and modify metadata while handling compressed transfer syntaxes safely.

Quick Start

Load a DICOM file and inspect its metadata with the pydicom library.

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 pixel data from a DICOM file in Python?

You can read and extract DICOM pixel data in Python by loading the file with the pydicom library to access metadata and image arrays. It manages compressed transfer syntaxes safely during pixel data extraction for processing.

What is the best way to anonymize PHI fields in medical imaging files?

Anonymizing PHI fields in medical imaging files involves using a Python toolkit to adjust identifiers and remove protected health information. This prepares datasets for research or sharing while maintaining the remaining metadata structure.

Can I convert DICOM images to standard image formats using Python?

Yes, you can convert DICOM images to standard formats using Python by reading the pixel data and serializing it with imaging helpers. This allows you to extract slices for visualization or PACS integration.

Does pydicom support reading DICOM files with compressed transfer syntaxes?

Yes, pydicom supports reading and writing DICOM files with compressed transfer syntaxes. It allows you to modify metadata and serialize DICOM data while safely managing the specific compression formats used in medical imaging.

Do I need numpy and Pillow to process medical imaging metadata in Python?

You need numpy and Pillow as optional imaging helpers to process medical imaging metadata and pixel arrays in Python. They enable extracting image arrays for analysis and converting DICOM data to standard image formats.

Why does modifying DICOM metadata require handling transfer syntaxes carefully?

Modifying DICOM metadata requires careful transfer syntax handling to avoid data corruption when serializing files. Using pydicom ensures compressed transfer syntaxes are managed safely during read, write, and edit operations.