pydicom

Read, write, and modify DICOM medical imaging files and metadata.

2|Updated Jun 4, 2026
One-click install
npx skills add https://github.com/Lord1Egypt/scientific-agent-toolkit --skill pydicom-lord1egypt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pydicom
Source: https://github.com/Lord1Egypt/scientific-agent-toolkit/tree/main/scientific-skills/pydicom
Command: npx skills add https://github.com/Lord1Egypt/scientific-agent-toolkit --skill pydicom-lord1egypt

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill addresses the complexity of handling medical imaging data by providing a robust toolkit for reading, writing, modifying, and anonymizing DICOM files, which are essential for clinical and research workflows.

Core Features & Use Cases

  • DICOM Manipulation: Easily read, write, and modify metadata and pixel data within medical images.
  • Anonymization: Securely remove or replace Protected Health Information (PHI) to ensure compliance during data sharing.
  • Image Processing: Convert medical scans to standard formats like PNG or JPEG and handle multi-frame volumes for visualization.

Quick Start

Use the pydicom skill to read the medical image file at path/to/scan.dcm and extract its patient metadata and pixel array.

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

You can read DICOM files programmatically to extract both patient metadata and the pixel array. This supports clinical and research workflows by providing comprehensive access to medical imaging data for further processing and analysis.

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

Anonymizing medical imaging files involves securely removing or replacing Protected Health Information (PHI) within the DICOM metadata. This ensures compliance during data sharing for research and clinical workflows by stripping identifying details from the scans.

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

Yes, you can convert DICOM scans to standard formats like PNG or JPEG. The process decodes the medical pixel data and exports it as standard image files, utilizing libraries like Pillow and pylibjpeg to handle pixel data decompression and format conversion.

Does this approach support handling complex DICOM transfer syntaxes and multi-frame volumes?

Handling complex DICOM transfer syntaxes and multi-frame volume reconstruction is fully supported. The process utilizes standard Python libraries including numpy and pylibjpeg to decompress pixel data and reconstruct multi-frame medical scans for visualization.

Do I need additional libraries to decompress pixel data from DICOM files?

Yes, decompressing pixel data from DICOM files requires specific decoding libraries. Dependencies such as pylibjpeg, pylibjpeg-libjpeg, pylibjpeg-openjpeg, and python-gdcm are necessary to handle various compressed transfer syntaxes and successfully read the pixel arrays.