fix(tools): make VolumeCroppingTool target vtkVolume actor (overlay-safe)#2668
Merged
wayfarer3130 merged 6 commits intocornerstonejs:mainfrom Apr 20, 2026
Merged
Conversation
… orientation based on image orientation patient values
Contributor
|
@mbellehumeur after some feedback from Denny, please incorporate this commit into your branch: https://github.com/RadicalImaging/CS3D_FUBerlin/commit/bb0ff98929f19c6e1f3525b1b0bbc62300384b8f |
Contributor
Author
I have applied that commit to the OrientationController2 branch. This PR is jsut for volumeCropping despite the name of the branch. |
…clipping plane updates
_getVolumeActor now searches viewport.getActors?.() and picks the entry whose actor.getClassName() is vtkVolume. This avoids accidentally using overlay/non-volume actors when they are registered first. Removed _getVolumeActorEntry: Its logic was fully inlined into _getVolumeActor to simplify the flow. Updated call sites that depended on _getVolumeActorEntry: preMouseDownCallback now calls _getVolumeActor(...) and returns early if none is found. _initialize3DViewports now uses volumeActor directly for mapper/input data access.
wayfarer3130
approved these changes
Apr 20, 2026
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
VolumeCroppingTool previously assumed the viewport “default actor” (or getActors()[0]) was the volume being cropped.
In viewports with 3D overlay actors (e.g. OrientationController) registered before the volume, that assumption breaks: cropping logic can attach clipping planes / mapper operations to the wrong actor.
_getVolumeActor now searches viewport.getActors?.() and picks the entry whose actor.getClassName() is vtkVolume.
This avoids accidentally using overlay/non-volume actors when they are registered first.
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.