Python code to read DICOMDIR and create anonymous file mapping
No need to install
- python3.x+
- pydicom
- Parse DICOMDIR and create mapping file (also remove sensitive fields)
python make_anonymous.py --dicomdir_path PATH_TO_FOLDER_WITH_DICOMDIR
It will create a
- anonymous_mapping.csv (file):info that should be keep by maintainer (ex. doctor)
- anonymous (folder) --patient_ids -- parsed folder with dicom files
- Fast copy relative folders
Because program will parse all files that can be scaned by DICOMDIR, irrelative folders will not need to dump for clients.
Maintainer can open theanonymous_mapping.csv
and change the flag of "select" (first column) from 0 -> 1. and run thefast_movefolder.py
dicom files can be viewed with imageJ. Maintainer should check required images of folders and mark them in the anonymous_mapping.csv.
python fast_movefolder.py --dicomdir_path PATH_TO_FOLDER_WITH_DICOMDIR
It will create a new folder convert
that contains folders that been selected.
Finally, give the convert
to people who needs it and keep the anonymous_mapping.csv.