pydicom-medical-imaging

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

298|27|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/jaechang-hits/SciAgent-Skills --skill pydicom-medical-imaging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pydicom-medical-imaging
Source: https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/cell-biology/pydicom-medical-imaging
Command: npx skills add https://github.com/jaechang-hits/SciAgent-Skills --skill pydicom-medical-imaging

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides a robust Python interface to read, write, and manipulate DICOM (Digital Imaging and Communications in Medicine) files, enabling the extraction and processing of medical imaging data.

Core Features & Use Cases

  • Metadata Extraction: Access patient information, study parameters, and imaging settings from DICOM files.
  • Pixel Data Handling: Extract image pixel data as NumPy arrays for analysis, apply windowing (VOI LUT), and convert to standard formats.
  • Anonymization: Remove Protected Health Information (PHI) from DICOM files for de-identification.
  • DICOM Creation: Generate new DICOM files from NumPy arrays with appropriate metadata.
  • Series Processing: Load and stack DICOM series into 3D volumetric arrays.
  • Use Case: Analyze CT scan data by loading a series of DICOM files, converting pixel data to Hounsfield Units, and visualizing orthogonal slices.

Quick Start

Use the pydicom-medical-imaging skill to read the DICOM file 'scan.dcm' and print the patient's name and image dimensions.

Frequently Asked Questions about pydicom-medical-imaging

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

FAQPage Schema
How do I read DICOM metadata and pixel data in Python?

To read DICOM metadata and pixel data in Python, use the pydicom library to access file attributes and extract pixel arrays into NumPy for analysis. You can retrieve patient information, study parameters, and image dimensions directly from the DICOM object.

Can I convert DICOM files to PNG images?

Yes, you can convert DICOM files to PNG images by extracting the pixel data into a NumPy array, applying modality and VOI LUTs for windowing, and saving the result as a standard image format using Pillow.

How do I anonymize patient data in DICOM files?

To anonymize patient data in DICOM files, use pydicom to access and remove Protected Health Information (PHI) attributes from the file's metadata. This de-identification process ensures compliance with privacy standards before sharing medical imaging data.

What is the best way to reconstruct 3D volumes from DICOM series?

The best way to reconstruct 3D volumes from DICOM series is to load and stack sequential DICOM files into a 3D volumetric NumPy array using pydicom. This enables visualization of orthogonal slices from CT or MRI scans.

Does pydicom support compressed DICOM transfer syntaxes?

Yes, pydicom supports compressed DICOM transfer syntaxes when optional codec handlers like pylibjpeg, pylibjpeg-libjpeg, pylibjpeg-openjpeg, and python-gdcm are installed. These dependencies decode compressed pixel data for further processing.

Can I write new DICOM files from NumPy arrays?

Yes, you can write new DICOM files from NumPy arrays by constructing a DICOM dataset with pydicom and attaching appropriate metadata to the pixel array. This allows generating valid DICOM files for medical imaging workflows.