python type of a new tag value and save_as()

10 views
Skip to first unread message

Dan Cutright

unread,
Apr 16, 2020, 11:44:16 AM4/16/20
to pydicom
After editing tag values of ds, where ds = pydicom.read_file(), will ds.save_as() always safely convert new tag values of type str to the tag's VR?

My hunch is that this is true with exception of maybe pixel data, is that correct?

Thanks!

Dan

Dan Cutright

unread,
Apr 16, 2020, 11:45:33 AM4/16/20
to pydicom
I should clarify, also unless it's a MultiValue, then I'm assuming a list of str is sufficient?

Darcy Mason

unread,
Apr 19, 2020, 12:31:37 PM4/19/20
to pyd...@googlegroups.com
Hi Dan,

Yes, what you have said should be true.  Any time a value is set (including through MultiValue), pydicom runs the value through a conversion process according to the VR.

If you see anything that acts differently, let us know...

Darcy
Reply all
Reply to author
Forward
0 new messages