testUpload.py 627 B

123456789101112131415161718192021222324252627282930313233
  1. import os
  2. import json
  3. import re
  4. import subprocess
  5. #import nibabel
  6. import shutil
  7. import sys
  8. import pydicom
  9. shome=os.path.expanduser('~studen')
  10. sys.path.insert(1,shome+'/software/src/orthancInterface')
  11. import orthancInterface
  12. import orthancFileBrowser
  13. fhome=os.path.expanduser('~')
  14. fconfig=os.path.join(fhome,'.labkey','network.json')
  15. onet=orthancInterface.orthancInterface()
  16. onet.init(fconfig)
  17. ofb=orthancFileBrowser.orthancFileBrowser(onet)
  18. uploadDir=os.path.join(fhome,'temp','testFiles')
  19. files=os.listdir(uploadDir)
  20. for f in files:
  21. fg=os.path.join(uploadDir,f)
  22. print(fg)
  23. ofb.upload(fg)
  24. print("Done")