Code Monkey home page Code Monkey logo

Comments (4)

pieper avatar pieper commented on July 20, 2024

There are some other places where converting to native times causes differences due to rounding errors, so we thought about keeping the original value in a _original field or similar so that this kind of issue won't lead to a validation error on round trips. Otherwise I'm not sure we want NaNs in the fields that we plan to compute on - a goal of the normalizing steps is to handle all the special cases so that application code isn't littered with if statements. Since I don't think the standard allows NaN or Infinity so it's fair to reject them but I understand the goal of dealing well with nonstandard data.

from dcmjs.

richard-viney avatar richard-viney commented on July 20, 2024

Makes sense, however I don't believe this is non-standard data or a special case. We've just seen it in the real world coming from a GE Vivid S70 v201.102.0 Ultrasound machine.

It appears that NaN values are sometimes put into tags with a VR of FD (double float) that are required by the spec, but for which the machine doesn't have a useful/sensible/legitimate value for. So they put NaN to fill the gap. This seems reasonable, and AFAICT is valid according to the DICOM spec.

The FD VR is defined as Double precision binary floating point number represented in IEEE 754:1985 64-bit Floating Point Number Format. (link), and both NaN and infinity values are defined by IEEE 754:1985, so these values are allowed in FD tags. However they're not allowed in other VRs that store numeric values, such as DS (decimal string) and IS (integer string).

Thoughts?

I've just opened a PR that removes the NaN check and adds a couple of tests.

from dcmjs.

pieper avatar pieper commented on July 20, 2024

Ah, I see, FD no DS, yes, allowing NaN and Inf makes sense, thanks for the explanation.

from dcmjs.

github-actions avatar github-actions commented on July 20, 2024

🎉 This issue has been resolved in version 0.29.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

from dcmjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.