-
Notifications
You must be signed in to change notification settings - Fork 444
fix(dicomImageLoader): use calibrated pixel spacing (if available) when loading DICOM images via WADO-RS #2403
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
base: main
Are you sure you want to change the base?
Conversation
| }; | ||
| } | ||
|
|
||
| if (type === MetadataModules.IMAGE_PLANE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code has been moved to shared code between different types of instance data.
| export const PIXEL_INSTANCE = 'PixelInstanceModule'; | ||
|
|
||
| export class ImagePlaneModule extends Module<Types.ImagePlaneModuleMetadata> { | ||
| public fromInstance(instance) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the standard implementation from OHIF in the fromInstance. Making sure everyone goes through the single standard implementation allows for fixing the implementation as required for various types of new implementations.
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