Hello,
I just started playing with pydicom and I am having some trouble reading a DICOMDIR file.
I studied the pydicom myprint() example and wrote code to parse the DICOMDIR hierarchy recursively.
The DICOMDIR is structured as usual in a PATIENT->STUDY->SERIES->IMAGE hierarchy
To my suprise, the following code prints out all IMAGE, STUDY, PATIENT, and SERIES tags, even thought it is NOT going
into recursion. It seems like the hierarchy is somehow flattened.
def Test(ds):
for element in ds:
if element.VR == "SQ":
test = element.value;
for item in test:
print(item[0x0004, 0x1430].value)
ds = dicom.read_file("DICOMDIR')
Test(ds)
What is the reason for this. Is pydicom able to handle DICOMDIR at all?
Reading the hierarchy with dcmtk for example is no problem.
I am using python-xy with pydicom 0.9.8-2
Best Regards,
Stefan