Skip to content

Conversation

@jcupitt
Copy link
Collaborator

@jcupitt jcupitt commented Oct 21, 2025

We were failing silently if string length validation failed. With this PR, issue a warning and let long strings though.

Also, add a -w flag (show warnings) to dcm-dump and dcm-getframe.

Thanks @arngaillard

See #105

We were failing silently if string length validation failed. With this PR,
issue a warning and let long strings though.

Also, add a `-w` flag (show warnings) to `dcm-dump` and `dcm-getframe`.

Thanks @arngaillard

See #105
@jcupitt
Copy link
Collaborator Author

jcupitt commented Oct 21, 2025

With this PR, libdicom warns (it was failing silently) for string length validation failure and passes the out of spec string downstream.

I now see:

$ vipsheader converted.0_0_0.dcm
converted.0_0_0.dcm: 51200x38144 uchar, 4 bands, srgb, openslideload

ie. everything works by default.

I added a -w flag to display warnings and with that I see:

$ dcm-dump -w converted.0_0_0.dcm > log
WARNING  [Tue Oct 21 15:35:04 2025] - Data Element capacity check failed -- Value of Data Element '00280030' exceeds maximum length of Value Representation (16)

And the dcm-dump output shows:

(5200,5200) SharedFunctionalGroupsSequence [
  ---Item #1---
  (0028,0028) PixelMeasuresSequence [
    ---Item #1---
    (0018,0050) SliceThickness | DS | 2 | 1 | 1
    (0018,0088) SpacingBetweenSlices | DS | 2 | 1 | 1
    (0028,0030) PixelSpacing | DS | 42 | 2 | [4.564125969876768E-4, 4.550625711035267E-4]
  ]
  (0040,0040) WholeSlideMicroscopyImageFrameTypeSequence [
    ---Item #1---
    (0008,9007) FrameType | CS | 28 | 4 | [DERIVED, PRIMARY, VOLUME, NONE]
  ]
]

ie. the out of spec value is handled correctly.

@jcupitt
Copy link
Collaborator Author

jcupitt commented Oct 22, 2025

@arngaillard has tested this and it seems to work, I'll merge.

@jcupitt jcupitt merged commit b269219 into main Oct 22, 2025
7 checks passed
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