
Try: os.mkdir(path1) # Create a directory Path1 = os.path.join(base_dir, patient_name)# splicing directory The only thing that needs to be modified is line 7 path = ‘ ’Fill in the address of the DICOMDIR file, such as C:\DICOMDIR import osįrom pydicom.filereader import read_dicomdirįor patient_record in dicom_dir.patient_records: # got through each patient Occasionally, the program will stop due to the wrong directory name where the DICOM image is located However, images of multiple patients and multiple sequences are stored together, and it is difficult to distinguish which images belong to the same patient.Īccording to the matching DICOMDIR file, the pydicom module of python can be used to operate the DICOMDIR file and convert the above DICOM image into hierarchical storage.īe sure to back up the original file before running the code.

Mixed storage of DICOM images, including multiple patients, multiple study times (examination times), multiple and multiple sequences, multiple images.
