You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dcm2json remains extremely vague about CP-1861 a warning (or code change) should be indicated.
To Reproduce
$ dcm2json -h
[...]
-N,--encode-as-number encode DS, IS, SV and UV values as JSON
numbers; by default DS, IS, SV and UV
values are encoded as JSON strings
[...]
For example:
% dcmtk-3.6.6/dcmdump input.dcm | grep SV
(0017,100f) SV 1499816949527975237 # 8, 1 Unknown Tag & Data
This specification allows implementations to set limits on the range
and precision of numbers accepted. Since software that implements
IEEE 754-2008 binary64 (double precision) numbers [IEEE754] is
generally available and widely used, good interoperability can be
achieved by implementations that expect no more precision or range
than these provide, in the sense that implementations will
approximate JSON numbers within the expected precision. A JSON
number such as 1E400 or 3.141592653589793238462643383279 may indicate
potential interoperability problems, since it suggests that the
software that created it expects receiving software to have greater
capabilities for numeric magnitude and precision than is widely
available.
Note that when such software is used, numbers that are integers and
are in the range [-(253)+1, (253)-1] are interoperable in the
sense that implementations will agree exactly on their numeric
values.
Allowing implementations to set limits is not equals to specifying a limit. And JSON != ECMA-262.
Anyway, I agree, that it causes lesser troubles to silently ignore --encode-as-number for values outside the 64-bit binary format IEEE 754 range.
gunterze
changed the title
dcm2json: -N,--encode-as-number should be carefully documented
dcm2json: silently ignore -N, --encode-as-number for values outside the range [-(2^53)+1, (2^53)-1]
Feb 4, 2021
Describe the bug
dcm2json remains extremely vague about CP-1861 a warning (or code change) should be indicated.
To Reproduce
$ dcm2json -h
[...]
-N,--encode-as-number encode DS, IS, SV and UV values as JSON
numbers; by default DS, IS, SV and UV
values are encoded as JSON strings
[...]
For example:
leads to:
Expected behavior
I would have expected two behaviors:
The text was updated successfully, but these errors were encountered: