Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. import pytrip as pt
  2.  
  3. dcmf = "/local/dicom/pinnacle3-9.9-phantom-imrt"
  4. dcm = pt.dicomhelper.read_dicom_folder(dcmf)
  5.  
  6. dcmf2 = "chestdcm"
  7. dcm2 = pt.dicomhelper.read_dicom_folder(dcmf2)
  8.  
  9. c = dcm['images']
  10. c2 = dcm2['images']
  11.  
  12. clist = []
  13.  
  14. for item in c[0]:
  15.  
  16. t1 = item.tag
  17. n1 = str(item.name)
  18. v1 = str(item.value).strip()
  19.  
  20. t2 = ''
  21. n2 = ''
  22. v2 = ''
  23.  
  24.  
  25. if t1 in c2[0]:
  26. t2 = c2[0][t1].tag
  27. v2 = str(c2[0][t1].value).strip()
  28. n2 = str(c2[0][t1].name)
  29.  
  30. clist.append((t1,n1,v1,
  31. t2,n2,v2))
  32.  
  33. for item in c2[0]:
  34.  
  35. t1 = ''
  36. n1 = ''
  37. v1 = ''
  38.  
  39. t2 = item.tag
  40. v2 = str(item.value).strip()
  41. n2 = str(item.name)
  42.  
  43. if t2 not in c[0]:
  44. clist.append((t1,n1,v1,
  45. t2,n2,v2))
  46.  
  47. for item in clist:
  48. print("{:16}{:30.30}{:80.80}|{:16}{:30.30}{:80.80}".format(str(item[0]),item[1],item[2],
  49. str(item[3]),item[4],item[5]))
  50.  
  51. #v = dcm['rtss']
  52. #v2 = dcm2['rtss']
  53.  
  54. #print(v)
  55. #print(v2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement