Script to download studies from a DICOMweb server, given their Study Instance UIDs.
The script loops through the studies, their series and their instances, downloads one instance at a time as a DICOM part 10 file (i.e. *.dcm file). If a file exists then it will skip over it. Thus it has basic support for resuming where it left off in the last time it executed.
Utilizes DICOMwebClient, but supports fallback for some edge cases when DICOMwebClient fails.
Update the following variables:
studyUids
An array/list of Study Instance UIDs you want to downloadrootUrl
The URL to the root of the DICOMweb service you're about to download fromdownloadDir
Local directory to write the DICOM files to. The script will write each file as subfolders like so:<study UID>/<series UID>/instanceUID.dcm
- (Optional)
sleepInterval
If you need to throttle retrieval requests to minimize chances of rejected requests. In seconds.
pip3 install -r requirements.txt
python3 main.py