pydicom

Read, write, and manipulate DICOM files using the pydicom library.

1|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/Sologa/codex-pipeline --skill pydicom-sologa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pydicom
Source: https://github.com/Sologa/codex-pipeline/tree/main/.codex/skills/pydicom
Command: npx skills add https://github.com/Sologa/codex-pipeline --skill pydicom-sologa

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill simplifies the complex task of working with DICOM (Digital Imaging and Communications in Medicine) files, enabling efficient reading, writing, and manipulation of medical imaging data.

Core Features & Use Cases

  • Read/Write DICOM: Load, modify, and save DICOM files.
  • Pixel Data Handling: Extract, process, and visualize image data.
  • Metadata Management: Access, modify, and anonymize DICOM tags.
  • Use Case: A radiologist needs to extract specific patient information and pixel data from a series of CT scans for research purposes, then anonymize the dataset before sharing.

Quick Start

Use the pydicom skill to read the DICOM file 'patient_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?

You extract pixel data from a DICOM file by loading it with Python and processing the resulting pixel arrays using numpy. This handles extraction and visualization directly, supporting various DICOM compression schemes.

What is the best way to anonymize patient information in medical imaging files?

The best way to anonymize patient information in medical imaging files is by accessing and modifying specific DICOM metadata tags. You can programmatically overwrite sensitive patient data fields before securely sharing the dataset.

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

You can convert DICOM images to standard formats by reading the medical imaging file and exporting the extracted pixel data. This process relies on image processing libraries like pillow to save the arrays as standard image files.

Does pydicom support compressed DICOM sequences and transfer syntaxes?

pydicom supports compressed DICOM sequences and transfer syntaxes by utilizing specific dependencies like pylibjpeg and python-gdcm. These libraries decode various compression schemes to handle complex medical imaging data.

How do I read and modify metadata tags in a CT scan file?

To read and modify metadata tags in a CT scan file, load the DICOM dataset and access its dictionary attributes. This allows you to view, edit, or remove specific metadata fields before saving the modified file.