Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Merge a dataset (ds) into another dataset.

33 views
Skip to first unread message

Normand Robert

unread,
May 31, 2024, 5:14:03 PM5/31/24
to pydicom
I am creating a version of findscu.py that can do multiple queries via an input CSV file but gives priority  to the dataset (ds)  initialized from a DICOM fille and via cmd line args which is the current behaviour.

Is there a more elegant way to merge datasets than this:

# Merge ds into dss
    for my_ds in dss:
        # print (my_ds)
        for d in ds.iterall():
            elem = ElementPath(d.keyword + '='+ d.value)
            my_ds=elem.update(my_ds)

Regards

Normand Robert

unread,
Aug 30, 2024, 1:05:04 PM8/30/24
to pydicom
Figured it out Very simple with update() method:
my_ds.update(ds)
Reply all
Reply to author
Forward
0 new messages