Skip to content

Conversation

@laura-borghesi-lum00n
Copy link

Description

This pull request introduces a new tool, the IntersectionLinesTool, to the toolkit.
This tool is designed to enhance multi-planar viewing by rendering visual indicators of where one viewport's image plane intersects with another's.
It listens to camera modifications in a designated "source" viewport and automatically updates the intersection lines in all other linked viewports in real-time.

A key feature is the ability for users to interactively modify the slab thickness of the source viewport by simply clicking and dragging the rendered intersection lines.

Key Features

  • Intersection Rendering: Automatically calculates and renders the line of intersection between a source viewport and other viewports within the same tool group.
  • Dynamic Updates: Lines are automatically re-rendered whenever the source viewport's camera is modified (e.g., pan, zoom, scroll), ensuring the visualization is always accurate.
  • Interactive Slab Thickness: Users can click and drag an intersection line to intuitively increase or decrease the slabThickness of the source VolumeViewport. The tool correctly determines which of the two slab lines is being dragged to ensure thickness is adjusted correctly (dragging one line away from the center increases thickness, while dragging the other does the same).
  • Visual Feedback: The intersection lines are highlighted on mouse hover to indicate to the user that they are interactive.
  • Robust Interaction: Implements cancel and handleSelectedCallback methods as required by the AnnotationTool base class, ensuring predictable behavior and integration with the tool framework.
  • Configuration: The tool is configurable, allowing developers to specify the sourceViewportId, line color, and lineWidth.

Technical Details

  • The slab thickness modification relies on robust vector projection. The mouse drag vector (delta) is projected directly onto the source viewport's view plane normal. This ensures that only the component of motion perpendicular to the slab contributes to the thickness change, preventing unexpected behavior from lateral mouse movements.
  • The activeLineIndex, determined on click, is used to correctly apply this change, either increasing or decreasing the slab thickness based on which line is manipulated.

@daron1337
Copy link
Member

Cosa facciamo con questa PR @laura-borghesi-lum00n ?

@laura-borghesi-lum00n
Copy link
Author

non saprei se mergiare il nostro nuovo tool nel nostro fork oppure aprire una pr direttamente in cornerstone3d per aggiungere la funzionalità

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.

4 participants