sye8 / dicom2png

Extracts the pixel arrays from dicom files in a directory and save those as 16-bit png

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dicom2py

Extracts the pixel arrays from dicom files in a directory and save those as 16-bit png.

The pixel values are rescaled using the RescaleSlope and RescaleIntercept stored in the DICOM file.

By default, the PNG will be named using DICOM InstanceNumber. The original filename can be optionally chosen to be appended to PNG filename.

Dependencies

pydicom opencv-python numpy tqdm 

How to Run

python3 dicom2png.py [-h] [--a_orig_filename] input output

Positional Arguments

  • input: input path to directory containing the DICOM files

  • output: output path to directory where the PNG files will be save

Optional Arguments

  • -h, --help: See help

  • a_orig_filename: If present, the original filename will be appended to the PNG filename

About

Extracts the pixel arrays from dicom files in a directory and save those as 16-bit png

License:MIT License


Languages

Language:Python 100.0%