feat: add support to scoord3d
Context
TID.300 measurements can now be defined using either 2D or 3D points with the latest cs3d changes. This is controlled by the use of either SCOORD (2D) or SCOORD3D (3D) in the Measurement Value Sequence, as described in the TID.320 section of TID.300:
🔗 DICOM TID.320 Reference
TID.1501 defines the reference information for the SCOORD3D points: 🔗 DICOM TID.1501 Reference
This pull request introduces support for selecting between SCOORD and SCOORD3D encodings in several TID.300 measurement types, including:
- Length
- Bidirectional
- Cobb Angle
- Ellipse
Changes & Results
It's now possible to save and load SRs with annotations that were drawn on reconstructed views:
https://github.com/user-attachments/assets/b296d0a9-e3c8-406c-9b3b-19022cee67da
Testing
Checklist
PR
- [] My Pull Request title is descriptive, accurate and follows the semantic-release format and guidelines.
Code
- [] My code has been well-documented (function documentation, inline comments, etc.)
Public Documentation Updates
- [] The documentation page has been updated as necessary for any public API additions or removals.
Tested Environment
- [] OS:
- [] Node version:
- [] Browser:
Deploy Preview for ohif-dev ready!
| Name | Link |
|---|---|
| Latest commit | 5571b27ca4deb54205d42bfedf5becfeeda7ad9e |
| Latest deploy log | https://app.netlify.com/sites/ohif-dev/deploys/6819fc61a466b70008f9d555 |
| Deploy Preview | https://deploy-preview-5016--ohif-dev.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for ohif-dev canceled.
| Name | Link |
|---|---|
| Latest commit | dd99a70eacffe50bb059a2eec188aca08c6171f6 |
| Latest deploy log | https://app.netlify.com/projects/ohif-dev/deploys/688aed362f624b00081bbd4e |
@pedrokohler, please try these changes with the IDC point dataset; otherwise, it this will break their scoord3d point support.
@pedrokohler, please try these changes with the IDC point dataset; otherwise, it this will break their scoord3d point support.
I reintroduced the toolName assignment when there is no adapter for the trackingIdentifier. This way the feature is preserved:
@pedrokohler @igoroctaviano is this added/supported by idc?
@pedrokohler @igoroctaviano is this added/supported by idc?
I'd say this PR started because of FUBerlin, but now IDC is also supporting it.
@pedrokohler @igoroctaviano is this added/supported by idc?
I'd say this PR started because of FUBerlin, but now IDC is also supporting it.
@pedrokohler sure, we need a test either way
@sedghi - the save/load are both working, just there are some issues displaying annotations after load and jumping to them. Hope to finish that up early next week
@sedghi - this PR uses the CS3D SCOORD3D PR to allow navigating between 3d and 2d points.
I changed the jump to measurement quite a lot as it was broken, but the code is much more contained inside the cornerstone extension, and is a lot easier to understand now. Basically it tries to find a viewport to navigate to the view containing the image, otherwise it chooses a viewport to change to the updated display set and/or view position.
It works with Video, SM, Stack, orthographic
Saving and loading both work now, and loading points displays them correctly.
@pedrokohler - could you update the PR to be read for review?
@wayfarer3130 it's already 'ready for review'
Hey @wayfarer3130 and @pedrokohler , I am sure you guys are still working on this PR, but I had a quick look at the failing playwright tests for you and it appears different images are loading in various scenarios than before. Please have a look, ensure that the correct image is being displayed now and if so create new screenshots. Thanks.
Hey @wayfarer3130 and @pedrokohler , I am sure you guys are still working on this PR, but I had a quick look at the failing playwright tests for you and it appears different images are loading in various scenarios than before. Please have a look, ensure that the correct image is being displayed now and if so create new screenshots. Thanks.
Thanks for looking at that Joe - I will figure out why it is navigating incorrectly. Might add a new test for the MPR navigation as well since that seems to be broken
When do you think you can have a ready PR for review? please include test dicom studies as well
@sedghi - this PR is ready for review other than needing the navigation images updated
@pedrokohler @wayfarer3130 can you update the Testing section on the PR with proper steps to test, and also dicom files
Viewers
Run #5451
Run Properties:
Passed #5451 •
7900cf1ff0: Merge remote-tracking branch 'origin/master' into feat-add-support-to-scoord3d
| Project |
Viewers
|
| Branch Review |
feat-add-support-to-scoord3d
|
| Run status |
|
| Run duration | 02m 28s |
| Commit |
|
| Committer | Joe Boccanfuso |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
37
|
| View all changes introduced in this branch ↗︎ | |
Going through the steps for testing. Note my testing environment...
OS: Windows 11 Browser: Google Chrome 138.0.7204.169 Node: 23.9.0 Data source: orthanc
When rehydrating the generated report, several annotation geometries and/or text/label/measurement info are missing or are not as expected. In master the geometry and text were as expected. Rectangle…
Actual:
Expected:
Angle…
Probe…
I also noticed that the spline and livewire annotations did NOT save. However, this is consistent with master.
The testing has been paused because several attempts to get passed step 4 of the testing instructions listed in the PR description.
The testing could not proceed past step 4 because during step 4 (i.e. adding and saving annotations on MPR) the following exception was thrown several times. The app would crash and the browser window was completely black.
Error: getDisplaySetByUID: displaySetInstanceUid must be a string, you passed undefined
at DisplaySetService.getDisplaySetByUID (index.js:9025:19)
at getItemStudyInstanceUID (extensions_cornerstone_src_components_NavigationComponent_NavigationComponent_tsx-extensions_-535d7c.js:5177:46)
at http://localhost:3000/static/js/async/extensions_cornerstone_src_components_NavigationComponent_NavigationComponent_tsx-extensions_-535d7c.js:5182:26
at Array.forEach (<anonymous>)
at Object.groupByStudy [as groupingFunction] (extensions_cornerstone_src_components_NavigationComponent_NavigationComponent_tsx-extensions_-535d7c.js:5181:11)
at AccordionGroup (extensions_cornerstone_src_components_NavigationComponent_NavigationComponent_tsx-extensions_-535d7c.js:2262:29)
at renderWithHooks (lib-react.js:15842:18)
at mountIndeterminateComponent (lib-react.js:20454:13)
at beginWork (lib-react.js:21977:16)
at beginWork$1 (lib-react.js:27816:14)
I also got this exception when navigating to the cobb angle using the arrow buttons in the top-right of the viewport…
TypeError: Cannot read properties of undefined (reading 'canvas')
at CobbAngleTool.renderAnnotation (vendors-node_modules_cornerstonejs_ai_dist_esm_index_js-node_modules_cornerstonejs_core_dist_-e01bb2.js:31105:102)
at handleDrawSvg (vendors-node_modules_cornerstonejs_tools_dist_esm_utilities_contourSegmentation_addContourSeg-671368.js:198:43)
at Array.forEach (<anonymous>)
at http://localhost:3000/static/js/async/vendors-node_modules_cornerstonejs_tools_dist_esm_utilities_contourSegmentation_addContourSeg-671368.js:202:26
at draw (vendors-node_modules_cornerstonejs_tools_dist_esm_utilities_contourSegmentation_addContourSeg-671368.js:12:5)
at AnnotationRenderingEngine._triggerRender (vendors-node_modules_cornerstonejs_tools_dist_esm_utilities_contourSegmentation_addContourSeg-671368.js:194:64)
at AnnotationRenderingEngine._renderFlaggedViewports (vendors-node_modules_cornerstonejs_tools_dist_esm_ut
The testing has been paused because several attempts to get passed step 4 of the testing instructions listed in the PR description.
The testing could not proceed past step 4 because during step 4 (i.e. adding and saving annotations on MPR) the following exception was thrown several times. The app would crash and the browser window was completely black.
Error: getDisplaySetByUID: displaySetInstanceUid must be a string, you passed undefined at DisplaySetService.getDisplaySetByUID (index.js:9025:19) at getItemStudyInstanceUID (extensions_cornerstone_src_components_NavigationComponent_NavigationComponent_tsx-extensions_-535d7c.js:5177:46) at http://localhost:3000/static/js/async/extensions_cornerstone_src_components_NavigationComponent_NavigationComponent_tsx-extensions_-535d7c.js:5182:26 at Array.forEach (<anonymous>) at Object.groupByStudy [as groupingFunction] (extensions_cornerstone_src_components_NavigationComponent_NavigationComponent_tsx-extensions_-535d7c.js:5181:11) at AccordionGroup (extensions_cornerstone_src_components_NavigationComponent_NavigationComponent_tsx-extensions_-535d7c.js:2262:29) at renderWithHooks (lib-react.js:15842:18) at mountIndeterminateComponent (lib-react.js:20454:13) at beginWork (lib-react.js:21977:16) at beginWork$1 (lib-react.js:27816:14)
The items without display set instance uids should be filtered out now.
When linked with https://github.com/cornerstonejs/cornerstone3D/pull/2233 and updated, this should have a number of issues fixed.
Here is a video that best shows the problems encountered with annotations in MPR. The video starts by showing where each annotation is located in each view. The browser is then refreshed, the SR hydrated, MPR launched and then the measurement side panel is used to navigate to each markup one-by-one. In general one of the following typically occurs...
- the view is NOT navigated
- the annotation appears on the current image (or a different image) and NOT on the correct image
- an annotation different than the one clicked appears - typically on the wrong image and/or location
- the annotation appears on the correct image but in the wrong location
To obtain the behaviour in the video...
- Add each annotation seen in the video to the images seen in the video.
- Save the SR
- refresh the browser
- Hydrate the saved SR
- Click each markup one-by-one in the side panel
- Notice the weirdness
https://github.com/user-attachments/assets/8651fd6f-f71c-40a3-92a5-93abdc098aef
I tested everything in https://github.com/OHIF/Viewers/pull/5016#issuecomment-3138140465 it works fine after the changes i made, i will merge after tests passes