How to convert .png images to DICOM files in a batch

Operating system:
Slicer version:
Expected behavior:
Actual behavior:
I have a CTA with png format. Can we convert png images to DICOM files in a batch?
Thanks

You can certainly do this with Slicer, but this should not be needed. Can you tell a bit more about your workflow?

Normally you don’t get medical images in png format. In png files you don’t have any metadata and if your CT images have only 8 bits per pixel (256 gray levels) then they may be unusable for clinical purposes.

Where these png files come from?

1 Like

Thank you very much!
I agree with you DICOM is the best format choise. But I got some pictures from my friend who are not a doctor, and I need convert these png files to DICOMs and then analysis. So can you give a tutorial to deal with it.
Thanks!

My friend photographed a group of sliced tissue cells through an electron microscope and hope me could hep rebuild a 3D picture.

OK, when the images are not from a DICOM-capable device then importing from png makes sense.

I don’t think Slicer can easily export color images to DICOM. If you convert to grayscale using “Vector to scalar volume” module then you can export the volume to DICOM. Or, you can probably do it with pydicom and some Python scripting.

Instead of exporting, you may try perform all visualization and analysis in Slicer. Or, if you need limited 3D analysis then you may use ImageJ or other microscopy-oriented software.