Skip to content
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

fix: 2965 Correct Parsing Logic for Qualitative Instance Level SR #2972

Merged
merged 3 commits into from
Oct 25, 2022

Conversation

GitanjaliChhetri
Copy link

@GitanjaliChhetri GitanjaliChhetri commented Oct 4, 2022

Fix for #2965

Explanation below:
Qualitative slice-level SR annotations are within the Measurement Group container, which is obtained through

srDisplaySet.measurements = getMeasurements(ContentSequence);

This particular dataset did not have any ImageLibrary, hence getReferenceImagesList() was throwing errors.

I modified platform/core/src/DICOMSR/SCOORD3D/utils/getReferencedImagesList.js as it should not look for CodeValue from ImagingMeasurements.

@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Merging #2972 (a368453) into master (fe57c00) will decrease coverage by 0.73%.
The diff coverage is 2.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2972      +/-   ##
==========================================
- Coverage   12.68%   11.94%   -0.74%     
==========================================
  Files         306      307       +1     
  Lines        8233     8448     +215     
  Branches     1593     1677      +84     
==========================================
- Hits         1044     1009      -35     
- Misses       5797     5954     +157     
- Partials     1392     1485      +93     
Impacted Files Coverage Δ
...latform/core/src/DICOMSR/SCOORD3D/parseSCOORD3D.js 2.63% <0.00%> (-0.76%) ⬇️
.../core/src/DICOMSR/SCOORD3D/utils/addMeasurement.js 5.40% <ø> (ø)
.../DICOMSR/SCOORD3D/utils/getReferencedImagesList.js 6.25% <0.00%> (-0.90%) ⬇️
...re/src/DICOMSR/SCOORD3D/utils/getRenderableData.js 1.72% <0.00%> (-0.07%) ⬇️
...orm/core/src/DICOMSR/parseDicomStructuredReport.js 7.50% <0.00%> (-1.60%) ⬇️
platform/core/src/classes/HotkeysManager.js 76.66% <0.00%> (ø)
platform/core/src/classes/StudyLoadingListener.js 1.03% <0.00%> (+0.01%) ⬆️
...latform/core/src/classes/metadata/StudyMetadata.js 1.25% <0.00%> (-0.04%) ⬇️
.../core/src/measurements/tools/dicomSRDisplayTool.js 50.00% <0.00%> (ø)
.../src/studies/services/wado/studyInstanceHelpers.js 1.56% <0.00%> (-0.48%) ⬇️
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7aba01f...a368453. Read the comment docs.

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please updat the description of the PR, I'm not in the loop of what is happening. Why we are removing referenced images?

@fedorov
Copy link
Member

fedorov commented Oct 5, 2022

I second @sedghi - @GitanjaliChhetri can you please summarize what this PR is doing and why?

@GitanjaliChhetri
Copy link
Author

Updated the description to explain the fix,

@fedorov
Copy link
Member

fedorov commented Oct 6, 2022

@GitanjaliChhetri can you please include specific SR samples that you are using to guide the development in this PR and test the revised code?

Reference images are not required for slice level annotations, moreover it wasn't used anywhere in the code.

What do you mean by "reference images" here?

I reverted his changes from platform/core/src/DICOMSR/SCOORD3D/utils/getReferencedImagesList.js as it should not look for CodeValue from ImagingMeasurements.

I am not sure I understand what this means either ("as it should not look for CodeValue from ImagingMeasurements").

@GitanjaliChhetri
Copy link
Author

GitanjaliChhetri commented Oct 6, 2022

@fedorov Please see the investigation details below:

This issue was opened to double check the fix done for #2935.

What was the bug? Failed to parse the SR display set (dataset here: #2935 (comment))
What caused the error? Incomplete check at https://github.com/GitanjaliChhetri/Viewers/blob/7aba01f534b70406ce02e1708004141c7b773904/platform/core/src/DICOMSR/SCOORD3D/utils/getReferencedImagesList.js#L15
while searching the SR content tree for the Image Library (TID 1600) Content item.

TID 1501 (Measurement group) content is obtained from https://github.com/GitanjaliChhetri/Viewers/blob/7aba01f534b70406ce02e1708004141c7b773904/platform/core/src/DICOMSR/SCOORD3D/parseSCOORD3D.js#L31
Also note that references to image objects (for annotations, coordinates) are encoded with a value type of IMAGE using TID 1410.
https://github.com/GitanjaliChhetri/Viewers/blob/7aba01f534b70406ce02e1708004141c7b773904/platform/core/src/DICOMSR/SCOORD3D/utils/processMeasurement.js#L4

Few other SR samples I used for regression testing can be found in these older issues -
#2797 (comment)
#2797 (comment)
#2852

@sedghi
Copy link
Member

sedghi commented Oct 7, 2022

I let @igoroctaviano review first

@GitanjaliChhetri
Copy link
Author

@GitanjaliChhetri can you please include specific SR samples that you are using to guide the development in this PR and test the revised code?
Included in my response.

Reference images are not required for slice level annotations, moreover it wasn't used anywhere in the code.

What do you mean by "reference images" here?
I think 'referencedImages' at

srDisplaySet.referencedImages = getReferencedImagesList(ContentSequence);
is a slightly confusing object name because this object is returned from the Image Library Container within the TID 1600 template.
This is not the IMAGE content item within the Measurement group container.

I reverted his changes from platform/core/src/DICOMSR/SCOORD3D/utils/getReferencedImagesList.js as it should not look for CodeValue from ImagingMeasurements.

I am not sure I understand what this means either ("as it should not look for CodeValue from ImagingMeasurements").

I meant that while searching the SR content tree for the Image Library Container, we should not be looking into the of Imaging Measurements container. Hence I reverted that portion of the fix.

Copy link
Contributor

@igoroctaviano igoroctaviano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

4 participants