pydicom

Read, write, and manipulate DICOM medical imaging files with pydicom.

Updated Mar 10, 2026
One-click install
npx skills add https://github.com/felixboehm/biochem-allergy --skill pydicom-felixboehm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pydicom
Source: https://github.com/felixboehm/biochem-allergy/tree/main/.claude/skills/pydicom
Command: npx skills add https://github.com/felixboehm/biochem-allergy --skill pydicom-felixboehm

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 working with DICOM (Digital Imaging and Communications in Medicine) files, which are standard in medical imaging but difficult to handle directly.

Core Features & Use Cases

  • Read/Write DICOM: Easily load, modify, and save DICOM files.
  • Pixel Data Handling: Extract, process, and visualize image data from scans like CT, MRI, and X-ray.
  • Metadata Management: Access, modify, and anonymize patient and study information within DICOM tags.
  • Use Case: A researcher needs to extract all patient names and study dates from a large dataset of MRI scans for a study, then anonymize the data before analysis. This Skill can automate that entire process.

Quick Start

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

Frequently Asked Questions about pydicom

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

FAQPage Schema
How do I extract pixel data from a DICOM file using Python?

To extract pixel data from a DICOM file, you can load the medical imaging scan using Python and process the array with numpy. This allows you to easily handle and visualize image data from CT, MRI, and X-ray scans.

How do I anonymize patient information in DICOM metadata?

You can anonymize patient information in DICOM metadata by loading the file, accessing specific DICOM tags containing patient names and study dates, modifying or removing those values, and saving the anonymized data for analysis.

Can I convert DICOM files to standard image formats like PNG or JPEG?

Yes, you can convert DICOM files to standard image formats. By extracting the pixel data using numpy and utilizing Pillow, you can save the medical imaging scans as standard image files for easier viewing and sharing.

What Python libraries do I need to process medical imaging scans?

Processing medical imaging scans requires several Python libraries including pydicom for reading DICOM files, numpy for pixel data array manipulation, and Pillow for converting and saving standard image formats.

Does pydicom work with compressed DICOM pixel data?

Yes, pydicom works with compressed DICOM pixel data by utilizing installed decoders like pylibjpeg and python-gdcm. These dependencies enable the decoding and extraction of compressed image data from medical scans.