Skip to content

fix(value-representation): prevent truncation of DA, DT, and TM in denormalization #427

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

Conversation

mishijima
Copy link
Contributor

Follow-up to #426

This PR addresses the following:

  • Reverts changes related to writeBytes for DA, DT, and TM.
  • Adds allowRangeMatching to the ValueRepresentation class to indicate whether a VR supports range matching.
  • Updates the truncation logic in denaturalizeDataset:
    • If vr.allowRangeMatching() and vr.rangeMatchingMaxLength return true, maxLength is set to vr.rangeMatchingMaxLength.

Copy link

netlify bot commented Mar 21, 2025

Deploy Preview for dcmjs2 ready!

Name Link
🔨 Latest commit 3fdff3b
🔍 Latest deploy log https://app.netlify.com/sites/dcmjs2/deploys/67dd5962ad025d000831a9af
😎 Deploy Preview https://deploy-preview-427--dcmjs2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@PantelisGeorgiadis
Copy link
Contributor

Hello @mishijima,
I made an effort to fix the issue, working on top of your PR.

  • I removed the allowRangeMatching because the existence of rangeMatchingMaxLength, for a VR, gives the same information.
  • I used the existing checkLength function for DA, TM and DT to determine a range query and return whether the length is valid or not.
  • I updated the unit tests to perform a full roundtrip between the naturalized and denaturalized worlds.
  • I used the build output with dcmjs-dimse to make sure that range queries are working as expected.

Since I cannot update your PR, please review the patch I'm attaching and, if you approve, apply it on top. Then @pieper can review the changes and approve (or not!).

Patch: patch.zip

@PantelisGeorgiadis
Copy link
Contributor

Hello @mishijima,
Had the chance to check my patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants