Menu

Stop writing ds[0x0010, 0x0010].value — there's a better way to handle DICOM in Python
🖼️

Stop writing ds[0x0010, 0x0010].value — there's a better way to handle DICOM in Python

DEV Community·Mustufa Merchant·6 months ago
#xa0oJab3
Reading 0:00
15s threshold

Every Python DICOM tutorial starts the same way:

import pydicom ds = pydicom . dcmread ( " scan.dcm " ) print ( ds [ 0x0010 , 0x0010 ]. value ) # patient name??

Enter fullscreen mode

Exit fullscreen mode

You memorize hex pairs. You copy-paste anonymization tag lists from Stack Overflow. You write the same VOI windowing helper for the third time on a new project.

I got tired of it. So I built DICOMForge.

What it looks like instead

from dicomforge.api import DicomFile f = DicomFile ( " scan.dcm " ) print ( f . patient_name , f . modality , f . slice_thickness )

Enter fullscreen mode

Exit fullscreen mode

Named properties. No hex. No .value.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.