This is a simple python script to convert dicom files to png files based on dataframe to only convert matching dicom files. It uses the SimpleITK library to read and convert the dicom files and the Pillow library to save the png files.
To install the required libraries, run the following command:
pip install -r requirements.txt
To convert dicom files to png files, run the following command:
python dcm2png.py
To configure the script, open the dcm2png.py
file and modify the following variables:
dcm_path
: The directory containing the dicom files.output_path
: The directory to save the png files. If the directory does not exist, it will be created.