pydicom

Extract pixel data and metadata from DICOM datasets using pydicom.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

DICOM medical imaging files are difficult to work with directly, so this skill helps you safely read image data and metadata, transform images for analysis or sharing, and remove patient-identifying information.

Core Features & Use Cases

  • Read and inspect DICOM metadata: load datasets, access tags/attributes, and extract study/series/pixel properties for downstream processing.
  • Extract and manipulate pixel data: handle grayscale, RGB/YBR color spaces, and multi-frame images for visualization or analysis.
  • Convert DICOM to common image formats: turn DICOM slices/frames into PNG/JPEG/TIFF using reliable normalization and optional VOI windowing.
  • Modify DICOM metadata: update or add elements and write corrected DICOM outputs for research pipelines.
  • Anonymize DICOM files (PHI removal): replace patient identifiers and remove common PHI-containing tags to support data sharing and research use cases.
  • Handle compressed DICOM: decompress pixel data when needed by installing appropriate handlers for the transfer syntax.

Quick Start

Use the pydicom skill to anonymize the attached DICOM file 'input.dcm' into 'anonymized.dcm' with PHI removed using its bundled anonymization workflow.

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?

To read and extract pixel data from a DICOM file, you can load the dataset and access the pixel array properties. This handles grayscale, RGB/YBR color spaces, and multi-frame images for visualization or analysis.

What is the best way to anonymize DICOM files and remove patient identifiers?

Anonymizing DICOM files involves replacing patient identifiers and removing common PHI-containing tags. This workflow supports safe data sharing and research use cases by writing corrected, anonymized outputs.

How do I convert DICOM images to PNG, JPEG, or TIFF for analysis?

Converting DICOM to common image formats like PNG, JPEG, or TIFF requires reliable normalization and optional VOI windowing. This process turns single- or multi-frame DICOM slices into analysis-ready image files.

Can I modify and update DICOM metadata tags for research pipelines?

Yes, you can modify DICOM metadata by safely accessing and updating specific tags or adding new elements. This allows you to write corrected DICOM outputs tailored for downstream research pipelines.

How do I handle compressed DICOM files with different transfer syntaxes?

Handling compressed DICOM requires decompressing pixel data by installing appropriate handlers for the specific transfer syntax. This ensures the dataset can be properly read regardless of compression.

Does this DICOM processing approach support multi-frame medical imaging studies?

Yes, this approach supports multi-frame medical imaging studies by handling pixel arrays across common photometric interpretations. It allows batch conversion of multiple frames into standard image formats.