-
-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OverflowError "VR of 'DS' must be <= 16 characters long" triggered when element is 16 characters long #1632
Comments
For reference, a possibly similar issue came up in dcmjs: dcmjs-org/dcmjs#175 |
I had a quick look, and the problem seems to be that the length is not taken from the original string, but from the string representation, which in this case adds a leading zero... This check has been introduced in pydicom 2.2.0. |
- use str() instead of repr() for validation - this uses the original string if available - fixes pydicom#1632
This is indeed somewhat similar as it also converted the original value to a normalized representation which is too long for DS. Note that |
The pydicom approach of keeping the original values for DS and other potentially lossy conversions makes good sense and we should see how something similar could be done in javascript. |
Yes, this is a simple solution to a non-trivial problem, as it avoids the problems of floating point precision vs notation (or rather sidesteps them...). |
- use str() instead of repr() for validation - this uses the original string if available - fixes pydicom#1632
- use str() instead of repr() for validation - this uses the original string if available - fixes #1632
Thanks for addressing this so quickly! |
Describe the bug
OverflowError
triggered while accessingPixelData
, which the values compliant with the standard. In the sample referenced in the example below, we have this, which satisfies DS VR:But nevertheless the error is triggered while trying to access
PixelData
:Expected behavior
OverflowError
does not get triggered.Steps To Reproduce
Follow the steps of this Colab notebook: https://colab.research.google.com/drive/1FcSgjBKazh0YN-jlJYdID0YUTh90CAvZ?usp=sharing
Your environment
Related issue: imi-bigpicture/wsidicom#49
cc: @DanielaSchacherer @dclunie @hackermd
The text was updated successfully, but these errors were encountered: