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: add grow shrink to growcut tools and box prompt to sam model #1690

Merged
merged 15 commits into from
Dec 9, 2024

Conversation

sedghi
Copy link
Member

@sedghi sedghi commented Dec 9, 2024

  • move island removal to utility
  • fix(segmentation): correct dimension indexing in createPositionCallback and improve null checks in segmentation utilities
  • feat(labelmap): add example for labelmap editing with contour tools
  • refactor(api): enhance segmentation tools and improve BrushTool functionality
  • initial work to apply island to growcut
  • feat(segmentation): enhance island removal functionality and integrate new options
  • fix(annotation): streamline viewport rendering and improve deletion handling
  • feat(annotation): enhance AnnotationTool and VolumetricCalculator functionality
  • feat(segmentation): enhance AI segmentation example and tool integration
  • feat(segmentation): enhance AI segmentation tools and improve user interaction
  • shrink expand
  • fix growcut bed
  • api

Context

Changes & Results

Testing

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] "OS:
  • [] "Node version:
  • [] "Browser:

sedghi added 14 commits December 9, 2024 10:22
…ck and improve null checks in segmentation utilities

- Updated dimension indexing in createPositionCallback to use the correct indices for loops.
- Removed unnecessary parameter from setActiveSegmentation function.
- Added missing import for addRepresentationData in segmentation index.
- Cleaned up commented-out code in SegmentationStateManager.
- Enhanced null checks for annotationUIDsMap in addContourSegmentationAnnotation and createAndAddContourSegmentationsFromClippedSurfaces.
- Improved error handling in filterAnnotationsWithinSlice to account for potential undefined points.

These changes enhance the robustness and correctness of the segmentation functionality.
- Introduced a new example demonstrating the editing of a labelmap using contour tools.
- Implemented UI elements for segment selection and preview rejection.
- Enhanced the LabelmapBaseTool to convert contours into labelmap data.
- Updated example-info.json to include the new labelmap editing feature.

This addition provides users with a practical demonstration of labelmap editing capabilities, improving the overall usability of the toolset.
…ionality

- Removed unused property 'prg' from BrushTool class.
- Introduced new 'IslandRemoval' class and 'internalAddRepresentationData' function to improve segmentation capabilities.
- Updated SplineROITool to handle element details in event processing.
- Enhanced LabelmapBaseTool to utilize a new fill strategy for previews.
- Improved method for retrieving modified slices in LabelmapBaseTool.

These changes streamline the segmentation tools and enhance their functionality, providing a more robust user experience.
…e new options

- Added islandFillOptions to ONNXSegmentationController for controlling island removal behavior.
- Introduced setPCutoff method to adjust the p cutoff value dynamically.
- Updated IslandRemoval class to support new options for internal island filling and edge handling.
- Enhanced integration of IslandRemoval within ONNXSegmentationController to utilize new features during segmentation processing.

These changes improve the flexibility and effectiveness of the segmentation tools, providing users with better control over island removal operations.
…andling

- Updated the AnnotationTool class to directly reference the viewport for rendering, eliminating redundant calls to getEnabledElement.
- Enhanced the deletion handling logic by correcting comments and ensuring proper state management during annotation operations.

These changes improve the efficiency of the annotation tool and clarify the deletion process, contributing to a more reliable user experience.
…ctionality

- Refactored the AnnotationTool class to make isSuvScaled a static method and updated its usage within the class.
- Introduced maxIJKs to NamedStatistics for tracking peak value locations in volumetric data.
- Enhanced VolumetricCalculator with a new statsCallback method to collect peak value locations during statistics calculations.
- Updated labelmapStatistics to utilize the new maxIJKs feature and improved the handling of modality unit options.

These changes improve the functionality and performance of the annotation and volumetric calculation tools, providing better statistical insights and usability.
- Updated the SAMClientSide example to demonstrate a simplified single-viewport AI segmentation setup, including basic navigation tools and minimal AI segmentation tools (MarkerInclude, MarkerExclude, BoxPrompt).
- Refactored the ONNXSegmentationController to include BoxPrompt as a new tool for segmentation prompts.
- Improved viewport handling and rendering logic, allowing for dynamic switching between stack and sagittal views.
- Enhanced the LabelmapBaseTool to manage shared preview data more effectively.
- Added logging elements to track decoding and inference times during segmentation operations.

These changes improve the usability and functionality of the AI segmentation tools, providing a clearer demonstration of their capabilities.
…teraction

- Updated the SAMClientSide example to include additional navigation tools (Zoom, StackScroll, Pan) and refined tool activation logic for better user experience.
- Refactored ONNXSegmentationController to integrate a new LabelmapBaseTool for improved segmentation handling and added functionality for accepting and rejecting previews.
- Enhanced viewport management by adding segmentation representations and improving event handling for keyboard interactions.
- Removed deprecated code and streamlined tool bindings for a cleaner implementation.

These changes significantly enhance the functionality and usability of the AI segmentation tools, providing a more intuitive interface for users.
Copy link

stackblitz bot commented Dec 9, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Dec 9, 2024

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 7245ba2
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/675753a0cc3299000826184a
😎 Deploy Preview https://deploy-preview-1690--cornerstone-3d-docs.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.

@sedghi sedghi changed the title remaining from private branch 1 feat: add grow shrink to growcut tools and box prompt to sam model Dec 9, 2024
@sedghi sedghi merged commit c46ab42 into main Dec 9, 2024
26 checks passed
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.

1 participant