study instance uid changes when using save_as

29 views
Skip to first unread message

Dan

unread,
Apr 20, 2020, 9:11:47 AM4/20/20
to pydicom
Hi

Disclaimer - I'm pretty new to dealing with DICOM data and am just getting familiar with the various tags.

I am involved in a project building an application for analysing medical imaging data (image processing) which is received directly from a hospital PACS. We use pydicom (thank you!) for storing DICOM files when received (we also use pynetdicom to handle receiving - thanks for that too!).

A series is received one file at a time and is stored using the file `SOPInstanceUID` as the filename. I have a test data set that I am working from that contains 176 images in the series. When using

Dataset().save_as()

to save each file in the series with the `SOPInstanceUID` I end up with files where the `StudyInstanceUID` no longer matches that in the original file and is different for each file in the series.

Can somebody explain what is going here please? Where did I go wrong?

Many thanks for your help in advance!

Cheers,

Dan.

Darcy Mason

unread,
Apr 20, 2020, 12:42:03 PM4/20/20
to pydicom
Hi Dan,

Pydicom should never change the StudyInstanceUID unless it is done in user code.  Perhaps a pynetdicom example code was used that modified the StudyInstanceUID?  I'd suggest a global search through your code used for any occurrence of "StudyInstanceUID" to make sure.  

Also, do the new values start with the pydicom root UID '1.2.826.0.1.3680043.8.498.'?

Daniel Matthews

unread,
Apr 20, 2020, 2:44:31 PM4/20/20
to pyd...@googlegroups.com
Hi Darcy

Thanks for getting back to me so quickly. It was of course something in our code... I wouldn't have found it without your hint though so thank you!

Cheers,

Dan.

--
You received this message because you are subscribed to the Google Groups "pydicom" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydicom+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pydicom/be8207eb-488f-4556-87ad-a4c3fcc73599%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages