Skip to content
/ dicom2png Public

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

License

Notifications You must be signed in to change notification settings

sye8/dicom2png

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

dicom2png

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages