Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pytrip as pt
- dcmf = "/local/dicom/pinnacle3-9.9-phantom-imrt"
- dcm = pt.dicomhelper.read_dicom_folder(dcmf)
- dcmf2 = "chestdcm"
- dcm2 = pt.dicomhelper.read_dicom_folder(dcmf2)
- c = dcm['images']
- c2 = dcm2['images']
- clist = []
- for item in c[0]:
- t1 = item.tag
- n1 = str(item.name)
- v1 = str(item.value).strip()
- t2 = ''
- n2 = ''
- v2 = ''
- if t1 in c2[0]:
- t2 = c2[0][t1].tag
- v2 = str(c2[0][t1].value).strip()
- n2 = str(c2[0][t1].name)
- clist.append((t1,n1,v1,
- t2,n2,v2))
- for item in c2[0]:
- t1 = ''
- n1 = ''
- v1 = ''
- t2 = item.tag
- v2 = str(item.value).strip()
- n2 = str(item.name)
- if t2 not in c[0]:
- clist.append((t1,n1,v1,
- t2,n2,v2))
- for item in clist:
- print("{:16}{:30.30}{:80.80}|{:16}{:30.30}{:80.80}".format(str(item[0]),item[1],item[2],
- str(item[3]),item[4],item[5]))
- #v = dcm['rtss']
- #v2 = dcm2['rtss']
- #print(v)
- #print(v2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement