fix: Add SRProbe and SRRectangleROI sub-types#5858
Open
igoroctaviano wants to merge 4 commits intomasterfrom
Open
fix: Add SRProbe and SRRectangleROI sub-types#5858igoroctaviano wants to merge 4 commits intomasterfrom
igoroctaviano wants to merge 4 commits intomasterfrom
Conversation
✅ Deploy Preview for ohif-dev canceled.
|
Viewers
|
||||||||||||||||||||||||||||
| Project |
Viewers
|
| Branch Review |
fix/scoord3d-points-bounding-boxes-labels
|
| Run status |
|
| Run duration | 02m 20s |
| Commit |
|
| Committer | Igor Octaviano |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
37
|
| View all changes introduced in this branch ↗︎ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fixes ImagingDataCommons#107
Improves DICOM SR annotation visualization. Per maintainer feedback: create sub-types of Probe and RectangleROI with custom configuration rather than modifying base tools. SRProbe and SRRectangleROI show the semantic label (e.g. "Lesion" from Finding concept) instead of intensity/coordinates or area/stats, and are used only for SR hydration—they do not replace Probe/RectangleROI in the toolbar.
Client feedback addressed:
Changes & Results
New SR subtypes
SRProbe– sub-type of Probe;getSRProbeTextLinesreturns only the label.SRRectangleROI– sub-type of RectangleROI;getSRRectangleROITextLinesreturns only the label.Files added
extensions/cornerstone-dicom-sr/src/utils/srToolGetTextLines.ts– getTextLines implementations for SR subtypes.Files modified
extensions/cornerstone-dicom-sr/src/tools/toolNames.ts– addedSRProbe,SRRectangleROI.extensions/cornerstone-dicom-sr/src/init.ts– register SRProbe and SRRectangleROI tool instances with getTextLines; dashed line styles.extensions/cornerstone-dicom-sr/src/utils/hydrateStructuredReport.ts– useSRProbe/SRRectangleROIastoolNameForRenderingwhen hydrating Probe/RectangleROI; always lock hydrated annotations.extensions/cornerstone-dicom-sr/src/utils/addSRAnnotation.ts– setisLocked: trueand calllocking.setAnnotationLocked()for preview annotations.extensions/cornerstone-dicom-sr/src/utils/getLabelFromDCMJSImportedToolData.js– fallback tofinding.CodeMeaningfor standard DICOM codes (e.g. "Lesion").modes/basic/src/initToolGroups.ts– add SRProbe, SRRectangleROI as passive tools (default, MPR, SRToolGroup).modes/basic-test-mode/src/initToolGroups.ts– same.modes/usAnnotation/src/initToolGroups.js– same.extensions/cornerstone/src/utils/measurementServiceMappings/measurementServiceMappingsFactory.ts– SRProbe → POINT, SRRectangleROI → RECTANGLE.extensions/cornerstone/src/initMeasurementService.ts– add SRProbe, SRRectangleROI to supported tools.extensions/cornerstone/src/utils/measurementServiceMappings/constants/supportedTools.js– add SRProbe, SRRectangleROI.Design decisions
Testing
E2E snapshots may need regeneration for Scoord3dProbe, ScoordRectangle:
Checklist
PR
semantic-release format and guidelines.
Suggested PR title:
feat(cornerstone-dicom-sr): add SRProbe and SRRectangleROI subtypes for label-only SR hydrationCode
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Greptile Summary
Adds
SRProbeandSRRectangleROIsubtypes for DICOM SR annotation visualization. These subtypes display semantic labels (e.g. "Lesion" from Finding concept) instead of intensity/coordinates or area/stats. Subtypes are passive tools used only for SR hydration, not added to toolbar - base Probe/RectangleROI remain unchanged.Key changes:
srToolGetTextLines.tswith label-only getTextLines implementationsinit.tswith custom getTextLines and dashed line styleshydrateStructuredReport.tsmaps Probe→SRProbe, RectangleROI→SRRectangleROI for renderinggetLabelFromDCMJSImportedToolData.jsIssue found:
usAnnotationmode uses static import without null-checking, unlike other modes that use conditional spreading - could cause runtime error if SR extension not loadedConfidence Score: 4/5
modes/usAnnotation/src/initToolGroups.js- needs null-check fix before mergeImportant Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[DICOM SR with Point/Rectangle] --> B[hydrateStructuredReport] B --> C{annotationType?} C -->|Probe| D[Use SRProbe as toolNameForRendering] C -->|RectangleROI| E[Use SRRectangleROI as toolNameForRendering] C -->|Other| F[Use original annotationType] D --> G[Register with measurementService] E --> G F --> G G --> H[Lock annotation - setAnnotationLocked] H --> I{Render annotation} I --> J[getSRProbeTextLines] I --> K[getSRRectangleROITextLines] J --> L[Display label only e.g. 'Lesion'] K --> L L --> M[Annotation rendered with dashed lines]Last reviewed commit: c93d001
(5/5) You can turn off certain types of comments like style here!