-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
feat: Annotation and Measurements support on multi-frame DICOM #2973
Conversation
…o per-frame instance copy
… correct instance number and frame number
…'t have "description"
…loading Frame 1 twice, and not loading the last frame. Due to wrong frame number indexing (frame number begins with 1, not 0)
✅ Deploy Preview for ohif-platform-docs canceled.
|
✅ Deploy Preview for ohif-platform-viewer canceled.
|
Codecov Report
@@ Coverage Diff @@
## v3-stable #2973 +/- ##
==============================================
+ Coverage 25.15% 37.54% +12.38%
==============================================
Files 119 101 -18
Lines 2862 2152 -710
Branches 555 439 -116
==============================================
+ Hits 720 808 +88
+ Misses 1856 1101 -755
+ Partials 286 243 -43
Continue to review full report at Codecov.
|
extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.js
Outdated
Show resolved
Hide resolved
Do you have sample objects produced by the code proposed in this PR that would illustrate supporting of annotations and measurements on multi-frame files and saving Measurement SRs on multi-frame DICOM files? |
extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.js
Outdated
Show resolved
Hide resolved
extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.js
Outdated
Show resolved
Hide resolved
extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.js
Outdated
Show resolved
Hide resolved
extensions/cornerstone/src/Viewport/OHIFCornerstoneViewport.tsx
Outdated
Show resolved
Hide resolved
as that doesn't assume anything about the layout/design and just gets next until done.
…an array that happens to have attributes of child zero when of length 1, but you shouldn't count on that.
…rameNumber parameter for future usage : now they are just ignored as we are not supporting multiframe splits
extensions/cornerstone/src/Viewport/OHIFCornerstoneViewport.tsx
Outdated
Show resolved
Hide resolved
extensions/cornerstone/src/Viewport/OHIFCornerstoneViewport.tsx
Outdated
Show resolved
Hide resolved
extensions/cornerstone/src/utils/measurementServiceMappings/ArrowAnnotate.js
Outdated
Show resolved
Hide resolved
extensions/cornerstone/src/utils/measurementServiceMappings/ArrowAnnotate.js
Show resolved
Hide resolved
extensions/cornerstone/src/utils/measurementServiceMappings/Bidirectional.js
Outdated
Show resolved
Hide resolved
@@ -61,6 +68,7 @@ export default function addMeasurement( | |||
TrackingUniqueIdentifier: measurementData.TrackingUniqueIdentifier, | |||
renderableData: measurementData.renderableData, | |||
}, | |||
frameNumber: frameNumber, |
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.
we should not stick the frameNumber
here, it is not a data
per se. can't we just infer it from the referencedImageId? seeing if it has frames/...
at the end?
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 to conform with the changes we've made to dcmjs - cornerstone3D adapter: dcmjs-org/dcmjs#317
extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.js
Outdated
Show resolved
Hide resolved
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.
Thanks @md-prog this is a great PR.
I put couple of comments above. There are couple of other issues
- When I try it locally it is not able to hydrate the SR for multiframe. It can draw and jump, but saving and hydration just puts everything ins the first slice (instance).
To reproduce: open a multiframe study (I opened the brain MRI you gave me), draw length on two separate slices. Save report (to generate SR). 1) At this time the cornerstone viewport is unmounted and SR viewport mounts, which uses the SRDisplayTool (not hydrated yet), and as you see below it does not work 2) You can click on the -> to hydrate (or alternatively you can refresh the page and drag and drop SR and -> to hydrate), and that does not work either (don't have screenshot for it (but the same issue)
- This might not be the issue in your PR but noticed the modalities are coming back as OT (Other) for some of the multiframes. Also the number of instances it says 1 (which is technically the case), but I guess we can show the number of frames here alternatively for the multiframe
@sedghi, the issue No.1 mentioned in your last comment is related to dcmjs library's "lack of features" (if not defect). Basically, the lines of dcmjs library mentioned in above Github issue, are blocking us to save the annotations made on to the multi-frame file with the correct frame number information. With this issue resolved, the issue should go. (During my development, I had to temporarily use the locally cloned dcmjs with the temporary fix to the issue.) Fix has been proposed in dcmjs-org/dcmjs#320 No.2 is not a new thing, I think. |
…2973) (#79) * added utilities to get frameNumber from imageId and add frameNumber to per-frame instance copy * Fix measurements' display texts on the Measurements Panel to have the correct instance number and frame number * fixed minor React bugs (errors on console) * fixed React's console bugs that are logged for some series that doesn't have "description" * bug fix - multi-frame files was not loading frames correctly. It was loading Frame 1 twice, and not loading the last frame. Due to wrong frame number indexing (frame number begins with 1, not 0) * metadata parser fix - providing default values of imagePlaneModule * measurement SR support on multi-frame DICOM * bug fix - jumping to the selected measurment on multi-frame DICOM * upgrade dcmjs dependency to 2.8.1 * StudySummary component - allow "description" to be null * make getUIDsFromImageID() method public from MetadataProvider * imageId usage fixes to be more stable * change the variable name to be more meaningful * fix metaProvider importing * for(...of) instead of for(i=0;i<length;..) as that doesn't assume anything about the layout/design and just gets next until done. * use Array.findIndex instead of plain for loop * use ReferencedSOPSequence[0] - because the ReferencedSOPSequence is an array that happens to have attributes of child zero when of length 1, but you shouldn't count on that. * DisplaySetService.getDisplaySetForSOPInstanceUID() - added optional frameNumber parameter for future usage : now they are just ignored as we are not supporting multiframe splits * simple code refactoring * refactoring for checking undefined values - mappedAnnotations * remove unreachable code * code refactoring - prefer conditional chaining * fix how we access imageIds of viewport (StackViewport) Co-authored-by: md-prog <[email protected]>
OHIFv3 lacks the support of annotations and measurements on multi-frame DICOM files particularly when we want to persist and load Measurement SRs on multi-frame DICOM files.
There are several issues being resolved in this PR:
External dependencies:
This depends on the changes of
dcmjs
library: dcmjs-org/dcmjs#317The changes has been merged and available on version 0.28.1, therefore updated the package.json for dcmjs library.