convert x-ray dicom to png

C++
mogrify -format png *.dcm
magick mogrify -format png *.dcm

Source

Also in C++: