Skip to content

Fix improved brush shape for rotated images#2743

Open
Devu-trenser wants to merge 1 commit into
cornerstonejs:mainfrom
arul-trenser:fix-improved-brush-shape-for-rotated-images
Open

Fix improved brush shape for rotated images#2743
Devu-trenser wants to merge 1 commit into
cornerstonejs:mainfrom
arul-trenser:fix-improved-brush-shape-for-rotated-images

Conversation

@Devu-trenser
Copy link
Copy Markdown
Contributor

Context

Fixes incorrect shape rendering when using brush tools with circular/spherical/rectangle shapes in rotated viewports.

Fixes : #2651

⚠️⚠️ This PR targets the arul-trenser:feat-axis-based-image-stretching branch from #2443.

Changes & Results

Changes

  • Fixed incorrect shape rendering in rotated/oblique viewports.
  • Updated fill logic to use viewport-aligned axes.
  • Improved voxel inclusion checks for better geometric consistency.
  • Fixed rectangle point ordering instability.
  • Reduced slice leakage and unintended fills across neighboring slices.

Results
Before

  • Circular/spherical/rectangluar brushes could appear as distorted shapes in rotated views.
  • Rectangle rendering was unstable depending on viewport orientation.

After

  • Circular and spherical brushes maintain almost similar to the expected geometry in rotated/oblique views.
  • Improved consistency and stability across all supported brush shapes.

Testing

  1. Run the Axis-based Image Stretching example.
  2. Rotate the viewport to different oblique angles (e.g. 40°–45°).
  3. Draw annotations using:
    • Circular Brush
    • Sphere Brush
    • Rectangle Brush
  4. Verify:
    • Shapes render correctly in rotated views.
    • Rectangle fills remain stable and properly aligned.

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: Ubuntu 24.04
  • [] "Node version: 20
  • [] "Browser: Chrome 139

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@Devu-trenser Devu-trenser force-pushed the fix-improved-brush-shape-for-rotated-images branch from 2c133c5 to c9fd4f5 Compare May 26, 2026 05:14
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.

[Bug] Brush is not working properly for rotated viewports

1 participant