pydicom

Read, write, and manipulate DICOM files with pydicom.

8|Updated Jan 13, 2026
One-click install
npx skills add https://github.com/hxk622/TokenDance --skill pydicom-hxk622
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pydicom
Source: https://github.com/hxk622/TokenDance/tree/main/backend/app/skills/builtin/scientific/clinical/pydicom
Command: npx skills add https://github.com/hxk622/TokenDance --skill pydicom-hxk622

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pydicom, pillow, numpy, matplotlib, pylibjpeg, pylibjpeg-libjpeg, pylibjpeg-openjpeg, python-gdcm, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the complex task of reading, writing, and manipulating DICOM medical imaging files, making advanced medical image analysis accessible.

Core Features & Use Cases

  • DICOM Data Handling: Read, write, and modify DICOM files, including pixel data and metadata.
  • Medical Image Analysis: Extract pixel data, anonymize sensitive information, and convert DICOM to standard image formats.
  • Use Case: A radiologist needs to extract specific patient information and pixel data from a CT scan for research purposes, ensuring all Protected Health Information (PHI) is removed before sharing.

Quick Start

Use the pydicom skill to read the DICOM file located at '/path/to/patient_scan.dcm' and print the patient's name and study date.

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 patient metadata from a DICOM file in Python?

You can read DICOM files and extract patient metadata using the pydicom library, which allows you to access specific data elements like patient name and study date directly from the file object.

What is the best way to anonymize sensitive Protected Health Information in medical imaging files?

The best way to anonymize Protected Health Information in medical imaging files is using pydicom to modify or remove specific DICOM metadata tags, ensuring patient privacy before sharing scans for research.

How do I convert DICOM pixel data to standard image formats for analysis?

You can convert DICOM pixel data to standard image formats by using pydicom alongside numpy and pillow to extract the pixel array and matplotlib to visualize or save the medical image.

Does pydicom work with numpy and matplotlib for medical image visualization?

Yes, pydicom works seamlessly with numpy and matplotlib for medical image visualization, relying on these libraries to process extracted pixel arrays and render radiology scans visually.

Can I use this Python library to handle PACS systems and radiology workflows?

Yes, you can use this library to handle PACS systems and radiology workflows, as it provides the necessary functions to read, write, and manipulate DICOM files common in healthcare imaging applications.

Why do I need pylibjpeg and python-gdcm dependencies for DICOM image processing?

You need pylibjpeg and python-gdcm dependencies for DICOM image processing because they provide the required codecs to decode compressed pixel data in medical imaging files that pydicom cannot handle alone.