fix(dicomImageLoader): use calibrated pixel spacing (if available) when loading DICOM images via WADO-RS #2403
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
Currently, the WADO-RS dicomImageLoader uses only the DICOM tag "PixelSpacing" (0028,0030) for setting the size of the loaded pixels. However, for projection radiography studies (DX, CR), this DICOM tag can be missing. Such DICOM files instead have the tag ImagerPixelSpacing (0018,1164) (which additionally may need to be corrected according to the EstimatedRadiographicMagnificationFactor tag).
If the PixelSpacing tag is missing, the measurement tools currently show a value in pixels, but the shown unit is "mm". Hence, it shows incorrect values. This discrepancy arises because the annotation tools use the calibratedPixelSpacingMetadataProvider for determining which unit should be shown, while the measurement value is calculated via canvas-to-world conversions, which account only for the pixel spacing set during loading of the image.
Therefore, this PR modifies the WADO-PR loader to utilize the pixel spacing from the calibratedPixelSpacingMetadataProvider when loading the image pixel data, as the corrected pixel spacing is typically already available there (calculated with the function getPixelSpacingInformation when processing the WADO-RS metadata call). If the calibratedPixelSpacingMetadataProvider does not have an entry for the current imageId, it falls back to the PixelSpacing tag (0028,0030), as before.
Changes & Results
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment