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.
1) Fill in the blanks
Update the following variables:
studyUidsAn array/list of Study Instance UIDs you want to download
rootUrlThe URL to the root of the DICOMweb service you’re about to download from
downloadDirLocal directory to write the DICOM files to. The script will write each file as subfolders like so:
<study UID>/<series UID>/instanceUID.dcm
sleepIntervalIf you need to throttle retrieval requests to minimize chances of rejected requests. In seconds.
2) Install dependencies
pip3 install -r requirements.txt