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

feat(segmentation): Enhance Segmentation with New AI and Once Click Tools #4910

Merged
merged 9 commits into from
Apr 1, 2025

Conversation

sedghi
Copy link
Member

@sedghi sedghi commented Apr 1, 2025

fixes #4513
fixes #4512

This pull request includes a variety of updates across several files, primarily focused on updating dependencies, adding new tools, and improving the segmentation functionality. The most important changes are grouped by theme below:

Dependency Updates:

  • Updated @cornerstonejs/adapters, @cornerstonejs/core, and other @cornerstonejs dependencies to version ^3.8.2 in multiple package.json files. [1] [2] [3] [4] [5] [6]

Segmentation Enhancements:

  • Added ONNXSegmentationController import and initialized segmentAI with new models in commandsModule.ts. [1] [2]
  • Introduced new segmentation-related commands such as toggleUseCenterSegmentIndex, clearMarkersForMarkerLabelmap, and toggleLabelmapAssist. [1] [2]
  • Updated the segmentation panel customization to include a switch for Use Center as Segment Index. [1] [2] [3]

Tool Additions:

  • Added new tools: LabelmapSlicePropagationTool, MarkerLabelmapTool, and RegionSegmentPlusTool in initCornerstoneTools.js. [1] [2] [3]

UI Improvements:

  • Added leftPanelRef and rightPanelRef to handle mouse enter events in ViewerLayout to ensure the active element is blurred when necessary. [1] [2] [3] [4] [5]

These changes collectively enhance the functionality and usability of the application, especially in terms of segmentation capabilities and user interface interactions.

sedghi added 7 commits March 31, 2025 10:28
…ggleUseCenterSegmentIndex command in cornerstone extension
- Added support for 'CircularBrushForAutoSegmentAI' in segmentation tool groups.
- Updated commandsModule to accept and reject previews for active labelmap tools, integrating segmentAI functionality.
- Modified ViewerLayout to include refs for left and right panels, improving mouse interaction handling.
- Adjusted webpack configuration for output directory structure.
- Renamed `setSourceViewportForReferenceLinesTool` to `setViewportForToolConfiguration` for clarity and added `toolName` parameter.
- Introduced `_handlePreviewAction` to streamline accept/reject preview actions for labelmap tools.
- Added new commands for `interpolateScrollForMarkerLabelmap` and `clearMarkersForMarkerLabelmap`.
- Integrated `LabelmapSlicePropagationTool` and `MarkerLabelmapTool` into the toolbar and tool groups.
- Updated hotkey bindings to include new commands for marker labelmap functionalities.
- Improved UI elements in the Toolbox for better user experience.
Copy link

netlify bot commented Apr 1, 2025

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/ohif-dev/deploys/67ec2dacdb1aa76935a9d579
😎 Deploy Preview https://deploy-preview-4910--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 1, 2025

Deploy Preview for ohif-platform-docs canceled.

Name Link
🔨 Latest commit c252850
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/67ec2cc7c6e91300084f187f

@sedghi sedghi requested a review from Copilot April 1, 2025 18:02
Copy link

cypress bot commented Apr 1, 2025

Viewers    Run #5031

Run Properties:  status check passed Passed #5031  •  git commit c2528507fc: fix playwright
Project Viewers
Branch Review feat/new-seg-tools-ai
Run status status check passed Passed #5031
Run duration 02m 06s
Commit git commit c2528507fc: fix playwright
Committer sedghi
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 43
View all changes introduced in this branch ↗︎

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances segmentation functionality and updates dependencies while adding several new segmentation-related tools and UI improvements. Key changes include:

  • Dependency upgrades for @cornerstonejs packages to version ^3.8.2.
  • New segmentation tools and commands for improved segmentation and labelmap assist.
  • UI adjustments in toolbar and viewer layouts to support new functionality.

Reviewed Changes

Copilot reviewed 21 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
platform/app/.webpack/webpack.pwa.js Added copy rule for onnxruntime-web assets.
modes/segmentation/src/toolbarButtons.ts Added new segmentation toolbar buttons and updated callbacks.
modes/segmentation/src/initToolGroups.ts Included new segmentation tool groups.
modes/segmentation/src/index.tsx Updated button sections to include new segmentation options.
modes/basic-test-mode/src/toolbarButtons.ts Replaced outdated command for reference lines tool.
extensions/default/src/utils/Toolbox.tsx Made minor styling adjustments.
extensions/default/src/ViewerLayout/index.tsx Added panel refs and blur handler on mouse enter.
extensions/default/src/Toolbar/ToolBoxWrapper.tsx Updated component props to include additional className.
extensions/cornerstone/src/services/SegmentationService/SegmentationService.ts Commented out volume referencing in segmentation service.
extensions/cornerstone/src/initCornerstoneTools.js Imported and registered new segmentation tools.
extensions/cornerstone/src/customizations/segmentationPanelCustomization.tsx Added a new switch for center-based segment index and modified label texts.
extensions/cornerstone/src/commandsModule.ts Introduced new ONNX segmentation commands and updated viewport configuration command.
extensions/cornerstone-dicom-seg/src/getToolbarModule.ts Minor update to toolbar module configuration.
Files not reviewed (7)
  • extensions/cornerstone-dicom-pmap/package.json: Language not supported
  • extensions/cornerstone-dicom-seg/package.json: Language not supported
  • extensions/cornerstone-dicom-sr/package.json: Language not supported
  • extensions/cornerstone-dynamic-volume/package.json: Language not supported
  • extensions/cornerstone/package.json: Language not supported
  • extensions/measurement-tracking/package.json: Language not supported
  • platform/app/package.json: Language not supported

@sedghi sedghi changed the title feat/new seg tools ai feat(segmentation): Enhance Segmentation with New AI and Once Click Tools Apr 1, 2025
@sedghi sedghi merged commit c75a3f3 into master Apr 1, 2025
20 checks passed
@sedghi sedghi deleted the feat/new-seg-tools-ai branch April 1, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant