fix: add pixel spacing extraction fallback to Imager Pixel Spacing tag #2544
+6
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
In some MG datasets,
PixelSpacing (0028,0030)is missing butImagerPixelSpacing (0018,1164)is present (e.g., 0.1, 0.1). The loadercurrently only checks
0028,0030, soimagePlaneModule.usingDefaultValuesbecomes
true,hasPixelSpacingisfalse, and measurement tools fall backto
px. This change adds a fallback to read0018,1164so pixel spacing isrecognized and measurements use real-world units.
No issue was filed; this was identified while debugging
LengthToolunitsshowing
pxdespite valid spacing in the DICOM header.Changes & Results
ImagerPixelSpacing (0018,1164)whenPixelSpacing (0028,0030)is missing in WADO-URI metadata extraction.hasPixelSpacing = false, measurements display inpx.hasPixelSpacing = true, measurements use mm based on 0.1 spacing.Testing
Manual:
0028,0030but has0018,1164 = [0.1, 0.1].imagePlaneModule.pixelSpacingand verify it is[0.1, 0.1].LengthTooland confirm the unit ismm(notpx).0028,0030and confirm behavior is unchanged.Automated tests not added (metadata extraction path only).
Checklist
PR
semantic-release format and guidelines.
Code
etc.).
Public Documentation Updates
additions or removals. (N/A, no public API changes)
Tested Environment